Page MenuHomeSoftware Heritage
Paste P833

computers says no (to be polite) ¯\_(ツ)_/¯
ActivePublic

Authored by ardumont on Oct 22 2020, 7:57 PM.
swh  swh  tony  yavin4  ~  work  …  repo  swh  swh-environment  master  15+  SIGINT  %  doco exec swh-vault-worker /bin/bash
swh@9d500dd5f25e:/$ python
Python 3.7.4 (default, Jul 13 2019, 14:04:11)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from swh.core.config import load_from_envvar
>>> from swh.model.hashutil import hash_to_bytes
>>> from swh.vault import get_vault
>>> config = load_from_envvar()
>>> vault = get_vault(**config['vault'])
>>> vault.task_info(obj_type="directory", obj_id=hash_to_bytes("838bc7ca7541fd96ed6e665c1485a0f8b6d4c3f3"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: get() missing 1 required positional argument: 'endpoint'
>>> vault.task_info(obj_type="directory", obj_id=hash_to_bytes("838bc7ca7541fd96ed6e665c1485a0f8b6d4c3f3"))
Traceback (most recent call last):
File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/core/api/__init__.py", line 327, in raise_for_status
exception = pickle.loads(data)
TypeError: a bytes-like object is required, not 'str'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/core/api/__init__.py", line 181, in meth_
return self.post(meth._endpoint_path, post_data)
File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/core/api/__init__.py", line 278, in post
return self._decode_response(response)
File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/core/api/__init__.py", line 352, in _decode_response
self.raise_for_status(response)
File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/core/api/__init__.py", line 339, in raise_for_status
raise RemoteException(payload=data, response=response)
swh.core.api.RemoteException: 405: Method Not Allowed

Event Timeline

return self.post(meth._endpoint_path, post_data)

it's supposed to be a "get"!

ok, got it, the rpc client code is inconsistent with the server part.
i'm currently opening a diff to fix that.