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.

'TSocket' object has no attribute 'isOpen'

See original GitHub issue

I’m seeing this error for the first time:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-b8033d8b7753> in <module>()
      1 impala.dbapi.connect(host=HOST, port=PORT, auth_mechanism='PLAIN',
----> 2                     user=USER, password=PASSWORD)

~/miniconda2/envs/env/lib/python3.6/site-packages/impala/dbapi.py in connect(host, port, database, timeout, use_ssl, ca_cert, auth_mechanism, user, password, kerberos_service_name, use_ldap, ldap_user, ldap_password, use_kerberos, protocol)
    145                           ca_cert=ca_cert, user=user, password=password,
    146                           kerberos_service_name=kerberos_service_name,
--> 147                           auth_mechanism=auth_mechanism)
    148     return hs2.HiveServer2Connection(service, default_db=database)
    149 

~/miniconda2/envs/env/lib/python3.6/site-packages/impala/hiveserver2.py in connect(host, port, timeout, use_ssl, ca_cert, user, password, kerberos_service_name, auth_mechanism)
    756     transport = get_transport(sock, host, kerberos_service_name,
    757                               auth_mechanism, user, password)
--> 758     transport.open()
    759     protocol = TBinaryProtocol(transport)
    760     if six.PY2:

~/miniconda2/envs/env/lib/python3.6/site-packages/thrift_sasl/__init__.py in open(self)
     65 
     66   def open(self):
---> 67     if not self._trans.isOpen():
     68       self._trans.open()
     69 

AttributeError: 'TSocket' object has no attribute 'isOpen'

These are versions I have installed:

thrift==0.9.3
thrift-sasl==0.3.0
thriftpy==0.3.9
impyla==0.14.0

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:25 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
Kxrrcommented, Aug 20, 2019

The dependencies below work for me in docker container to initialize hive and impala client both.

system version

Python 3.6.8 Debian GNU/Linux 9 (stretch)

requirements.txt

impyla==0.15.0
sasl==0.2.1
thrift_sasl==0.2.1
thriftpy==0.3.9
thriftpy2==0.4.0

apt packages

sudo apt-get install libsasl2-dev libsasl2-2 libsasl2-modules-gssapi-mit

4reactions
ghostcommented, Oct 12, 2017

yes, this works, thanks! and also, suddenly, i needed sasl==0.2.1. And then, all together, it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

impyla (0.14.0) ERROR - 'TSocket' object has no attribute ...
I had the same issue and useed the following packages: pip uninstall thrift-sasl pip uninstall impyla pip uninstall thrift pip install ...
Read more >
impyla (0.14.0) ERROR - 'TSocket' object has no attribute ...
Coding example for the question impyla (0.14.0) ERROR - 'TSocket' object has no attribute 'isOpen'
Read more >
Impyla kerberos based connection - Cloudera Community
AttributeError : 'TSocket' object has no attribute 'isOpen'. Where as the ... (-4) SASL(-4): no mechanism available: No worthy mechs found'").
Read more >
T183145 Refresh SWAP notebook hardware
AttributeError : 'TSocket' object has no attribute 'isOpen'. This might help: https://github.com/cloudera/impyla/issues/268 · Ottomata added a comment.
Read more >
python中impyla包报'TSocket' object has no attribute 'isOpen'错误
经搜索得知,是thrift-sasl的版本太高了(0.3.0),故将thrift-sasl的版本降级到0.2.1pip install thrift-sasl==0.2.1经测试impyla 可以正常使用。
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