LINE icon indicating copy to clipboard operation
LINE copied to clipboard

Bad protocol id in the message: 60

Open chbright opened this issue 9 years ago • 11 comments

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

chbright avatar Feb 15 '17 13:02 chbright

  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 avatar Feb 17 '17 03:02 max32002

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

max32002 avatar Mar 05 '17 18:03 max32002

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

chobiz13 avatar Mar 13 '17 09:03 chobiz13

thrift (0.9.3) Python 2.7.10

max32002 avatar Mar 13 '17 09:03 max32002

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

chobiz13 avatar Mar 14 '17 08:03 chobiz13

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

ii64 avatar Mar 28 '17 07:03 ii64

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.

R-N avatar May 09 '17 03:05 R-N

I get this same error while logging in with authToken.

Nilpo avatar May 24 '17 08:05 Nilpo

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

Mari2928 avatar Jun 03 '17 06:06 Mari2928

Max posted the exact solution above.

Nilpo avatar Jun 03 '17 07:06 Nilpo

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

Mari2928 avatar Jun 03 '17 08:06 Mari2928