{"action":"closed","issue":{"url":"https://api.github.com/repos/cloudera/impyla/issues/304","repository_url":"https://api.github.com/repos/cloudera/impyla","labels_url":"https://api.github.com/repos/cloudera/impyla/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/cloudera/impyla/issues/304/comments","events_url":"https://api.github.com/repos/cloudera/impyla/issues/304/events","html_url":"https://github.com/cloudera/impyla/issues/304","id":329270024,"node_id":"MDU6SXNzdWUzMjkyNzAwMjQ=","number":304,"title":"SQLAlchemy connects and then times out","user":{"login":"aaronbannin","id":6948336,"node_id":"MDQ6VXNlcjY5NDgzMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/6948336?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronbannin","html_url":"https://github.com/aaronbannin","followers_url":"https://api.github.com/users/aaronbannin/followers","following_url":"https://api.github.com/users/aaronbannin/following{/other_user}","gists_url":"https://api.github.com/users/aaronbannin/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronbannin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronbannin/subscriptions","organizations_url":"https://api.github.com/users/aaronbannin/orgs","repos_url":"https://api.github.com/users/aaronbannin/repos","events_url":"https://api.github.com/users/aaronbannin/events{/privacy}","received_events_url":"https://api.github.com/users/aaronbannin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-05T01:27:51Z","updated_at":"2018-06-05T17:40:55Z","closed_at":"2018-06-05T17:40:54Z","author_association":"NONE","body":"I'm attempting to connect to Impala via SQLAlchemy via Superset. It seems to authenticate and connect, but then times out. Authentication is via LDAP.\r\n\r\n```\r\n2018-06-04 21:06:11,524:DEBUG:impala.hiveserver2:Connecting to HiveServer2 host with PLAIN authentication mechanism\r\n2018-06-04 21:06:11,524:DEBUG:impala._thrift_api:get_socket: host=host port=21050 use_ssl=False ca_cert=None\r\n2018-06-04 21:06:11,524:DEBUG:impala._thrift_api:get_transport: socket=<thriftpy.transport.socket.TSocket object at 0x7fcaf5468908> host=host kerberos_service_name=impala auth_mechanism=PLAIN user=abannin password=fuggetaboutit\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:sock=<thriftpy.transport.socket.TSocket object at 0x7fcaf5468908> transport=<thrift_sasl.TSaslClientTransport object at 0x7fcaf5468940> protocol=<thriftpy.protocol.binary.TBinaryProtocol object at 0x7fcaf54689e8> service=<thriftpy.thrift.TClient object at 0x7fcaf5468eb8>\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:HiveServer2Connection(service=<impala.hiveserver2.HS2Service object at 0x7fcaf5468f28>, default_db=default)\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:Getting a cursor (Impala session)\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:.cursor(): getting new session_handle\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:OpenSession: req=TOpenSessionReq(client_protocol=5, username='root', configuration=None, password=None)\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:Attempting to open transport (tries_left=3)\r\n2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:Transport opened\r\n[2018-06-04 21:07:12 +0000] [10418] [CRITICAL] WORKER TIMEOUT (pid:10423)\r\n2018-06-04 21:07:12,038:DEBUG:impala.hiveserver2:Closing HS2 connection\r\n2018-06-04 21:07:12,038:DEBUG:impala.hiveserver2:close_service: client=<thriftpy.thrift.TClient object at 0x7fcaf5468eb8>\r\n[2018-06-04 21:07:12 +0000] [10423] [INFO] Worker exiting (pid: 10423)\r\n[2018-06-04 21:07:12 +0000] [10636] [INFO] Booting worker with pid: 10636\r\n```\r\n\r\nWe can see that `2018-06-04 21:06:11,536:DEBUG:impala.hiveserver2:Transport opened` is generated after a successful LDAP bind on the Impala side:\r\n\r\n```\r\nI0604 21:06:11.527957 6251 authentication.cc:249] Trying simple LDAP bind for: uid=abannin,cn=users,cn=compat,dc=dc,dc=internal \r\nI0604 21:06:11.534382 6251 authentication.cc:261] LDAP bind successful \r\nI0604 21:06:11.534394 6251 authentication.cc:459] Successfully authenticated client user \"abannin\"\r\n```\r\n\r\nI made a quick script to verify connection with just sqlalchemy (no Superset), and it fails the same way:\r\n\r\n```\r\nimport sqlalchemy\r\n\r\nprint('begin')\r\nengine = sqlalchemy.create_engine('impala://{host}:21050/default?auth_mechanism=PLAIN&password={password}&user={user}')\r\nprint('created engine {}'.format(engine))\r\n\r\nconn = engine.connect()\r\nprint('connected conn={} closed={} info={}'.format(conn, conn.closed, conn.info))\r\n\r\nres = conn.execute(\"show tables\")\r\nprint(res.fetchall())\r\nprint('fin')\r\n```\r\n\r\nAny thoughts on causes or possible remedies?"}}
{"actor":{"display_login":"aaronbannin"}}