Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

TypeError('__str__ returned non-string (type bytes)',) #283

Open
DeoLeung opened this issue Mar 13, 2017 · 2 comments
Open

TypeError('__str__ returned non-string (type bytes)',) #283

DeoLeung opened this issue Mar 13, 2017 · 2 comments

Comments

@DeoLeung
Copy link

Hi,

I'm using happybase==1.0.0 & thriftpy==0.3.9 to scan a table,
at very uncertain point(different each time), it throws exception like below, can anyone give me some hint on what happened?

/python3.5/site-packages/happybase/table.py in scan(self, row_start, row_stop, row_prefix, columns, filter, timestamp, include_timestamp, batch_size, scan_batching, limit, sorted_columns)
    393                 items = self.connection.client.scannerGetList(
--> 394                     scan_id, how_many)
    395

/python3.5/site-packages/thriftpy/thrift.py in _req(self, _api, *args, **kwargs)
    197         if not getattr(result_cls, "oneway"):
--> 198             return self._recv(_api)
    199

/python3.5/site-packages/thriftpy/thrift.py in _recv(self, _api)
    214             self._iprot.read_message_end()
--> 215             raise x
    216         result = getattr(self._service, _api + "_result")()

<class 'str'>: (<class 'TypeError'>, TypeError('__str__ returned non-string (type bytes)',))
@mazzma12
Copy link

mazzma12 commented Jul 16, 2018

Any update on this one ?

@mazzma12
Copy link

mazzma12 commented Jul 19, 2018

It means that the thrift server received messages as bytes, which is linked to using Thrift version 2 according to this SO Post

Happybase only supports Thrift version 1 protocol at the moment according to thheir doc
The solution to me was to restart the server with hbase thrift1 start and it fixed it.

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

No branches or pull requests

2 participants