psa_car_controller icon indicating copy to clipboard operation
psa_car_controller copied to clipboard

400 - server_error : Internal Server Error

Open AndrewWalls opened this issue 2 years ago • 41 comments

Car: Vauxhall Corsa E

When I attempt to authenticate under 'My Car Details' I get the error message: 400 - server_error : Internal Server Error

Attempted on: Windows 10 PC and HomeAssistant running on a Raspberry Pi 4

I have used this tool for years, but this error has just emerged. I have attempted on older versions and newer versions but the issue is recurring.

AndrewWalls avatar Nov 18 '23 12:11 AndrewWalls

Car: Peugeot E-208

I got the same error, was working fine until today, now if I want to get the vehicle info I get an error 400... I can still send wakeup though.

I tried on my Raspberry Pi 4 too, on my windows 11 pc, reinstalled everything, logged back in but still not working.

The app is up to date.

2023-11-24 00:08:54,771 :: INFO :: 127.0.0.1 - - [24/Nov/2023 00:08:54] "GET /favicon.ico HTTP/1.1" 200 - 2023-11-24 00:09:29,369 :: ERROR :: get_vehicle_info: ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Thu, 23 Nov 2023 23:09:29 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 22-Nov-2023 23:09:29 GMT, JSESSIONID=TW5M3d6e6Qc0XjT4ojyMT88qBevUYgyElN5bHRoo; path=/, PSACountry=FR; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '945fb68f655fdba82d22db7c', 'User-Agent': 'Swagger-Codegen/4.0/python'}) HTTP response body: {"uuid":"b88ebed2-4d9b-4ae0-afb5-525692c9a949","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-23T23:09:29.014Z"}

2023-11-24 00:09:29,802 :: ERROR :: get_vehicle_info: ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Thu, 23 Nov 2023 23:09:29 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 22-Nov-2023 23:09:29 GMT, JSESSIONID=NDjrMO01eCTKz0neN0lyzMAo4y7exMDnTe5aWcai; path=/, PSACountry=FR; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '08f333a5655fdba952c32c63', 'User-Agent': 'Swagger-Codegen/4.0/python'}) HTTP response body: {"uuid":"a273b369-e76f-485f-91d2-b6765027f7ea","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-23T23:09:29.491Z"}

2023-11-24 00:09:29,804 :: ERROR :: Exception on /get_vehicleinfo/that's private [GET] Traceback (most recent call last): File "C:\Users\maxen\Documents\Projet E-208\TestAPI\theEnv\lib\site-packages\flask\app.py", line 1455, in wsgi_app response = self.full_dispatch_request() File "C:\Users\maxen\Documents\Projet E-208\TestAPI\theEnv\lib\site-packages\flask\app.py", line 869, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\maxen\Documents\Projet E-208\TestAPI\theEnv\lib\site-packages\flask\app.py", line 867, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\maxen\Documents\Projet E-208\TestAPI\theEnv\lib\site-packages\flask\app.py", line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "C:\Users\maxen\Documents\Projet E-208\TestAPI\theEnv\lib\site-packages\psa_car_controller\web\view\views.py", line 180, in get_vehicle_info response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str), AttributeError: 'NoneType' object has no attribute 'to_dict'

MaxenceRemy avatar Nov 23 '23 23:11 MaxenceRemy

Car: Peugeot E-2008

Same error: "2023-11-23 23:38:45,374 :: ERROR :: get_vehicle_info: ApiException: (400) Reason: Bad Request"

PSA Car Controller Current version: v3.1.0

Thanks

CS7AFM avatar Nov 23 '23 23:11 CS7AFM

Same here... ERROR :: get_vehicle_info: ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 01:04:45 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/;

Bushrider avatar Nov 24 '23 01:11 Bushrider

Same here, corsa-e. Opel App ist working, but PSACC won't retrieve anything with same error message (API exception 400)

mafde2023 avatar Nov 24 '23 05:11 mafde2023

Same for me. Citroen e-c4.

At least I have a 100% charged car now. 😀

Kondors1 avatar Nov 24 '23 05:11 Kondors1

Same here, Citroen e-c4.

MoellerDi avatar Nov 24 '23 06:11 MoellerDi

The problem lies in the api client get_vehicle_info method that can return None after trying to call psa servers 2 times without success.

Do you get any message that starts with get_vehicle_info: ApiException in your logs? Those lines should hold the real reason why it doesn't work. If there aren't any, psa servers simply return an empty body now...

sanzoghenzo avatar Nov 24 '23 06:11 sanzoghenzo

No API exception. I just get: 2023-11-24 07:15:57,739 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,740 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,743 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,745 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,749 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,759 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,760 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,761 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,762 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,770 :: INFO :: Namespace mapping (55, 449) already seen! This is usually not a problem but could indicate packers or broken AXML compilers. 2023-11-24 07:15:57,854 :: INFO :: APK file was successfully validated! 2023-11-24 07:15:57,857 :: WARNING :: Requested API level 33 is larger than maximum we have, returning API level 28 instead. 2023-11-24 07:16:00,920 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,923 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,928 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,938 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,946 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,955 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,958 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,961 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,963 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,968 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:00,975 :: WARNING :: RES_TABLE_LIBRARY_TYPE chunk is not supported 2023-11-24 07:16:04,443 :: ERROR :: 400 - server_error : Internal Server Error

AndrewWalls avatar Nov 24 '23 07:11 AndrewWalls

Same issue for me: 2023-11-24 07:05:22,331 :: ERROR :: Exception on /get_vehicleinfo/VR3UHZKXZPTxxxxx [GET] Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 180, in get_vehicle_info response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str), AttributeError: 'NoneType' object has no attribute 'to_dict' 2023-11-24 07:05:22,331 :: ERROR :: Exception on /get_vehicleinfo/VR3UHZKXZPTxxxxxx [GET] Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 180, in get_vehicle_info response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str), AttributeError: 'NoneType' object has no attribute 'to_dict' 2023-11-24 07:05:22,332 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:22] "[35m[1mGET /get_vehicleinfo/VR3UHZKXZPTxxxxxx?from_cache=1 HTTP/1.1[0m" 500 - 2023-11-24 07:05:22,721 :: ERROR :: Exception on /charge_now/VR3UHZKXZPTxxxxxx/1 [GET] Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 204, in charge_now return jsonify(APP.myp.remote_client.charge_now(vin, charge != 0)) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 270, in charge_now hour, minute = self.get_charge_hour(vin) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 276, in get_charge_hour hour_str = self.vehicles_list.get_car_by_vin(vin).status.get_energy('Electric').charging.next_delayed_time AttributeError: 'NoneType' object has no attribute 'get_energy' 2023-11-24 07:05:22,721 :: ERROR :: Exception on /charge_now/VR3UHZKXZPTxxxxxxx/1 [GET] Traceback (most recent call last): File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 204, in charge_now return jsonify(APP.myp.remote_client.charge_now(vin, charge != 0)) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 270, in charge_now hour, minute = self.get_charge_hour(vin) File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 276, in get_charge_hour hour_str = self.vehicles_list.get_car_by_vin(vin).status.get_energy('Electric').charging.next_delayed_time AttributeError: 'NoneType' object has no attribute 'get_energy' 2023-11-24 07:05:22,786 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:22] "[35m[1mGET /charge_now/VR3UHZKXZPTxxxxxx/1 HTTP/1.1[0m" 500 - 2023-11-24 07:05:23,191 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET / HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,429 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET /_dash-layout HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,446 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET /_dash-dependencies HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,498 :: WARNING :: Failed to generate figure, there is probably not enough data yet 2023-11-24 07:05:23,501 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mPOST /_dash-update-component HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,503 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET /_favicon.ico?v=2.14.1 HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,610 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET /control?header=false HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,772 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET /_dash-dependencies HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,773 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mGET /_dash-layout HTTP/1.1[0m" 200 - 2023-11-24 07:05:23,800 :: INFO :: 172.17.0.1 - - [24/Nov/2023 07:05:23] "[37mPOST /_dash-update-component HTTP/1.1[0m" 200 - 2023-11-24 07:05:27,322 :: ERROR :: get_vehicle_info: ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:05:27 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:05:27 GMT, JSESSIONID=OImufW8X-i33Qq2tP5MqruoFrcOFntZf84EUxTcq; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '3248667965604b36d7c31dff', 'User-Agent': 'Swagger-Codegen/4.0/python'}) HTTP response body: {"uuid":"db46c310-7ac3-423a-8e77-766c1b067bd1","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:05:27.247Z"}

HenningS81 avatar Nov 24 '23 07:11 HenningS81

Same problem here with Corsa e

remcoselles avatar Nov 24 '23 07:11 remcoselles

Got the same error since yesterday

JaySea77 avatar Nov 24 '23 07:11 JaySea77

Same here

2023-11-24 08:31:24,183 :: ERROR :: get_vehicle_info: ApiException: (400) Reason: Bad Request HTTP response headers:

gerar19 avatar Nov 24 '23 07:11 gerar19

+1 same with e208 since yesterday; psa app is working.

Containerised psa_car_controller loading...
2023-11-24 08:32:20,486 :: INFO :: ["{'vin': 'VRXXXXXXXXXXXXXX', 'vehicle_id': '193d48c41eee5ee6844bbc1860d03c30aa6824a693fa3e1a583140227009781d76e946f031b5760ccd6833b4a563eb903d50b766fd56d15722be578389669de679e872cbb745dd21a53672eaf0b9b55531c37fffa47b04dbb6f27fb241df6fa28', 'label': 'e-208', 'brand': 'Peugeot', 'abrp_name': 'peugeot:e208:20:50', 'battery_power': 46, 'fuel_capacity': 0, 'max_elec_consumption': 70, 'max_fuel_consumption': 0}"]
2023-11-24 08:32:21,146 :: INFO :: save config change
2023-11-24 08:32:21,254 :: INFO :: ask wakeup to VRXXXXXXXXXXXXXX
2023-11-24 08:32:21,254 :: INFO :: topic: psa/RemoteServices/from/cid/AP-ACNT200007402898/VehCharge/state: {'action': 'state'}
2023-11-24 08:32:21,380 :: INFO :: Connected with result code {'session present': 0}
2023-11-24 08:32:21,380 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200007402898/#
2023-11-24 08:32:21,381 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VRXXXXXXXXXXXXXX
2023-11-24 08:32:21,786 :: ERROR :: get_vehicle_info: ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:32:21 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:32:21 GMT, JSESSIONID=lTXNWNUaGa9bUrSU2mCycpeoqsJ6_r-fGa9sKtXw; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '945fb68f656051852d9ea9fc', 'User-Agent': 'Swagger-Codegen/4.0/python'})
HTTP response body: {"uuid":"13c44f60-c65e-488b-ac89-6caec91b8515","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:32:21.689Z"}

2023-11-24 08:32:21,792 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200007402898/VehCharge/state/ProcessManagement b'{"process_date":"2023-11-24T07:32:21Z","vin":"VRXXXXXXXXXXXXXX","correlation_id":"41095da17b9146a3a58f924421593fa520231124073221254","process_code":"900","process_message":"[process.900.request.accepted.key]"}'
2023-11-24 08:32:22,092 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200007402898/VehCharge/state/ProcessManagement b'{"process_date":"2023-11-24T07:32:22Z","vin":"VRXXXXXXXXXXXXXX","correlation_id":"41095da17b9146a3a58f924421593fa520231124073221254","process_code":"901","process_message":"[process.901.vehicle.asleep.key]"}'
2023-11-24 08:32:22,383 :: ERROR :: get_vehicle_info: ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:32:22 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:32:22 GMT, JSESSIONID=psJD_VLQOwUaBu5chnfK8R2_DKNdS-57IUHocexD; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '945fb68f6560518598c02eef', 'User-Agent': 'Swagger-Codegen/4.0/python'})
HTTP response body: {"uuid":"cdaaa1d1-92b5-4769-9a9e-bf1f19a548ff","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:32:22.258Z"}

2023-11-24 08:32:22,385 :: ERROR :: status of VRXXXXXXXXXXXXXX is None
2023-11-24 08:32:22,386 :: ERROR :: Probably can't retrieve all information from API:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/charge_control.py", line 83, in process
    vehicle_status = self.psacc.vehicles_list.get_car_by_vin(self.vin).get_status()
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/model/car.py", line 53, in get_status
    raise ValueError("status of {} is None".format(self.vin))
ValueError: status of VRXXXXXXXXXXXXXX is None
2023-11-24 08:32:22,390 :: WARNING :: Can't get language
2023-11-24 08:32:22,900 :: INFO :: update_data
2023-11-24 08:32:23,501 :: INFO ::  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
2023-11-24 08:32:28,395 :: ERROR :: get_vehicle_info: ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:32:28 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:32:28 GMT, JSESSIONID=0QDXsbbUDXtpOlMju5YAjp28t9N8EwNhoBJb-MJb; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '945fb68f6560518cba0f1de5', 'User-Agent': 'Swagger-Codegen/4.0/python'})
HTTP response body: {"uuid":"f4699676-4654-4d02-b0a2-ed79f9754a8f","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:32:28.303Z"}

2023-11-24 08:32:28,892 :: ERROR :: get_vehicle_info: ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:32:28 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:32:28 GMT, JSESSIONID=QSD9OBijA8zgNKxksILN3UMcLH-jS5gP8CBcPhz5; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '08f333a56560518cfeb4a81f', 'User-Agent': 'Swagger-Codegen/4.0/python'})
HTTP response body: {"uuid":"230ae667-8c30-41c0-b107-449fc93bd712","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:32:28.796Z"}

2023-11-24 08:32:28,894 :: ERROR :: Exception on /get_vehicleinfo/VRXXXXXXXXXXXXXX [GET]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py", line 180, in get_vehicle_info
    response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
AttributeError: 'NoneType' object has no attribute 'to_dict'
2023-11-24 08:32:28,897 :: INFO :: 10.0.0.2 - - [24/Nov/2023 08:32:28] "GET /get_vehicleinfo/VRXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 500 -
2023-11-24 08:32:42,381 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200007402898/VehCharge/state/ProcessManagement b'{"process_date":"2023-11-24T07:32:42Z","vin":"VRXXXXXXXXXXXXXX","correlation_id":"41095da17b9146a3a58f924421593fa520231124073221254","process_code":"903","process_message":"[process.903.request.forwarded.to.vehicle.key]"}'
2023-11-24 08:32:43,259 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200007402898/VehCharge/state b'{"resp_date":"2023-11-24T07:32:43Z","vin":"VRXXXXXXXXXXXXXX","correlation_id":"41095da17b9146a3a58f924421593fa520231124073221254","return_code":"0"}'
2023-11-24 08:32:45,115 :: INFO :: <Request 'http://192.168.1.2:5050/charge_control?vin=VRXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
2023-11-24 08:32:45,116 :: INFO :: save config change
2023-11-24 08:32:45,117 :: INFO :: 10.0.0.2 - - [24/Nov/2023 08:32:45] "GET /charge_control?vin=VRXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 200 -
2023-11-24 08:32:58,300 :: ERROR :: get_vehicle_info: ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:32:58 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:32:58 GMT, JSESSIONID=V-3OzJCWv8cYYSewg4xp12owQ5Peo4FmOuCSKN_P; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '08f333a5656051a9feb8695f', 'User-Agent': 'Swagger-Codegen/4.0/python'})
HTTP response body: {"uuid":"94088f8f-1cff-4c03-a19c-976c3dc6a5d7","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:32:58.220Z"}

2023-11-24 08:32:58,857 :: ERROR :: get_vehicle_info: ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Date': 'Fri, 24 Nov 2023 07:32:58 GMT', 'Expires': '0', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 23-Nov-2023 07:32:58 GMT, JSESSIONID=c_lstCg-WdASCdeJv3z9b2oSKYHiZ_n1zJFjxalJ; path=/, PSACountry=DE; Domain=.groupe-psa.com; Path=/', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'Content-Type': 'application/hal+json', 'X-Global-Transaction-ID': '945fb68f656051aaba0f7d05', 'User-Agent': 'Swagger-Codegen/4.0/python'})
HTTP response body: {"uuid":"0848e98c-fe11-4a38-baf7-881fea3807b6","code":40000,"message":" Invalid parameter: X-MPHSource","timestamp":"2023-11-24T07:32:58.731Z"}

mdkeil avatar Nov 24 '23 07:11 mdkeil

Now i see thats the same issue for me It started yesterday around 21:37 CET time

Jordan87 avatar Nov 24 '23 08:11 Jordan87

Same here... API must have changed somehow... Trying to re-login via the GUI also failed. Also at 21:37 CET time.

wjansenw avatar Nov 24 '23 09:11 wjansenw

Car: Peugeot 3008 Seems to be going around now. Mine started doing this at 16:58 CET. Has something changed in the API?

jkarmfalk avatar Nov 24 '23 09:11 jkarmfalk

Indeed API have changed!

Tested with my library (wich is a rewrite of the core of this great project) they removed the vehicle extensions from the vehicle... need to better analyse the new payloads!

sanzoghenzo avatar Nov 24 '23 09:11 sanzoghenzo

API must have changed, but MyCitroën app is still working.

JaySea77 avatar Nov 24 '23 10:11 JaySea77

#678 with possible fix

mdkeil avatar Nov 24 '23 10:11 mdkeil

Think there was 2 errors here, The "get_vehicle_info: ApiException: (400)" Error, but i think OP (and i) have a slightly different error when trying to authenticate to Vauxhall (Corsa E)

2023-11-24 14:33:07,102 :: 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

Have tried the odometer fix in Homa Assistant and still getting same error.

thewhale21 avatar Nov 24 '23 14:11 thewhale21

Think there was 2 errors here, The "get_vehicle_info: ApiException: (400)" Error, but i think OP (and i) have a slightly different error when trying to authenticate to Vauxhall (Corsa E)

2023-11-24 14:33:07,102 :: 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

Have tried the odometer fix in Homa Assistant and still getting same error.

I'm getting the same. Vauxhall Corsa-E giving same feed as above after making the odometer change.

AndrewWalls avatar Nov 24 '23 18:11 AndrewWalls

Hi @flobz, Still seems to be an issue with the Vauxhall Corsa E, Any advice would be much appreciated.

2023-11-24 14:33:07,102 :: 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

thewhale21 avatar Nov 25 '23 11:11 thewhale21

@flobz thanks for quickly fixing this. Would it be possible to also follow up with a new version of the home assistant add-on?

Thanks!

siebertm avatar Nov 25 '23 13:11 siebertm

Was also wondering why the addon wasn't updated >.<

JaySea77 avatar Nov 25 '23 14:11 JaySea77

Please don't close, this isn't resolved for the Vauxhall Corsa E. We're still getting the error!

AndrewWalls avatar Nov 25 '23 15:11 AndrewWalls

Please don't close, this isn't resolved for the Vauxhall Corsa E. We're still getting the error!

Ditto :( I still get this error:

image

(I know the details are correct)

youradds avatar Dec 02 '23 08:12 youradds

@flobz How do we get this reopened? It's still an issue. I've tried looking into it, but I don't understand enough about the programming language or setup to work out whats going on. I'm a Perl programmer, so quite different.

youradds avatar Dec 06 '23 07:12 youradds

Still happening with Vauxhall Mokka-e as well @flobz

robotfishe avatar Dec 13 '23 08:12 robotfishe

Also with a new 2023 DS4. (Tested with 3.2.0 running in Docker)

Ik-12 avatar Dec 20 '23 17:12 Ik-12

@flobz Im still hitting this - how do we get the ticket reopened? Can we do anything to help debug? Logs etc

agbb avatar Dec 29 '23 12:12 agbb