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

Error generating fixtures Enyaq 80 #114

Open
sonar98 opened this issue Oct 18, 2024 · 5 comments
Open

Error generating fixtures Enyaq 80 #114

sonar98 opened this issue Oct 18, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sonar98
Copy link
Contributor

sonar98 commented Oct 18, 2024

when generating all fixtures using the myskoda client I get an error at the trip-statistics endpoint

  error: "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.13/site-packages/myskoda/myskoda.py\",
    line 284, in generate_fixture_report\n    result = await self.get_endpoint(vin,
    endpoint, anonymize=True)\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
    \ File \"/usr/local/lib/python3.13/site-packages/myskoda/myskoda.py\", line 327,
    in get_endpoint\n    result = await self.rest_api.get_trip_statistics(vin, anonymize=anonymize)\n
    \            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
    \ File \"/usr/local/lib/python3.13/site-packages/myskoda/rest_api.py\", line 187,
    in get_trip_statistics\n    data=await self._make_get_request(url),\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
    \ File \"/usr/local/lib/python3.13/site-packages/myskoda/rest_api.py\", line 95,
    in _make_get_request\n    return await self._make_request(url=url, method=\"GET\")\n
    \          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.13/site-packages/myskoda/rest_api.py\",
    line 85, in _make_request\n    response.raise_for_status()\n    ~~~~~~~~~~~~~~~~~~~~~~~~~^^\n
    \ File \"/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py\", line
    1157, in raise_for_status\n    raise ClientResponseError(\n    ...<5 lines>...\n
    \   )\naiohttp.client_exceptions.ClientResponseError: 404, message='Not Found',
    url='https://mysmob.api.connect.skoda-auto.cz/api/v1/trip-statistics/TXXXXXXXXXXXXX?offsetType=week&offset=0&timezone=Europe/Berlin'\n"
@WebSpider
Copy link
Contributor

yeah, i also just encountered it, you beat me to reporting it :)
Workaround on Linux is a small loop:

for i in info status air_conditioning positions health charging maintenance driving_range; 
do poetry run myskoda --user USERNAME --password PASSWORD gen-fixtures --vehicle VIN --name i_want_weekend_$i --description "Is it weekend yet?" --file filename_here_$i get $i; 
done

@dvx76
Copy link
Member

dvx76 commented Oct 19, 2024

I think this works as designed. An error is logged for any endpoint which returns an error but the command continues and completes and the fixture file is generated (including the expected error for the given endpoint).

The VIN being leaked into the fixture in case of an error is covered in #100

@WebSpider
Copy link
Contributor

The problem here is that when using the all option, the trip-statistics causes an exception.

Silently passing on, or reporting in a fixture that this isnt supported would be even neater

@dvx76
Copy link
Member

dvx76 commented Oct 30, 2024

Yeah the error being logged is confusing but the end result is a usable fixture. Since it's just a helper tool to generate fixtures I'm not too concerned about it being super polished. But a PR is always an option 😄

@dvx76 dvx76 added the enhancement New feature or request label Oct 30, 2024
@WebSpider WebSpider added the good first issue Good for newcomers label Nov 5, 2024
@WebSpider
Copy link
Contributor

We have decided that the traceback being present in the fixtures is actually what we want. This way we get more detailed information about error states.

If someone wants to silence the CLI about this while generating the fixtures, that's a cool improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants