Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thriftpy2.protocol.exc.TProtocolException: Bad protocol id in the message: 72 #244

Open
xiasanshi opened this issue Aug 14, 2020 · 4 comments

Comments

@xiasanshi
Copy link

xiasanshi commented Aug 14, 2020

connection = happybase.Connection( port=9090, protocol='compact')
print('All tables: ', connection.tables(), '\n')

errors:

Traceback (most recent call last):
  File "D:/python/workspace/spider/mo-spider-client/tests/test-happybase.py", line 62, in <module>
    main()
  File "D:/python/workspace/spider/mo-spider-client/tests/test-happybase.py", line 26, in main
    print('All tables: ', connection.tables(), '\n')
  File "D:\python\workspace\spider\mo-spider-client\venv\lib\site-packages\happybase\connection.py", line 242, in tables
    names = self.client.getTableNames()
  File "D:\python\workspace\spider\mo-spider-client\venv\lib\site-packages\thriftpy2\thrift.py", line 219, in _req
    return self._recv(_api)
  File "D:\python\workspace\spider\mo-spider-client\venv\lib\site-packages\thriftpy2\thrift.py", line 231, in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
  File "D:\python\workspace\spider\mo-spider-client\venv\lib\site-packages\thriftpy2\protocol\compact.py", line 148, in read_message_begin
    % proto_id)
thriftpy2.protocol.exc.TProtocolException: Bad protocol id in the message: 72
hbase cmd is:hbase thrift start --infoport 9095 --port 9090 -threadpool --bind 0.0.0.0 --compact

hbase version is hbase-1.2.0-cdh5.14.2

@wbolster
Copy link
Member

never seen this before. have you tried other thrift protocols?

see e.g. carpedm20/LINE#26 for a similar error message

is this reproducable with python 3?

@NicholasZXT
Copy link

I encounterd the same error and solved it by checking hbase configuration in cloudera manager and ensure the following items off:
hbase.regionserver.thrift.http = False hbase.thrift.support.proxyuser = False # maybe this one is not necessary
but I have no idea why does it work, expecting someone else giving more detailed explainations.

@aisk
Copy link
Contributor

aisk commented Dec 5, 2023

Protocol id is the first byte of the response. The magic number 72 is the ascii code H.

I think you've connected to a HTTP Server with thrift client (happybase), the HTTP response format's first line is something like HTTP/1.1 200 OK.

@MoonCesar
Copy link

I encounterd the same error and solved it by checking hbase configuration in cloudera manager and ensure the following items off: hbase.regionserver.thrift.http = False hbase.thrift.support.proxyuser = False # maybe this one is not necessary but I have no idea why does it work, expecting someone else giving more detailed explainations.

this help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants