Skip to content

TypeError: exceptions must derive from BaseException [JIRA: CLIENTS-878] #480

@Tinche

Description

@Tinche

Full traceback:

Traceback (most recent call last):
  File "/root/.venv/lib/python3.5/site-packages/riak/client/transport.py", line 121, in _with_retries
    return fn(transport)
  File "/root/.venv/lib/python3.5/site-packages/riak/client/transport.py", line 177, in thunk
    return fn(self, transport, *args, **kwargs)
  File "/root/.venv/lib/python3.5/site-packages/riak/client/operations.py", line 712, in get
    notfound_ok=notfound_ok)
  File "/root/.venv/lib/python3.5/site-packages/riak/transports/tcp/transport.py", line 135, in get
    resp_code, resp = self._request(msg, codec)
  File "/root/.venv/lib/python3.5/site-packages/riak/transports/tcp/transport.py", line 537, in _request
    resp_code, data = self._send_recv(msg_code, data)
  File "/root/.venv/lib/python3.5/site-packages/riak/transports/tcp/connection.py", line 33, in _send_recv
    return self._recv_msg()
  File "/root/.venv/lib/python3.5/site-packages/riak/transports/tcp/connection.py", line 158, in _recv_msg
    msgbuf = self._recv_pkt()
  File "/root/.venv/lib/python3.5/site-packages/riak/transports/tcp/connection.py", line 172, in _recv_pkt
    msglen_buf = self._recv(4)
  File "/root/.venv/lib/python3.5/site-packages/riak/transports/tcp/connection.py", line 189, in _recv
    raise BadResource('recv_into returned zero bytes unexpectedly')
riak.transports.pool.BadResource: recv_into returned zero bytes unexpectedly

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/ngs_worker/worker.py", line 148, in run
    user.store(ngs_thread.executor)
  File "/root/ngs_worker/middleware/ngs_user.py", line 218, in store
    self.savegame.store(executor)
  File "/root/ngs_worker/middleware/ngs_savegame.py", line 258, in store
    self.main_riak.store(executor=executor)
  File "/root/ngs_worker/middleware/ngs_main_riak.py", line 175, in store
    robj = bucket.get(self.username, notfound_ok=True)  # type: RiakObject
  File "/root/.venv/lib/python3.5/site-packages/riak/bucket.py", line 234, in get
    notfound_ok=notfound_ok)
  File "/root/.venv/lib/python3.5/site-packages/riak/riak_object.py", line 299, in reload
    self.client.get(self, r=r, pr=pr, timeout=timeout)
  File "/root/.venv/lib/python3.5/site-packages/newrelic-2.62.0.47/newrelic/api/function_trace.py", line 110, in literal_wrapper
    return wrapped(*args, **kwargs)
  File "/root/.venv/lib/python3.5/site-packages/riak/client/transport.py", line 179, in wrapper
    return self._with_retries(pool, thunk)
  File "/root/.venv/lib/python3.5/site-packages/riak/client/transport.py", line 134, in _with_retries
    raise e.args[0]
TypeError: exceptions must derive from BaseException

This line: https://github.com/basho/riak-python-client/blob/master/riak/client/transport.py#L134 expects BadResource to be initialized with another exception, which isn't the case here: https://github.com/basho/riak-python-client/blob/master/riak/transports/tcp/connection.py#L189 (it's initialized with a string).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions