Tibber integration can't handle HTTP status: 500. API error on startup
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
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 closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign tibberRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove 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)
I have to say, my Tibber app is also not working at the moment.
This was during a maintenance window. Does it work now?
I think the maintenance broke it.
It seems a manual reload has fixed it.
@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
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
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Just encountered the same issue, the Tibber API returned a 504 twice in the logs and since the integration would simply stop working. A manual reload fixes the issue, but my energy consumption data is all wrong for the time it was down.
It seems to me that the integration is missing some retry logic? Especially for a 504, this can just occasionally happen on external cloud infrastructure and often is just a temporary issue.
