question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client hangs when connecting to HiveServer2

See original GitHub issue

When I try to run the following code, the client hangs when trying to connect to Hive:

from impala.dbapi import connect

conn = connect(host='host_running_hs2_service', port=10000, user='awoolford', password='Bzzzzz')
cursor = conn.cursor()          <- hangs here
cursor.execute('show tables')
results = cursor.fetchall()
print results

I was able to connect to HiveServer2, via a Java client, and so it seems that the connectivity issue is Python/Impyla specific. When I debug/step-into, the code hangs at line 873 of hiveserver2.py.

Hive 1.1.0-cdh5.5.1 Python 2.7.11 | Anaconda 2.3.0 Impyla installed by pip today (2016-03-07).

Do you have any thoughts/suggestions?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
amanjunathcommented, Apr 2, 2016

@alexwoolford @wesm I was facing the same issue. Changing the auth_mechanism to ‘PLAIN’ worked for me. Here’s the documentation in the code: auth_mechanism : {'NOSASL', 'PLAIN', 'GSSAPI', 'LDAP'} Specify the authentication mechanism.'NOSASL’for unsecured Impala. 'PLAIN’for unsecured Hive (because Hive requires the SASL transport).'GSSAPI’for Kerberos and’LDAP’for Kerberos with LDAP. The default used is NOSASL: def connect(host='localhost', port=21050, database=None, timeout=None, use_ssl=False, ca_cert=None, auth_mechanism='NOSASL', user=None, password=None, kerberos_service_name='impala', use_ldap=None, ldap_user=None, ldap_password=None, use_kerberos=None, protocol=None):

0reactions
LeeInJaecommented, Jun 23, 2021

@DVAlexHiggs Hi Alex, I also faced this issue. When I do fetchall() keep stopping without end or error.

I wonder if you solved this problem. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

impyla hangs when connecting to HiveServer2 - Stack Overflow
I saw this "hangs forever" thing happens when a non-secure client tries to connect to a secure server. In this case, the server...
Read more >
Solved: Beeline connection hangs without any error - 190711
After analyzing Hiveserver logs we found that Hiveserver was unable to create new threads and hence Hive queries are not working. This is...
Read more >
Using the HiveServer2 JDBC new connections to Hadoop ...
Whilst attempting to use a HiveServer2 JDBC connection, the connection hangs providing no error to the client for diagnosis.
Read more >
Re: JDBC/beeline client hangs with HiverServer2 (0.13.1)
Re: JDBC/beeline client hangs with HiverServer2 (0.13.1) ... The setting you want is: hive.server2.authentication – Authentication mode, ...
Read more >
Creating a Hive Server 2 Connection Hangs When Saving – Datameer
Problem When creating a Hive Server 2 Connection in Datameer, the user completes all the required fields and then clicks Save. The next......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found