Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.id() is rejected when using go-ipfs beyond v0.4.23 #212

Closed
machawk1 opened this issue Apr 28, 2020 · 2 comments
Closed

client.id() is rejected when using go-ipfs beyond v0.4.23 #212

machawk1 opened this issue Apr 28, 2020 · 2 comments

Comments

@machawk1
Copy link
Contributor

ipfshttpclient 0.4.13.2
Python 3.8
macOS 10.15.4

With go-ipfs v0.4.23

>>> import ipfshttpclient
>>> x = ipfshttpclient.Client('/dns/localhost/tcp/5001/http')
>>> x.id()
ID': 'QmfYc...', 'PublicKey': 'CAASpg...

With go-ipfs 0.5.0-rc2 (supported per the README)

>>> import ipfshttpclient
>>> x = ipfshttpclient.Client('/dns/localhost/tcp/5001/http')
>>> x.id()
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 266, in _do_raise_for_status
    response.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: http://localhost:5001/api/v0/id?stream-channels=true

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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/client/base.py", line 15, in wrapper
    result = func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/client/miscellaneous.py", line 89, in id
    return self._client.request('/id', args, decoder='json', **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 51, in wrapper
    return func(self, *args, **merged)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 385, in request
    res = self._request(method, url, params, stream, files, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 307, in _request
    self._do_raise_for_status(res)
  File "/Library/Frameworks/Python.framework/Versions/3.8/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://localhost:5001/api/v0/id?stream-channels=true

With go-ipfs 0.5.0 (current latest)

>>> import ipfshttpclient
>>> x = ipfshttpclient.Client('/dns/localhost/tcp/5001/http')
>>> x.id()
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 266, in _do_raise_for_status
    response.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Method Not Allowed for url: http://localhost:5001/api/v0/id?stream-channels=true

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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/client/base.py", line 15, in wrapper
    result = func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/client/miscellaneous.py", line 89, in id
    return self._client.request('/id', args, decoder='json', **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 51, in wrapper
    return func(self, *args, **merged)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 385, in request
    res = self._request(method, url, params, stream, files, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ipfshttpclient/http.py", line 307, in _request
    self._do_raise_for_status(res)
  File "/Library/Frameworks/Python.framework/Versions/3.8/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://localhost:5001/api/v0/id?stream-channels=true

The daemons in the the last working version and the current seem to have similar output for the API on launch:

go-ipfs v0.5.0 daemon launch:

Swarm listening on /ip4/192.168.1.155/tcp/4001
Swarm listening on /ip4/192.168.1.167/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.1.155/tcp/4001
Swarm announcing /ip4/192.168.1.167/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

go-ipfs v0.4.23 daemon launch:

Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.1.155/tcp/4001
Swarm listening on /ip4/192.168.1.167/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/100.34.119.17/tcp/4001
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.1.155/tcp/4001
Swarm announcing /ip4/192.168.1.167/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

Hoping to figure this out for oduwsdl/ipwb#638.

@ibnesayeed
Copy link

I think this will be fixed when #204 is released. I guess the issues is caused by ipfs/kubo#7097.

@ntninja
Copy link
Contributor

ntninja commented Jul 1, 2020

Sorry for the long delay, fixed in the released 0.6.0 version.

Is one of you interested in becoming maintainer of this library to avoid such problems in the future if I happen to be unavailable?

@ntninja ntninja closed this as completed Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants