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
69.85k stars 28.95k forks source link

Tibber integration can't handle HTTP status: 500. API error on startup #119866

Open rrooggiieerr opened 3 weeks ago

rrooggiieerr commented 3 weeks ago

The problem

The Tiber integration seems to be unable to handle HTTP status: 500. API errors on startup. The integration loads, but with all sensors being unknown.

2024-06-18 00:44:27.692 ERROR (MainThread) [tibber] Fatal error interacting with Tibber API, HTTP status: 500. API error: INTERNAL_SERVER_ERROR / Unhandled error: Context creation failed: undefined/https://thewall.tibber.com/connect/introspect Response code 502 (Bad Gateway)
2024-06-18 00:44:27.730 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up tibber platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/tibber/sensor.py", line 276, in async_setup_entry
    await home.update_info()
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 202, in update_info
    if data := await self._tibber_control.execute(UPDATE_INFO % self._home_id):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/__init__.py", line 105, in execute
    return (await extract_response_data(resp)).get("data")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/response_handler.py", line 62, in extract_response_data
    raise FatalHttpException(
tibber.exceptions.FatalHttpException: Unhandled error: Context creation failed: undefined/https://thewall.tibber.com/connect/introspect Response code 502 (Bad Gateway)

A reload of the integration solves this, however there is currently no consumption data.

2024-06-18 03:03:56.175 ERROR (MainThread) [tibber.home] Could not find consumption data.

https://thewall.tibber.com/ currently gives an error

What version of Home Assistant Core has the issue?

core-2024.6.3

What was the last working version of Home Assistant Core?

core-2024.6.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tibber

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 weeks ago

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

Code owner commands Code owners of `tibber` 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 tibber` 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)


tibber documentation tibber source (message by IssueLinks)

rrooggiieerr commented 3 weeks ago

I have to say, my Tibber app is also not working at the moment.

Danielhiversen commented 3 weeks ago

This was during a maintenance window. Does it work now?

Loft23 commented 3 weeks ago

I think the maintenance broke it. image

Loft23 commented 3 weeks ago

image

Loft23 commented 3 weeks ago

image

It seems a manual reload has fixed it.

rrooggiieerr commented 3 weeks ago

@Danielhiversen Yes it works now, but I think the integration should be beter in handling server errors and do the reloading by itself instead of user action to do so

fridgee1 commented 2 weeks ago

Same issue with HTTP Status 429. Restart and reload didn't help.

Logger: tibber
Quelle: components/tibber/__init__.py:55
Erstmals aufgetreten: 16:05:34 (6 Vorkommnisse)
Zuletzt protokolliert: 22:44:37

Fatal error interacting with Tibber API, HTTP status: 429. API error: UNKNOWN / Unexpected content type: text/plain