Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skoda Karoq - Too Many Requests after failing to read 'warning-lights' #468

Open
ikaakkola opened this issue Dec 17, 2024 · 6 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@ikaakkola
Copy link

After starting integration (version 1.16.0) with Skoda Karoq (MY2020) as the target car, it fails after a short period of time due to 'Too Many Requests' (HTTP status 429).

This seems to be caused by repeated requests towards /v1/vehicle-health-report/warning-lights/vinremoved - seemingly when this request fails it is retried repeatedly with very little delay between attempts (see logs below), despite what the configuration states for update interval (60 minutes). When this situation happens the official MySkoda app soon starts failing (either returning an 'Unavailable' entirely, or stating that battery protection is enabled when trying to use auxilliary heater).

2024-12-17 09:44:09.527 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:44:11.037 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:44:12.965 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:46:07.731 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:46:09.274 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:46:09.300 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:46:09.315 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:46:09.475 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:46:11.321 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'
2024-12-17 09:57:28.362 ERROR (MainThread) [myskoda.rest_api] Invalid status for GET request to /v1/vehicle-health-report/warning-lights/***VIN removed***: 429
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url='https://mysmob.api.connect.skoda-auto.cz/api/v1/vehicle-health-report/warning-lights/***VIN removed***'

I have not figured out what is the initial error (before going into the loop of Too Many Requests -responses), there are some log entries like

2024-12-17 06:15:09.947 ERROR (MainThread) [custom_components.myskoda.coordinator] Error received from car in operation ERROR, reason: fail. Requesting MySkodafull update

and

2024-12-17 06:20:01.330 ERROR (MainThread) [custom_components.myskoda.coordinator] Error received from car in operation ERROR, reason: timeout. Requesting MySkoda full update

in the logs before the warning-lights errors start appearing; likely related?

If manually changing 'coordinator.py' to load partial vehicle data (see below, not sure if I have all the CapabilityIds I need, but importantly omitting the warning-lights..), the integration seems to work correctly.

        # Obtain vehicle data.
        try:
            _LOGGER.debug("Getting partial vehicle data")
            vehicle = await self.myskoda.get_partial_vehicle(
                self.vin,
                [
                    CapabilityId.ACCESS,
                    CapabilityId.AIR_CONDITIONING,
                    CapabilityId.AUXILIARY_HEATING,
                    CapabilityId.CHARGING,
                    CapabilityId.FUEL_STATUS,
                    CapabilityId.HONK_AND_FLASH,
                    CapabilityId.MEASUREMENTS,
                    CapabilityId.OUTSIDE_TEMPERATURE,
                    CapabilityId.PARKING_POSITION,
                    CapabilityId.STATE,
                    CapabilityId.TRIP_STATISTICS,
                    CapabilityId.VEHICLE_WAKE_UP
                ],
            )

If needed I can try to get debug logs at some point.

(Related issue: #212)

@ikaakkola ikaakkola added the bug Something isn't working label Dec 17, 2024
@WebSpider
Copy link
Contributor

Thanks for your logs!

From the logs, I can see something is happening with either the car itself, or the communication with MySkoda. We are receiving an ERROR pushmessage (via MQTT), which triggers a full update at the moment, as we try to find out what the status of the car is after receiving this generic error.
Apparently, this is not throttled like other requests we do. We apply throttling to requests (one request per 30 seconds) in order to prevent 429's from occurring.

I'll have a look at this, and see why this situation occurs.

@WebSpider WebSpider self-assigned this Dec 19, 2024
@WebSpider
Copy link
Contributor

Would you be able to upload your Diagnostics from HomeAssistant?

@ikaakkola
Copy link
Author

myskoda-diagnostics.json

fyi, the diagnostics incorrectly contain the vehicle VIN in the "departure_info" endpoint data;

          "endpoint": "departure_info",
          "raw": "{\"targetTemperature\": {\"unitInCar\": \"CELSIUS\"}, \"timers\": []}",
          "url": "/v1/vehicle-automatization/VINREMOVED/departure/timers",

@WebSpider
Copy link
Contributor

@prvakt I have seen two capabilities in these diagnostics that might be a trigger for us to change the way we approach the vehicle-health data:

            {
              "id": "VEHICLE_HEALTH_WARNINGS_WITH_WAKE_UP",
              "statuses": []
            },
            {
              "id": "AUXILIARY_HEATING_BASIC",
              "statuses": []
            }

Let's see if we see anything similar in CitigoE

@WebSpider
Copy link
Contributor

WebSpider commented Jan 7, 2025

After starting integration (version 1.16.0) with Skoda Karoq (MY2020) as the target car, it fails after a short period of time due to 'Too Many Requests' (HTTP status 429).

This seems to be caused by repeated requests towards /v1/vehicle-health-report/warning-lights/vinremoved - seemingly when this request fails it is retried repeatedly with very little delay between attempts (see logs below), despite what the configuration states for update interval (60 minutes). When this situation happens the official MySkoda app soon starts failing (either returning an 'Unavailable' entirely, or stating that battery protection is enabled when trying to use auxilliary heater).

...

If manually changing 'coordinator.py' to load partial vehicle data (see below, not sure if I have all the CapabilityIds I need, but importantly omitting the warning-lights..), the integration seems to work correctly.

Looking at how to solve this now.

If you remove the vehicle-health from capabilities polled, like you said, do you have any sensors unavailable that you would expect available?

@ikaakkola
Copy link
Author

Looking at how to solve this now.

If you remove the vehicle-health from capabilities polled, like you said, do you have any sensors unavailable that you would expect available?

I have not identified any missing sensors that i would expect to exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants