Repository: rotki/rotki

Issue:
KeyError when querying Kraken
I am running Rotkehlchen on Ubuntu 18.04 - 4.16.12 - 64bit - Parity.
When querying Kraken the request is being killed.

It would be awesome to add all 17 cryptocurrencies for kraken (currently it seems we have 14)

Here is the log output:
```
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop start
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Maybe upload to server
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop end
28/05/2018 13:55:08 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_exchange_balances (kwargs:{'name': 'kraken'}) with ID: 0
28/05/2018 13:55:08 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_blockchain_balances (kwargs:{}) with ID: 1
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 1
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Found response for task 1
28/05/2018 13:55:11 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:13 CEST -- ERROR:rotkehlchen.server:Greenlet for task 0 dies with exception: 'XZEC'.
Exception Name: <class 'KeyError'>
Exception Info: 'XZEC'
Traceback:
   File "site-packages/gevent/greenlet.py", line 536, in run
  File "rotkehlchen/server.py", line 93, in _query_async
  File "rotkehlchen/server.py", line 161, in query_exchange_balances
  File "rotkehlchen/utils.py", line 85, in wrapper
  File "rotkehlchen/kraken.py", line 275, in query_balances

28/05/2018 13:55:13 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:13 CEST -- DEBUG:rotkehlchen.server:Found response for task 0
28/05/2018 13:55:18 CEST -- DEBUG:rotkehlchen.server:Shutdown initiated

```
KeyError when querying Kraken
I am running Rotkehlchen on Ubuntu 18.04 - 4.16.12 - 64bit - Parity.
When querying Kraken the request is being killed.

It would be awesome to add all 17 cryptocurrencies for kraken (currently it seems we have 14)

Here is the log output:
```
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop start
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Maybe upload to server
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop end
28/05/2018 13:55:08 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_exchange_balances (kwargs:{'name': 'kraken'}) with ID: 0
28/05/2018 13:55:08 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_blockchain_balances (kwargs:{}) with ID: 1
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 1
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Found response for task 1
28/05/2018 13:55:11 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:13 CEST -- ERROR:rotkehlchen.server:Greenlet for task 0 dies with exception: 'XZEC'.
Exception Name: <class 'KeyError'>
Exception Info: 'XZEC'
Traceback:
   File "site-packages/gevent/greenlet.py", line 536, in run
  File "rotkehlchen/server.py", line 93, in _query_async
  File "rotkehlchen/server.py", line 161, in query_exchange_balances
  File "rotkehlchen/utils.py", line 85, in wrapper
  File "rotkehlchen/kraken.py", line 275, in query_balances

28/05/2018 13:55:13 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:13 CEST -- DEBUG:rotkehlchen.server:Found response for task 0
28/05/2018 13:55:18 CEST -- DEBUG:rotkehlchen.server:Shutdown initiated

```


Discussion:
Argh yes this is my bad. I have not added all cryptocurrencies in kraken yet. Will do it and note it in this issue. Thank you for reporting this!
Argh yes this is my bad. I have not added all cryptocurrencies in kraken yet. Will do it and note it in this issue. Thank you for reporting this!

Resolving patch:
diff --git a/rotkehlchen/kraken.py b/rotkehlchen/kraken.py
--- a/rotkehlchen/kraken.py
+++ b/rotkehlchen/kraken.py
@@ -31,12 +31,21 @@
     'XREP': 'REP',
     'XXBT': 'BTC',
     'XXMR': 'XMR',
+    'XXRP': 'XRP',
+    'XZEC': 'ZEC',
     'ZEUR': 'EUR',
+    'ZUSD': 'USD',
+    'ZGBP': 'GBP',
+    'ZCAD': 'CAD',
+    'ZJPY': 'JPY',
     'XMLN': 'MLN',
     'XICN': 'ICN',
     'GNO': 'GNO',
     'BCH': 'BCH',
     'XXLM': 'XLM',
+    'DASH': 'DASH',
+    'EOS': 'EOS',
+    'USDT': 'USDT',
     'KFEE': 'KFEE',
 }
 
@@ -47,13 +56,22 @@
     'REP': 'XREP',
     'BTC': 'XXBT',
     'XMR': 'XXMR',
+    'XRP': 'XXRP',
+    'ZEC': 'XZEC',
     'EUR': 'ZEUR',
+    'USD': 'ZUSD',
+    'GBP': 'ZGBP',
+    'CAD': 'ZCAD',
+    'JPY': 'ZJPY',
     'DAO': 'XDAO',
     'MLN': 'XMLN',
     'ICN': 'XICN',
     'GNO': 'GNO',
     'BCH': 'BCH',
     'XLM': 'XXLM',
+    'DASH': 'DASH',
+    'EOS': 'EOS',
+    'USDT': 'USDT',
     'KFEE': 'KFEE',
 }
 


Test patch: