SupraSummus / ipfs-api-mount

Mount IPFS directory as local FS.
MIT License
27 stars 5 forks source link

ipfshttpclient.exceptions.StatusError: HTTPError: 405 Client Error: Method Not Allowed #20

Closed jcea closed 4 years ago

jcea commented 4 years ago

I am running IPFS 0.6.0.

When trying to use ipfs-api-mount, I get this exception:

jcea@jcea:/tmp$ mkdir a
jcea@jcea:/tmp$ ipfs-api-mount QmVT8ZMnTsqLqaZ2DCKZboQni3fyyroQutCog6hhcApDEW /tmp/a
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/http.py", line 266, in _do_raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: http+ip4://127.0.0.1:5001/api/v0/version?stream-channels=true

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/ipfs-api-mount", line 52, in <module>
    with ipfshttpclient.connect(
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/client/__init__.py", line 101, in connect
    version_str = client.version()["Version"]
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/client/base.py", line 15, in wrapper
    result = func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/client/miscellaneous.py", line 204, in version
    return self._client.request('/version', decoder='json', **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/http.py", line 51, in wrapper
    return func(self, *args, **merged)
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/http.py", line 385, in request
    res = self._request(method, url, params, stream, files, headers,
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/http.py", line 307, in _request
    self._do_raise_for_status(res)
  File "/usr/local/lib/python3.8/site-packages/ipfshttpclient/http.py", line 286, in _do_raise_for_status
    six.raise_from(exceptions.StatusError(error), error)
  File "<string>", line 3, in raise_from
ipfshttpclient.exceptions.StatusError: HTTPError: 405 Client Error: Method Not Allowed for url: http+ip4://127.0.0.1:5001/api/v0/version?stream-channels=true

Help!

SupraSummus commented 4 years ago

Thanks for reporting. I'll check this out and hopefully fix soon.

SupraSummus commented 4 years ago

I've upgraded ipfs client library to support newer go-ipfs (#21). New version is published to pypi (0.3.1).

Let me know if the problem is fixed for you.

jcea commented 4 years ago

I can not confirm because I now have another traceback before (apparently) trying to contact the IPFS daemon: #23

jcea commented 4 years ago

Issue seems to be solved in release 0.3.2. Thanks.