Comments (8)
I started getting some errors a few hours ago but not the same as you when using CLI - I get the following
Note in the past sometimes wait for a few hours (24) and it may start working again. I think I have seen this before and something got reset after a period of time. I was debugging this morning so issued a few API calls in quite a short period of time (which may trigger something)
Traceback (most recent call last):
File "./c.py", line 4, in
cli()
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/cli.py", line 270, in cli
loop.run_until_complete(main(args))
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/cli.py", line 47, in main
data = await client.getVehicles()
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/client.py", line 449, in getVehicles
f"https://api.porsche.com/core/api/v3/{self.locale_str}/vehicles"
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 237, in get
headers = await self._createhead(application)
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 292, in _createhead
application, wasExpired=(token is not None)
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 206, in _requestToken
await self._login()
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 171, in _login
resume_url = resp.headers['Location']
KeyError: 'Location'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x734b05d0>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x73544378>, 8222.623261835)]']
connector: <aiohttp.connector.TCPConnector object at 0x734b0530>
from pyporscheconnectapi.
I am getting this one after 15:00 CET:
2023-11-16 15:11:51.672 ERROR (MainThread) [custom_components.porscheconnect] Unexpected error fetching porscheconnect data: 'vehicleServiceEnabledMap'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/init.py", line 256, in _async_update_data
vdata = await self._update_data_for_vehicle(vehicle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/init.py", line 146, in _update_data_for_vehicle
services = await self.controller.getServices(vin)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyporscheconnectapi/client.py", line 488, in getServices
is_privacy = data['vehicleServiceEnabledMap']['VSR'] == 'DISABLED'
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'vehicleServiceEnabledMap'
from pyporscheconnectapi.
I tend to think this may be due to intermittent problems in the back-end. I can see that sometime the same call fails and sometimes it gets through. Let's give it a few days before trying to chase it down further.
from pyporscheconnectapi.
OK it is working for me once again - didn't hit an API for > 12 hours. My typical cadence is about one ping an hour (other than when I am debugging)
from pyporscheconnectapi.
I was still getting seemingly random failures, probably things are in flux as they are rolling out new functions. I may have found out that we need to set a different scope when authenticating.
If you are still experiencing problems, please try out #40 .. grateful for your feedback.
from pyporscheconnectapi.
I had one failure a couple of hours ago but retried (within 20 minutes) and it worked. I will monitor and try your update if I get back into the state of it not working again. Note sometimes when it fails I try the mobile app to ensure their APIs are actually working as it sometimes goes down for a period of time.
from pyporscheconnectapi.
OK I finally got the failures for the last 3 hours. I just tried it failed with the following errors:
Traceback (most recent call last):
File "./porsche1.py", line 142, in
loop.run_until_complete(vehicles())
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "./porsche1.py", line 73, in vehicles
data = await client.getCurrentOverview(vin)
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/client.py", line 464, in getCurrentOverview
f"https://api.porsche.com/service-vehicle/{self.locale_str}/vehicle-data/{vin}/current/request/{progressResult['requestId']}/status"
KeyError: 'requestId'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x732b3130>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x73321c00>, 337271.991742553)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x732c8420>, 337275.366806426)]']
connector: <aiohttp.connector.TCPConnector object at 0x732b3150>
and then I immediately tried your new patch and it works!!! I will keep using that version and see how it goes.
Thanks!
from pyporscheconnectapi.
If you really want to bring out your daring side (and help me with some testing), you could check out the "cleanup" branch and try that. The name says it all, but also incorporates the fix with the oauth2 scope.
from pyporscheconnectapi.
Related Issues (20)
- Cannot connect to host my.porsche.com:443 HOT 1
- AttributeError: 'Namespace' object has no attribute 'vin' HOT 2
- Thank you! HOT 1
- porschecli: error: argument command: invalid choice - not working HOT 2
- API not working anymore - problem of Porsche servers? HOT 1
- Not working anymore: Error: wasExpired=(token is not None) HOT 4
- New authentication scheme HOT 2
- tuple index out of range
- Token refresh? HOT 2
- KeyError: 'message' HOT 2
- KeyError: 'Location' HOT 2
- Error: Invalid captcha value HOT 4
- Sending navigation to PCM HOT 2
- Anyone else seeing issues in past 24 hours+ HOT 6
- API broken again? HOT 3
- KeyError: 'code' - not working anymore HOT 11
- Car in privacy mode gives error
- Cannot load data HOT 1
- {Q} Time between requests without captcha getting activated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyporscheconnectapi.