carpedm20 / LINE

May the LINE be with you...
http://carpedm20.github.io/line/
Other
823 stars 192 forks source link

Bad protocol id in the message: 60 #91

Open chbright opened 7 years ago

chbright commented 7 years ago

File "C:\Python27\lib\site-packages\line\client.py", line 88, in init self.login() File "C:\Python27\lib\site-packages\line\api.py", line 116, in login self.com_name, self.provider, self.certificate) File "C:\Python27\lib\site-packages\curve\CurveThrift.py", line 344, in loginWithIdentityCredentialForCertificate return self.recv_loginWithIdentityCredentialForCertificate() File "C:\Python27\lib\site-packages\curve\CurveThrift.py", line 363, in recv_loginWithIdentityCredentialForCertificate (fname, mtype, rseqid) = self._iprot.readMessageBegin() File "C:\Python27\lib\site-packages\thrift\protocol\TCompactProtocol.py", line 326, in readMessageBegin 'Bad protocol id in the message: %d' % proto_id) thrift.protocol.TProtocol.TProtocolException: Bad protocol id in the message: 60

max32002 commented 7 years ago
  1. previous call writeMessageBegin self.PROTOCOL_ID = 130

  2. after unpack read message readMessageBegin proto_id = 60 readMessageBegin PROTOCOL_ID = 130 readMessageBegin version = 8 readMessageBegin self.VERSION = 1

if proto_id != self.PROTOCOL_ID: raise TProtocolException(TProtocolException.BAD_VERSION, 'Bad protocol id in the message: %d' % proto_id)

max32002 commented 7 years ago

in the def login(self): in api.py self._headers['X-Line-Application']=app self.transport.setCustomHeaders(self._headers)

shinomura: now I can login and get authtoken

1.disable header "X-Line-Application" before get json 2.add it back after that then change LINE_DOMAIN from http to https

chobiz13 commented 7 years ago

@max32002 may i know what's Thrift and Python version do you use?

max32002 commented 7 years ago

thrift (0.9.3) Python 2.7.10

chobiz13 commented 7 years ago

Error message: Traceback (most recent call last): File "", line 1, in File "line/client.py", line 88, in init self.login() File "line/api.py", line 130, in login self.com_name, self.provider, self.certificate) File "build/bdist.macosx-10.6-intel/egg/curve/CurveThrift.py", line 344, in loginWithIdentityCredentialForCertificate File "build/bdist.macosx-10.6-intel/egg/curve/CurveThrift.py", line 363, in recv_loginWithIdentityCredentialForCertificate File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/thrift/protocol/TCompactProtocol.py", line 313, in readMessageBegin 'Bad protocol id in the message: %d' % proto_id) thrift.protocol.TProtocol.TProtocolException: Bad protocol id in the message: 60

Still display error messages even follow your version of thrift and Python. line-0.8.2 Python-2.7.10 requests-2.13.0 curve-0.1.0 rsa-3.4.2 thrift-0.9.3 pyasn1-0.2.3

I also tried to:

chungsir in client.py disable self._headers['X-Line-Application']=app then in api.py in def login(self):

j = self.get_json(self.LINE_CERTIFICATE_URL)

add: self._headers['X-Line-Application']=app self.transport.setCustomHeaders(self._headers)

If i switch to use Thrift version 0.10.0 will get different error message like TypeError: 'unicode' does not have the buffer interface

ii64 commented 7 years ago

dude, use another line server For 'unicode' buffer See this #98

R-N commented 7 years ago

I'm having the same "bad protocol id in the message: 60" error. I've reinstalled Thrift to 0.9.3 I'm using Python 2.7.1 I've changed LINE_DOMAIN to https in api.py I've disabled setting 'X-Line-Application' header in client.py I've added in api.py: self._headers['X-Line-Application'] = app self.transport.setCustomHeaders(self._headers) just after: j = self.get_json(self.LINE_CERTIFICATE_URL) I've set is_mac to False.

Btw I don't get max's first comment. the previous call and after unpack message stuff.

Nilpo commented 7 years ago

I get this same error while logging in with authToken.

Mari2928 commented 7 years ago

max32002 and anysz >> I don't get their comments. What's the solution and how do I change line server?

Nilpo commented 7 years ago

Max posted the exact solution above.

Mari2928 commented 7 years ago

Sorry I don't get what exactly to do. Does it mean adding 1 and 2 ( in his first comment) in TCompactProtocol.py?