home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.67k stars 30.42k forks source link

Coinbase: Error setting up entry for coinbase #105906

Closed timbba80 closed 10 months ago

timbba80 commented 10 months ago

The problem

Since 17.12.2023 Coinbase integration seems to be broken. Error message "failed to set up" in the integrations. When trying to configure or reload the integration, error message: "Error setting up entry for coinbase".

I've tried to create new API in coinbase, but same error. It was working fine yesterday.

What version of Home Assistant Core has the issue?

core-2023.12.3

What was the last working version of Home Assistant Core?

core-2023.12.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Coinbase

Link to integration documentation on our website

https://www.home-assistant.io/integrations/coinbase/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-12-17 16:26:51.316 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry first_name last_name for coinbase
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/coinbase/__init__.py", line 37, in async_setup_entry
    instance = await hass.async_add_executor_job(create_and_update_instance, entry)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/coinbase/__init__.py", line 63, in create_and_update_instance
    instance = CoinbaseData(client, base_rate)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/coinbase/__init__.py", line 113, in __init__
    self.user_id = self.client.get_current_user()[API_ACCOUNT_ID]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/coinbase/wallet/client.py", line 220, in get_current_user
    response = self._get('v2', 'user', params=params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/coinbase/wallet/client.py", line 129, in _get
    return self._request('get', *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/coinbase/wallet/client.py", line 116, in _request
    return self._handle_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/coinbase/wallet/client.py", line 125, in _handle_response
    raise build_api_error(response)
coinbase.wallet.error.AuthenticationError: APIError(id=authentication_error): request timestamp expired

Additional information

No response

home-assistant[bot] commented 10 months ago

Hey there @tombrien, mind taking a look at this issue as it has been labeled with an integration (coinbase) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `coinbase` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign coinbase` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


coinbase documentation coinbase source (message by IssueLinks)

TomBrien commented 10 months ago

Hi, I can't reproduce this on my systems. This could well be (yet another) temporary outage on Coinbase's side. The error returned suggests that the timestamp used to sign the request is expired. Coinbase rejects requests which are stamped more than 30 seconds before their server time. I would check the time on your system is correct and if so try reloading the integration again.

timbba80 commented 10 months ago

Thanks for the advice, indeed it seems that my Raspberry PI's clock was 6 minutes offset. I have no idea what has caused this but I can confirm that coinmotion works again after correcting the time.