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

"ValueError: address must be a valid address" using curl #1960

Closed
czepluch opened this Issue Jul 26, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@czepluch
Collaborator

czepluch commented Jul 26, 2018

Problem Definition

When trying to manually open a channel using Raiden 0.4.0 and curl like this:

curl -i -X PUT http://localhost:5001/api/1/channels -H 'Content-Type: application/json' --data-raw '{"balance": 73, "partner_address": "0x6D1aE2fA14078B5Dbc46501Bcc0623C67aA7b5cF", "settle_timeout": 600, "token_address": "0x7692624c0C43285D51c0DdDfb2A6388f5002762E"}'

with response:

HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
Content-Length: 37
Date: Thu, 26 Jul 2018 13:05:55 GMT

{"message": "Internal Server Error"}

I get the following error:

2018-07-26 12:54:50 [info     ] 127.0.0.1 - - [2018-07-26 14:54:50] "PUT /api/1/channels HTTP/1.1" 500 164 0.159700 [raiden.api.rest.pywsgi] 
2018-07-26 12:57:38 [error    ] Exception on /api/1/channels [PUT] [flask.app] 
Traceback (most recent call last):
  File "site-packages/flask/app.py", line 1813, in full_dispatch_request
  File "site-packages/flask/app.py", line 1799, in dispatch_request
  File "site-packages/flask_restful/__init__.py", line 480, in wrapper
  File "site-packages/flask/views.py", line 88, in view
  File "site-packages/flask_restful/__init__.py", line 595, in dispatch_request
  File "site-packages/webargs/core.py", line 441, in wrapper
  File "site-packages/raiden/api/v1/resources.py", line 53, in put
  File "site-packages/raiden/api/rest.py", line 392, in open
  File "site-packages/raiden/api/python.py", line 232, in channel_open
  File "site-packages/raiden/network/blockchain_service.py", line 134, in token_network
ValueError: address must be a valid address
2018-07-26 12:54:50 [info     ] 127.0.0.1 - - [2018-07-26 14:54:50] "PUT /api/1/channels HTTP/1.1" 500 164 0.159700 [raiden.api.rest.pywsgi]

Initially I thought it might be related to the EIP55 requirement, but the addresses should be check summed already.

@pcppcp

This comment has been minimized.

Contributor

pcppcp commented Jul 26, 2018

note: this happens when registry.get_token_network(token_address) returns None.

This should be handled by python API, I'll create a quick PR for it.

@czepluch

This comment has been minimized.

Collaborator

czepluch commented Jul 26, 2018

Ah, damn. I used a wrong token address for some reason. Accidentally got the address of the TokenNetworkContract itself instead of the token. This fixed it.

@czepluch czepluch closed this Jul 26, 2018

@pcppcp

This comment has been minimized.

Contributor

pcppcp commented Jul 26, 2018

Reopening & assigning myself, any E500 in the rest API should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment