Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/hskj/anaconda3/lib/python3.5/site-packages/happybase/connection.py", line 242, in tables
    names = self.client.getTableNames()
  File "/hskj/anaconda3/lib/python3.5/site-packages/thriftpy/thrift.py", line 198, in _req
    return self._recv(_api)
  File "/hskj/anaconda3/lib/python3.5/site-packages/thriftpy/thrift.py", line 210, in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
  File "thriftpy/protocol/cybin/cybin.pyx", line 439, in cybin.TCyBinaryProtocol.read_message_begin (thriftpy/protocol/cybin/cybin.c:6470)
cybin.ProtocolError: No protocol version header
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
224 views
Welcome To Ask or Share your Answers For Others

1 Answer

The problem seems related to the usage of the "strict read/write" flags. There is a non-standard "cybin" implementation of the standard Thrift binary protocol, the error is in this particular code block:

def read_message_begin(self):
    cdef int32_t size, version, seqid
    cdef TType ttype

    size = read_i32(self.trans)
    if size < 0:
        version = size & VERSION_MASK
        if version != VERSION_1:
            raise ProtocolError('invalid version %d' % version)

        name = c_read_val(self.trans, T_STRING)
        ttype = <TType>(size & TYPE_MASK)
    else:
        if self.strict_read:
            raise ProtocolError('No protocol version header')       // <<<<<<

        name = c_read_string(self.trans, size)
        ttype = <TType>(read_i08(self.trans))

    seqid = read_i32(self.trans)

    return name, ttype, seqid

Without having tried, I'd guess that setting the "strict read" flag to false (instead of true) when instantiating the CyBin protocol should do the trick.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...