Open chbright opened 7 years ago
previous call writeMessageBegin self.PROTOCOL_ID = 130
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)
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 may i know what's Thrift and Python version do you use?
thrift (0.9.3) Python 2.7.10
Error message:
Traceback (most recent call last):
File "
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
dude, use another line server For 'unicode' buffer See this #98
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.
I get this same error while logging in with authToken.
max32002 and anysz >> I don't get their comments. What's the solution and how do I change line server?
Max posted the exact solution above.
Sorry I don't get what exactly to do. Does it mean adding 1 and 2 ( in his first comment) in TCompactProtocol.py?
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