flobz / psa_car_controller

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

400 - server_error : Internal Server Error at user config #767

Closed francogodi closed 7 months ago

francogodi commented 7 months ago

Hi, yesterday I stopped receiving data from trips or charge status. after a reboot I was asked to login again but the login process does not work with error: 400 - server_error : Internal Server Error at user config

image

flavrai commented 7 months ago

Same here.

Here're the car-controller logs

`Containerised psa_car_controller loading... 2024-02-19 08:26:59,231 :: INFO :: App version 3.3.2 2024-02-19 08:27:01,002 :: ERROR :: Please reconnect by going to config web page 2024-02-19 08:27:01,011 :: INFO :: save config change 2024-02-19 08:27:01,025 :: WARNING :: Can't get language 2024-02-19 08:27:03,662 :: INFO :: update_data 2024-02-19 08:27:03,697 :: INFO :: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

2024-02-19 08:27:42,872 :: INFO :: Starting analysis on AndroidManifest.xml 2024-02-19 08:27:42,928 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,930 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,935 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,939 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,944 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,955 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,956 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,958 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,959 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:42,969 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2024-02-19 08:27:43,065 :: INFO :: APK file was successfully validated! 2024-02-19 08:27:43,068 :: WARNING :: Requested API level 33 is larger than maximum we have, returning API level 28 instead. 2024-02-19 08:27:50,430 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,433 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,440 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,450 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,458 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,467 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,471 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,475 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,477 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,483 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:50,494 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2024-02-19 08:27:58,166 :: 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 2024-02-19 08:27:58,195 :: INFO :: 10.42.0.1 - - [19/Feb/2024 08:27:58] "POST /_dash-update-component HTTP/1.1" 200 -`

mdkeil commented 7 months ago

duplicate; look at #733

martynhr commented 7 months ago

Hi, yesterday I stopped receiving data from trips or charge status. after a reboot I was asked to login again but the login process does not work with error: 400 - server_error : Internal Server Error at user config

image

Same here.

redzoro01 commented 7 months ago

same problem for me

scream05 commented 7 months ago

same also on my side.

martynhr commented 7 months ago

Hi, yesterday I stopped receiving data from trips or charge status. after a reboot I was asked to login again but the login process does not work with error: 400 - server_error : Internal Server Error at user config image

Same here.

Working again now

francogodi commented 7 months ago

Hi, yesterday I stopped receiving data from trips or charge status. after a reboot I was asked to login again but the login process does not work with error: 400 - server_error : Internal Server Error at user config image

Same here.

Working again now

not working on my side, maybe because I need to authenticate and auth does not work

sod75 commented 7 months ago

Yes, look at the bug733 mentioned above. Stellantis made a change to the API so the regular authentication does not work anymore. There is a workaround described that takes a bit of effort to get the new auth token into the config file to make it working again.

martynhr commented 7 months ago

I didn't do any workaround to get it working. I logged back in on the app (android) and then restarted the home assistant add-on. Initially it didn't work but a few hours later it's running again.

wjansenw commented 7 months ago

I tried to login to the app, and it mentioned my password was incorrect. After resetting the pwd, I got some questions around my profile, which I had to answer before I could proceed with the login.

So hoping that I experience the same as @martynhr, and that in a couple of hours, I will manage to re-login.

wjansenw commented 7 months ago

The work-around in https://github.com/flobz/psa_car_controller/issues/733 worked for me.

flavrai commented 7 months ago

Also managed to fix it using https://github.com/flobz/psa_car_controller/issues/733

The only problem in my case - and I put the details here in case someone has a similar setup - is that I run car-controller & homeassistant as containers in a kubecluster, so I rely on the available docker images.

Here bellow the steps in case needed:

cmjcmj123 commented 7 months ago

I have same problem in HA. I also had problems to log into the phone app MyOpel. After reporting it to Opel support I got info that they had made new rules for guilty passwords. My password didn't fulfill. So I had to click "forgot pw" and generate a new that fulfilled the new requirements. But When I logged into PSA Controller in HA with the new pw I got the 400 error

flobz commented 7 months ago

duplicate with #733