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
73.27k stars 30.6k forks source link

Tankerkönig integration doesn't work with HA 2024.2.1 #110251

Closed Flox-Muc closed 8 months ago

Flox-Muc commented 8 months ago

The problem

The integration doesn't start (shows "configuration failed, will try again"). And if you try to open the configuration it only says "500 Internal Server Error Server got itself in trouble".

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

core-2024.1.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tankerkoenig

Link to integration documentation on our website

No response

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 8 months ago

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

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


tankerkoenig documentation tankerkoenig source (message by IssueLinks)

jpbede commented 8 months ago

Is something in the log?

Flox-Muc commented 8 months ago

Yes, there are multiple entries like this one here: (apikey & location replaced in the link)

2024-02-11 11:41:52.481 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 68, in _request response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1060, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 503, message='Service Temporarily Unavailable', url=URL('https://creativecommons.tankerkoenig.de/json/list.php?apikey=XXXXXXXXXXXXXXXXXX&lat=XXXXX&lng=XXXXXXX&rad=5&type=all&sort=dist')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 223, in post return await super().post(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post result = await self._flow_mgr.async_init( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 345, in async_init result = await self._async_handle_step(flow, flow.init_step, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tankerkoenig/config_flow.py", line 259, in async_step_init stations = await async_get_nearby_stations( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tankerkoenig/config_flow.py", line 44, in async_get_nearby_stations return await tankerkoenig.nearby_stations( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 100, in nearby_stations result = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 79, in _request raise TankerkoenigConnectionError(msg) from exception aiotankerkoenig.exceptions.TankerkoenigConnectionError: Error occurred while communicating with the tankerkoenig.de API 2024-02-11 11:41:52.706 ERROR (MainThread) [frontend.js.latest.202402071] Uncaught error from Firefox 115.0 on Mac OS 10.14 TypeError: this.contentElement is null renderHeading (src/components/ha-dialog.ts:53:4) apply (src/scoped-custom-element-registry.js:262:44) mainWindow.history.pushState (src/dialogs/make-dialog-manager.ts:129:7) 2024-02-11 11:41:57.320 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 68, in _request response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1060, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 503, message='Service Temporarily Unavailable', url=URL('https://creativecommons.tankerkoenig.de/json/list.php?apikey=XXXXXXXXXXXXXXXX&lat=XXXXXX&lng=XXXXXX&rad=5&type=all&sort=dist')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 223, in post return await super().post(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post result = await self._flow_mgr.async_init( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 345, in async_init result = await self._async_handle_step(flow, flow.init_step, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tankerkoenig/config_flow.py", line 259, in async_step_init stations = await async_get_nearby_stations( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tankerkoenig/config_flow.py", line 44, in async_get_nearby_stations return await tankerkoenig.nearby_stations( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 100, in nearby_stations result = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 79, in _request raise TankerkoenigConnectionError(msg) from exception aiotankerkoenig.exceptions.TankerkoenigConnectionError: Error occurred while communicating with the tankerkoenig.de API

jpbede commented 8 months ago

Does is work again? The Tankerkoenig API responded with a "503 - Service Temporarily Unavailable".

Flox-Muc commented 8 months ago

No, I'm sorry. I deleted the whole integration and set it up again with just two stations but the result is the same - it still says that the configuration failed. Until I did the HA update in the morning the integration worked flawlessly all the time. The last log entry is just 5 minutes ago:

2024-02-11 13:32:39.627 ERROR (MainThread) [homeassistant.components.tankerkoenig.coordinator] Unexpected error fetching XX.XXXXXXXXX_XX.XXXXXXXXX data: Error occurred while communicating with the tankerkoenig.de API Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 68, in _request response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1060, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 503, message='Service Temporarily Unavailable', url=URL('https://creativecommons.tankerkoenig.de/json/prices.php?apikey=XXXXXXXXXXXXXXXXXXX&ids=00d5c1b0-ad92-428e-b1e0-067d8b8a76bc,00041450-0002-4444-8888-acdc00000002')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tankerkoenig/coordinator.py", line 85, in _async_update_data data = await self._tankerkoenig.prices( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 130, in prices result = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiotankerkoenig/aiotankerkoenig.py", line 79, in _request raise TankerkoenigConnectionError(msg) from exception aiotankerkoenig.exceptions.TankerkoenigConnectionError: Error occurred while communicating with the tankerkoenig.de API

jpbede commented 8 months ago

Okay, that's strange. If I call the URL above with my API key, it works without any problems. Could you please try to disable the integration and try it later again? I suspect that you somehow ran into a rate limit

Flox-Muc commented 8 months ago

Yes, your suspicion was correct. I opened the url with my browser and there it tells the full error message: "503 Service Temporarily Unavailable -Rate Limit Exceeded". I just don't know why the update triggered this...? Nevertheless I'll now deactivate the integration and maybe wait until tomorrow to give it a new try. Many thanks for your help!

tankerkoenig commented 8 months ago

Hi, tankerkoenig here: "503" means the rate limit is reached. On the long run (initial peak is allowed) it is one request/minute (per IP address) to keep our free server healthy. If you wait, access will work again (until limit is reached)

jpbede commented 8 months ago

Then our 30-minute refresh interval is definitely safe.

tankerkoenig commented 8 months ago

yes, but we see many rate limits "503" from HomeAssistant requests. Some guys seem to increase the request frequency, is this possible? Maybe a warning text could be put in the configuration entry to avoid frustration. Example from the access.log (redacted IP & API-Key), in this case every 80 seconds, 2 request are coming in, about every 2nd one is answered with a "503":

redacted-IP-address - - [12/Feb/2024:00:19:09 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:20:30 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.004
redacted-IP-address - - [12/Feb/2024:00:20:30 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 200 367 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.005
redacted-IP-address - - [12/Feb/2024:00:20:30 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=19b57faa-e799-405b-98f3-7d642c148ad3 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:21:50 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.017
redacted-IP-address - - [12/Feb/2024:00:21:50 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:23:11 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.007
redacted-IP-address - - [12/Feb/2024:00:23:11 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:24:31 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.005
redacted-IP-address - - [12/Feb/2024:00:24:31 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:25:52 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.017
redacted-IP-address - - [12/Feb/2024:00:25:52 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 200 367 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.024
redacted-IP-address - - [12/Feb/2024:00:25:52 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=19b57faa-e799-405b-98f3-7d642c148ad3 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:27:12 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.009
redacted-IP-address - - [12/Feb/2024:00:27:12 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
redacted-IP-address - - [12/Feb/2024:00:28:33 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=6ae8787f-9f20-44a1-8994-57b13efa63ae HTTP/1.1" 200 340 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.071
redacted-IP-address - - [12/Feb/2024:00:28:33 +0100] "GET /json/detail.php?apikey=REDACTED-API-KEY&id=2707a133-593c-4346-9267-ccc86a9d7db1 HTTP/1.1" 503 643 "-" "HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12" 0.000
mib1185 commented 8 months ago

In general it is possible in HA to disable the integrations own polling and place an automation which triggers the data update based on the wishes of the user (see Defining a custom polling interval). We definitely do not recommend doing this, also there are notes in the Tankerkoenig integrations documentation, about not overwhelming the API and be fair with it's usage. We should fetch and react to this rate limit message in the HA integration to pinpoint the user, that the limit is reached and a less aggressive polling should be used.

tankerkoenig commented 8 months ago

Cool! Maybe you can also add a small note to the docs that "503" errors will happen if the limit is exceeded - just to warn the user

tankerkoenig commented 8 months ago

Hi, we (Tankerkönig) are getting more emails with complaints about the "503" error, so i checked the access logs for HomeAssistant related errors.

We see a about 60 x more (!) requests starting with version "HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12" Wild guess: has the interval changed from 30 minutes to 30 seconds?

Analyzed access logs with daily accesses per "HomeAssistant" version (3 most seen HomeAssistant versions) Note the sharp increase from about 20000 requests/day to 1.2 Mio requests/day starting at 2024-02-08

The problem seems to be specific to "aiohttp" Versions.

access.log-20240204-1707024302.gz
   9839 HomeAssistant/2024.2.0b3 aiohttp/3.9.3 Python/3.12
  10383 HomeAssistant/2024.1.5 httpx/0.26.0 Python/3.11
  15070 HomeAssistant/2024.1.6 httpx/0.26.0 Python/3.11
access.log-20240205-1707110701.gz
   9608 HomeAssistant/2024.1.5 httpx/0.26.0 Python/3.11
  13599 HomeAssistant/2024.2.0b4 aiohttp/3.9.3 Python/3.12
  16728 HomeAssistant/2024.1.6 httpx/0.26.0 Python/3.11
access.log-20240206-1707197102.gz
   7316 HomeAssistant/2024.2.0b7 aiohttp/3.9.3 Python/3.12
   8882 HomeAssistant/2024.1.5 httpx/0.26.0 Python/3.11
  19740 HomeAssistant/2024.1.6 httpx/0.26.0 Python/3.11
access.log-20240207-1707283502.gz
   7843 HomeAssistant/2024.1.5 httpx/0.26.0 Python/3.11
  11808 HomeAssistant/2024.2.0b8 aiohttp/3.9.3 Python/3.12
  19838 HomeAssistant/2024.1.6 httpx/0.26.0 Python/3.11
access.log-20240208-1707369902.gz
   7507 HomeAssistant/2024.1.5 httpx/0.26.0 Python/3.11
  19600 HomeAssistant/2024.1.6 httpx/0.26.0 Python/3.11
 107431 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
access.log-20240209-1707456302.gz
   8220 HomeAssistant/2024.2.0 httpx/0.26.0 Python/3.12
  13523 HomeAssistant/2024.1.6 httpx/0.26.0 Python/3.11
 672518 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
access.log-20240210-1707542702.gz
   9468 HomeAssistant/2024.2.0 httpx/0.26.0 Python/3.12
 360951 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
 606842 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
access.log-20240211-1707629101.gz
  12981 HomeAssistant/2024.2.1 httpx/0.26.0 Python/3.12
 271627 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
 820708 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
access.log-20240212-1707715502.gz
  15298 HomeAssistant/2024.2.1 httpx/0.26.0 Python/3.12
 181634 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
 985904 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
access.log-20240213-1707801901.gz
  18545 HomeAssistant/2024.2.1 httpx/0.26.0 Python/3.12
 124024 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
1097392 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
access.log-20240214-1707888301.gz
  16903 HomeAssistant/2024.2.1 httpx/0.26.0 Python/3.12
 100751 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
1139371 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
access.log-20240215-1707974702.gz
  17434 HomeAssistant/2024.2.1 httpx/0.26.0 Python/3.12
  80076 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
1157944 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
access.log-20240216-1708061102.gz
  18825 HomeAssistant/2024.2.1 httpx/0.26.0 Python/3.12
  61867 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
1204292 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
access.log-20240217-1708147501.gz
  52366 HomeAssistant/2024.2.0 aiohttp/3.9.3 Python/3.12
  94982 HomeAssistant/2024.2.2 aiohttp/3.9.3 Python/3.12
1164272 HomeAssistant/2024.2.1 aiohttp/3.9.3 Python/3.12
mib1185 commented 8 months ago

@tankerkoenig would it be possibel to get in direct contact with you on discord? You will find me with same name MiB1185 there

biggest change with 2024.2 was switching the underlying library to a new completely async one (#99416) which is based on aiohttp (prior used httpx)

jpbede commented 8 months ago

biggest change with 2024.2 was switching the underlying library to a new completely async one (https://github.com/home-assistant/core/pull/99416) which is based on aiohttp (prior used httpx)

But I don't see why this should change the amount of requests. We haven't changed the interval

guillempages commented 8 months ago

I haven't looked at the code (yet), but it sounds related to the switch from sync api to async. Could it be, that the new library is querying the stations with a separate call for each station?

The original code tried to group calls to avoid spamming the upstream servers with requests.

Jan-Philipp Benecke @.***> schrieb am Sa., 17. Feb. 2024, 13:38:

biggest change with 2024.2 was switching the underlying library to a new completely async one (#99416 https://github.com/home-assistant/core/pull/99416) which is based on aiohttp (prior used httpx)

But I don't see why this should change the amount of requests. We haven't changed the interval

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/110251#issuecomment-1950063969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS6VE4WBNIQU3LLCJMME7DYUCQEBAVCNFSM6AAAAABDDOMWDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJQGA3DGOJWHE . You are receiving this because you were mentioned.Message ID: @.***>

jpbede commented 8 months ago

The original code tried to group calls to avoid spamming the upstream servers with requests.

This still happens, prices are fetched in batches of 10

szoller commented 8 months ago

I've the same issues, looks like there is a fix on the way. However after disabling the integration for like 3 days and activating it again today, it keeps throwing errors. Is my IP adress maybe blocked permanently? As I am on cable internet, i won't get a new IP that easily... @tankerkoenig My IP starts with 77.21.xxx.xx

tankerkoenig commented 8 months ago

hi, we (tankerkoenig) do not block IP-addresses permanently. And i see no block on an IP starting with 77.21.157 at the moment :-)

Probably the fix takes a while to get into a release.

jpbede commented 8 months ago

Probably the fix takes a while to get into a release.

Yes, the next patch release is planned for Friday.

szoller commented 8 months ago

Okay, i'll look forward. I tought that enabling it after such a long time would make it work for some minutes :)

Error message is the same like OPs

mib1185 commented 8 months ago

@szoller please provide the full home-assistant.log

szoller commented 8 months ago

home-assistant_tankerkoenig_2024-02-19T21-14-43.993Z.log @mib1185 Debug log attached

mib1185 commented 8 months ago

wow ... your log is flooded with connection issues of many different integrations 😮 nevertheless, please enable debug logging for the tankerkoenig integration and download and provide the log file after 5 minutes. thx 👍

szoller commented 8 months ago

That was the debug log after more than 5 minutes, but i'll do it again

szoller commented 8 months ago

I have still issues with tankerkoenig integration...

Nothing in the logfile so far

mib1185 commented 8 months ago

@szoller please open a new issue report, also provide the debug logging there