flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
385 stars 196 forks source link

User config: 400 - server_error : Internal Server Error (DS4 E-Tense) #712

Closed Ik-12 closed 6 months ago

Ik-12 commented 6 months ago

To Reproduce Steps to reproduce the behavior:

  1. Start the container, fill user information, click Submit on 'User config'
  2. When the bug append? Don't know.
  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

Describe the bug

Authentication and user configuration doesn't work: 400 - server_error : Internal Server Error

E-mail and password was filled from password manager and the credentials work with MyDS app, so it's very unlikely that the error is with these.

Config file

[General]
currency = €
# define format for data export, can be csv or xlsx
export_format = csv
# minimum trip length in km so it's added to stats and map in website
minimum trip length = 10
# for future use
length unit = km
export format = csv
[Electricity config]
# price by kw/h
day price = 0.15
night price
# ex: 22h30
night hour start
# ex: 6h00
night hour end
dc charge price
high speed dc charge price
# minimum power in kW that should be delivered during a charge so it can be considered as a high speed charger
high speed dc charge threshold
charger efficiency = 0.8942

Environment :

Log:

2023-12-21 17:15:51,918 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:51,922 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:51,927 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:51,932 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:51,938 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:51,940 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:52,180 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:52,182 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:52,186 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:52,187 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported
2023-12-21 17:15:58,810 :: ERROR :: 400  - server_error : Internal Server Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 133, in connectPSA
    res = firstLaunchConfig(app_name, email, password, countrycode)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 95, in firstLaunchConfig
    psacc.connect(client_email, client_password)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 35, in connect
    self.manager.init_with_user_credentials_realm(user, password, self.realm)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 26, in init_with_user_credentials_realm
    self._token_request(self._grant_password_request_realm(login, password, realm), True)
  File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 205, in _token_request
    CredentialManager._handle_bad_response(response)
  File "/usr/local/lib/python3.9/dist-packages/oauth2_client/credentials_manager.py", line 87, in _handle_bad_response
    raise OAuthError(HTTPStatus(response.status_code), error.get('error'), error.get('error_description'))
oauth2_client.credentials_manager.OAuthError: 400  - server_error : Internal Server Error
youradds commented 6 months ago

Same issue with Corsa EV as well, and quite a lot of ac

https://github.com/flobz/psa_car_controller/issues/674

Frustratingly, that ticket was closed as "fixed", when it still isn't :( I've tried going into the guts of the code to see whats going on, but Python isn't my first language, and I don't really know enough :( It seems to be affecting everyone though who's trying to set up :/

robotfishe commented 6 months ago

@flobz any chance we can get that earlier issue re-opened? I'm still seeing the same thing with my Mokka-e as well.

flobz commented 6 months ago

reopen the issue