Repository: rotki/rotki

Issue:
Coinbase api validation error: Unknown currency
Problem Definition
When I try to display Coinbase Exchange Deposits & Withdrawals, this notification appears:
"Failed query for Coinbase: Coinbase query https://api.coinbase.com/v2/accounts/<some_alphanumerics_hidden_for_privacy>/transactions?=starting_after=None responded with error status code: 400 and text: {"errors":[{"id":"validation_error","message":"Unknown currency"}]}"

Logs
Check error message in description above.

System Description
Operating system: Docker
Rotki version: 1.32.1



Discussion:
Hey @smashkins thanks for the report!

Can you join discord and maybe contact one of the developers to give us logs via a DM? Not sure if logs would help but maybe they will contain more information.
Discord link: https://discord.rotki.com/

How to enable debug logs: https://rotki.readthedocs.io/en/latest/contribute.html#id2

The error is weird. There is no currency given as a parameter in that api query. The starting_after=None looks wrong and not sure how it got in there as it's protected against, at least in 1.32.0 and on. So maybe that?
I saw from the logs that the API call refers to the one related to the ETC Wallet.
Ok I'll contact developers in discord

Resolving patch:
diff --git a/rotkehlchen/exchanges/coinbase.py b/rotkehlchen/exchanges/coinbase.py
--- a/rotkehlchen/exchanges/coinbase.py
+++ b/rotkehlchen/exchanges/coinbase.py
@@ -297,7 +297,7 @@ def _api_query(
         next_uri = f'/{self.apiversion}/{endpoint}'
         timeout = CachedSettings().get_timeout_tuple()
         if options:
-            next_uri += f'?={urlencode(options)}'
+            next_uri += f'?{urlencode(options)}'
         while True:
             timestamp = str(int(time.time()))
             message = timestamp + request_verb + next_uri
@@ -462,20 +462,20 @@ def _query_transactions(self) -> None:
                 if now - last_query < HOUR_IN_SECONDS or last_update_timestamp < last_query:
                     continue  # if no update since last query or last query recent stop
 
-                account_last_id_name = f'{self.location}_{self.name}_{account_id}_last_query_id'
-                cursor.execute('SELECT value FROM key_value_cache WHERE name=?', (account_last_id_name,))  # noqa: E501
-                last_id = self.db.get_dynamic_cache(
+                last_id = None
+                if (result_id := self.db.get_dynamic_cache(
                     cursor=cursor,
                     name=DBCacheDynamic.LAST_QUERY_ID,
                     location=self.location.serialize(),
                     location_name=self.name,
                     account_id=account_id,
-                )
+                )) is not None:
+                    last_id = str(result_id)
 
             trades, asset_movements, history_events = self._query_single_account_transactions(
                 account_id=account_id,
-                account_last_id_name=account_last_id_name,
-                last_tx_id=str(last_id),
+                account_last_id_name=f'{self.location}_{self.name}_{account_id}_last_query_id',
+                last_tx_id=last_id,
             )
 
             # The approach here does not follow the exchange interface querying with


Test patch: