{"action":"opened","issue":{"url":"https://api.github.com/repos/raiden-network/raiden/issues/706","repository_url":"https://api.github.com/repos/raiden-network/raiden","labels_url":"https://api.github.com/repos/raiden-network/raiden/issues/706/labels{/name}","comments_url":"https://api.github.com/repos/raiden-network/raiden/issues/706/comments","events_url":"https://api.github.com/repos/raiden-network/raiden/issues/706/events","html_url":"https://github.com/raiden-network/raiden/issues/706","id":241681581,"number":706,"title":"Raiden fails on open channel with unregistered token address","user":{"login":"andrevmatos","id":587021,"avatar_url":"https://avatars2.githubusercontent.com/u/587021?v=3","gravatar_id":"","url":"https://api.github.com/users/andrevmatos","html_url":"https://github.com/andrevmatos","followers_url":"https://api.github.com/users/andrevmatos/followers","following_url":"https://api.github.com/users/andrevmatos/following{/other_user}","gists_url":"https://api.github.com/users/andrevmatos/gists{/gist_id}","starred_url":"https://api.github.com/users/andrevmatos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrevmatos/subscriptions","organizations_url":"https://api.github.com/users/andrevmatos/orgs","repos_url":"https://api.github.com/users/andrevmatos/repos","events_url":"https://api.github.com/users/andrevmatos/events{/privacy}","received_events_url":"https://api.github.com/users/andrevmatos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-10T11:28:45Z","updated_at":"2017-07-10T11:28:45Z","closed_at":null,"body":"## Problem Definition\r\n\r\nTrying to open a channel with an unregisted token (a valid token/contract address, but which isn't yet returned in the list from `/api/1/tokens` endpoint) causes an exception in Raiden, and API request to return code 500.\r\n\r\n### Relevant part of the exception:\r\n```ERROR in app: Exception on /api/1/channels [PUT]\r\nTraceback (most recent call last):\r\n  ...\r\n  File \"/apps/raiden/raiden/api/v1/resources.py\", line 55, in put\r\n    return self.rest_api.open(**kwargs)\r\n  File \"/apps/raiden/raiden/api/rest.py\", line 183, in open\r\n    settle_timeout\r\n  File \"/apps/raiden/raiden/api/python.py\", line 140, in open\r\n    channel_manager = self.raiden.chain.manager_by_token(token_address)\r\n  File \"/apps/raiden/raiden/network/rpc/client.py\", line 360, in manager_by_token\r\n    poll_timeout=self.poll_timeout,\r\n  File \"/apps/raiden/raiden/network/rpc/client.py\", line 709, in __init__\r\n    'latest',\r\n  File \"/usr/local/lib/python2.7/dist-packages/pyethapp/rpc_client.py\", line 413, in call\r\n    raise JSONRPCClientReplyError(jsonrpc_reply.error)\r\nJSONRPCClientReplyError: Invalid params: invalid length 0, expected a 0x-prefixed, padded, hex-encoded hash with length 40.\r\n```\r\n\r\n### Example requisition causing this error\r\n```\r\ncurl -v -H \"Content-Type: application/json\" -X PUT -d '{\"partner_address\":\"0x000D91Cf263a11F9BfCeE3752E5B03FC1196CE98\",\"token_address\":\"0x9aBa529db3FF2D8409A1da4C9eB148879b046700\",\"balance\":0,\"settle_timeout\":600}' http://localhost:5001/api/1/channels\r\n```\r\n\r\n## Solution\r\n\r\nCheck why `manager_by_token` is failing to generate a valid `manager_address` when fed a `token_address` not yet on registry, and fix it, so it gets properly returned.\r\n\r\n\r\n## Tasklist\r\n\r\n- [ ] Create test for opening channel with unregistered token\r\n- [ ] Fix bug so raiden acts accordingly\r\n- [ ] Add a changelog entry\r\n\r\n## System Description\r\nHere add a detailed description of your system, raiden version, geth version, solidity version e.t.c.\r\nRaiden in current master (as of 2017-07-09), running on a Linux system with Linux kernel 4.11.7, over docker. Using parity nightly, but further testing have shown it is not a parity bug, as the requisition goes empty and fails even with geth 1.6.6."}}
{"actor":{"display_login":"andrevmatos"}}