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

API returned error #513

Closed
jasworks opened this issue Apr 12, 2023 · 14 comments
Closed

API returned error #513

jasworks opened this issue Apr 12, 2023 · 14 comments

Comments

@jasworks
Copy link

I’ve encountered an error which produced the following in the log:

2023-04-12 15:51:40,150 :: ERROR :: refresh_vehicle_info: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psacc/application/psa_client.py", line 125, in __refresh_vehicle_info self.get_vehicle_info(car.vin) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psacc/application/psa_client.py", line 104, in get_vehicle_info res = self.api().get_vehicle_status(car.vehicle_id, extension=["odometer"]) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status (data) = self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501 File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info return self.api_client.call_api( File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/oauth.py", line 78, in call_api return self._ApiClient__call_api(resource_path, method, File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 169, in __call_api return_data = self.deserialize(response_data, response_type) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 241, in deserialize return self.__deserialize(data, response_type) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize return self.__deserialize_model(data, klass) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 624, in __deserialize_model kwargs[attr] = self.__deserialize(value, attr_type) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize return self.__deserialize_model(data, klass) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 624, in __deserialize_model kwargs[attr] = self.__deserialize(value, attr_type) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize return self.__deserialize_model(data, klass) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 626, in __deserialize_model instance = klass(**kwargs) File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py", line 61, in __init__ self.type = type File "/usr/local/lib/python3.9/site-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py", line 131, in type raise ValueError( ValueError: Invalid value for type(Acquire), must be one of ['Estimated', 'Acquired', 'Estimate', 'Aquire']
To Reproduce
Steps to reproduce the behavior:

  1. what command did you use - I use docker
  2. when the bug append ? Since 2023-04-12
  3. Does it persist after restarting the program? Yes
  4. Does it persist after recreate config by going to http://server_address:port/config? Yes

Believed that some changes were done in the API (which fixed a typo) causing it to break.

@show2go
Copy link

show2go commented Apr 12, 2023

Same here! --> HA Addon
thx

@youradds
Copy link

What car is this for? I'm having issues with a Vauxhall Corsa-e, and I get (I think the same?)

Exception on /get_vehicleinfo/VXKUHZKXZL41REDACTED [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/web/view/views.py", line 146, in get_vehicle_info
    response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 104, in get_vehicle_info
    res = self.api().get_vehicle_status(car.vehicle_id, extension=["odometer"])
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status
    (data) = self.get_vehicle_status_with_http_info(id, **kwargs)  # noqa: E501
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info
    return self.api_client.call_api(
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/oauth.py", line 78, in call_api
    return self._ApiClient__call_api(resource_path, method,
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 169, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 241, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 624, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 624, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 626, in __deserialize_model
    instance = klass(**kwargs)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py", line 61, in __init__
    self.type = type
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py", line 131, in type
    raise ValueError(
ValueError: Invalid value for `type` (Acquire), must be one of ['Estimated', 'Acquired', 'Estimate', 'Aquire']
2023-04-12 15:29:17,636 :: ERROR :: Exception on /get_vehicleinfo/VXKUHZKXZL41REDACTED [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/web/view/views.py", line 146, in get_vehicle_info
    response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 104, in get_vehicle_info
    res = self.api().get_vehicle_status(car.vehicle_id, extension=["odometer"])
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1229, in get_vehicle_status
    (data) = self.get_vehicle_status_with_http_info(id, **kwargs)  # noqa: E501
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1293, in get_vehicle_status_with_http_info
    return self.api_client.call_api(
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/oauth.py", line 78, in call_api
    return self._ApiClient__call_api(resource_path, method,
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 169, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 241, in deserialize
    return self.__deserialize(data, response_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 624, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 624, in __deserialize_model
    kwargs[attr] = self.__deserialize(value, attr_type)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 626, in __deserialize_model
    instance = klass(**kwargs)
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py", line 61, in __init__
    self.type = type
  File "/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py", line 131, in type
    raise ValueError(
ValueError: Invalid value for `type` (Acquire), must be one of ['Estimated', 'Acquired', 'Estimate', 'Aquire']
2023-04-12 15:29:17,644 :: INFO :: 127.0.0.1 - - [12/Apr/2023 15:29:17] "GET /get_vehicleinfo/VXKUHZKXZL41REDACTED HTTP/1.0" 500 -

I was having issues with the MyVauxhall app (e-remote), and they finally fixed that. But this program still doesn't work :( (frustrating, as it was my go-to with my own web-app wrapped around this, which was more reliable than myVauxhall haha)

@humarf
Copy link

humarf commented Apr 12, 2023

I can confirm. Same problem here with a Citroen eC4. I guess there was an API change.

@francogodi
Copy link

same here with a Peugeot e208, I guess something has changed in the API since most of the values are null in get_vehicleinfo except "level" and "updated_at"

@jordivicedo
Copy link

I have the same problem and #512 Solves the error, but I still get no information about mileage

@jasworks
Copy link
Author

I just created #514 but seems like #512 also fixed the error. Let’s see which one got merged.

@bbr111
Copy link

bbr111 commented Apr 12, 2023

Can confirm the issue and the fix is working.

But is still did not get any Mileage information. just the soc from the car.

@mdkeil
Copy link
Contributor

mdkeil commented Apr 12, 2023

same here, no mileage.

@Matssa56
Copy link

Anyone has an updated HA docker image that I can use? Or maybe a dockerfile that uses an updated pyproject?
Thanks!

@mdkeil
Copy link
Contributor

mdkeil commented Apr 12, 2023

You can make a temporary file-bind (docker) with the changed position_properties.py (/usr/local/lib/python3.10/dist-packages/psa_car_controller/psa/connected_car_api/models/position_properties.py)

@jasworks
Copy link
Author

jasworks commented Apr 12, 2023 via email

@youradds
Copy link

Wahoo - this has sorted mine :)

@jasworks
Copy link
Author

I guess this can be closed :)

@CWfFO
Copy link

CWfFO commented Apr 14, 2023

Hi, i run the latest version outside docker (so normal installation) and updated to the latest version. I still get this error. I did the update with wget https://github.com/flobz/psa_car_controller/archive/refs/heads/master.zip and unzip master.zip. Anything else to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants