psa_car_controller icon indicating copy to clipboard operation
psa_car_controller copied to clipboard

Code 495: Invalid or expired client certificate

Open YKPDang opened this issue 6 months ago • 20 comments

Describe the bug After submitting the user config, the error "Invalid or expired client certificate" with code 495 comes up.

Config file Default config, fresh install

[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 (please complete the following information):

  • OS: Docker on Debian and HA addon
  • Brand and model of car: Citroen C3 2019
  • Application version (commit number, branch or tag): v3.5.6
  • Log from http://server_address:port/log and browser console log
psacc  | Traceback (most recent call last):
psacc  |   File "/usr/local/lib/python3.11/dist-packages/psa_car_controller/web/view/config_views.py", line 137, in connectPSA
psacc  |     INITIAL_SETUP = InitialSetup(app_name, email, password, countrycode)
psacc  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psacc  |   File "/usr/local/lib/python3.11/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 76, in __init__
psacc  |     self.user_info = self.__fetch_user_info()
psacc  |                      ^^^^^^^^^^^^^^^^^^^^^^^^
psacc  |   File "/usr/local/lib/python3.11/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 113, in __fetch_user_info
psacc  |     raise ConnectionError(msg) from ex
psacc  | ConnectionError: Traceback (most recent call last):
psacc  |   File "/usr/local/lib/python3.11/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 105, in __fetch_user_info
psacc  |     res_dict = res2.json()["success"]
psacc  |                ~~~~~~~~~~~^^^^^^^^^^^
psacc  | KeyError: 'success'
psacc  | {"code":"495", "message": "Invalid or expired client certificate"}

Additional context Image

Related issues: #938, #618

YKPDang avatar Jun 18 '25 07:06 YKPDang

Same error here, but i try login in Peugeot.

gerar19 avatar Jun 18 '25 08:06 gerar19

Same here

fseverijnen avatar Jun 18 '25 11:06 fseverijnen

Pareil ici

kyokai000 avatar Jun 18 '25 12:06 kyokai000

same error here, tried this for the first time 5min ago

ricardoccpaiva avatar Jun 18 '25 12:06 ricardoccpaiva

same here.

lcorreia007 avatar Jun 18 '25 15:06 lcorreia007

Same here :(

Anistruk avatar Jun 18 '25 15:06 Anistruk

same here with opel since yesterday

fabianskii avatar Jun 18 '25 16:06 fabianskii

https://github.com/flobz/psa_car_controller/issues/938#issuecomment-2322860235

This helped me to temporarily work around the issue (even though at the end of the login process it can't find my car/says probably too old, guess its time for the firmware update eventually... opel corsa e)

  1. Download xapg from https://apkcombo.com/ (e.g. myopel, mypeugeot etc.)
  2. unzip xapk
  3. replace existing .apk with the extracted
  4. restart

fabianskii avatar Jun 18 '25 16:06 fabianskii

same here in Italy with peugeot login :-(

ulipo avatar Jun 18 '25 20:06 ulipo

@flobz isn't this as simple as updating https://github.com/flobz/psa_apk/blob/main/mypeugeot.apk.bz2 ?

ricardoccpaiva avatar Jun 18 '25 22:06 ricardoccpaiva

same in italy with citroen

bmatti996 avatar Jun 19 '25 09:06 bmatti996

#938 (comment)

This helped me to temporarily work around the issue (even though at the end of the login process it can't find my car/says probably too old, guess its time for the firmware update eventually... opel corsa e)

1. Download xapg from https://apkcombo.com/ (e.g. myopel, mypeugeot etc.)

2. unzip xapk

3. replace existing .apk with the extracted

4. restart

Can confirm this works. Be sure to use the base.apk package.

Perhaps a more permanent solution would be to dynamically fetch the newest APK from a source like APKcombo, if possible.

schellevis avatar Jun 20 '25 09:06 schellevis

#938 (comment) This helped me to temporarily work around the issue (even though at the end of the login process it can't find my car/says probably too old, guess its time for the firmware update eventually... opel corsa e)

1. Download xapg from https://apkcombo.com/ (e.g. myopel, mypeugeot etc.)

2. unzip xapk

3. replace existing .apk with the extracted

4. restart

Can confirm this works. Be sure to use the base.apk package.

Perhaps a more permanent solution would be to dynamically fetch the newest APK from a source like APKcombo, if possible.

but for what type of deployment is this solution? where are you running PSA Car Controller?

ricardoccpaiva avatar Jun 20 '25 21:06 ricardoccpaiva

I'm running it in docker, but that should not really matter

schellevis avatar Jun 21 '25 06:06 schellevis

I'm running it in docker, but that should not really matter

can you explain it in a bit more detail? where is the apk located so that i can replace it with the new version downloaded from apkcombo?

ricardoccpaiva avatar Jun 22 '25 12:06 ricardoccpaiva

I'm not sure about other setups, but with the Docker setup, the APK i located in the folder with all the config files.

schellevis avatar Jun 22 '25 17:06 schellevis

I'm not sure about other setups, but with the Docker setup, the APK i located in the folder with all the config files.

so you just copy the apk to inside the container?

ricardoccpaiva avatar Jun 22 '25 22:06 ricardoccpaiva

The issue should be fixed ! 😄

flobz avatar Jun 23 '25 05:06 flobz

The issue should be fixed ! 😄

Image

Nice, I was able to login but there's no trip data, any ideas of what might be?

ricardoccpaiva avatar Jun 23 '25 06:06 ricardoccpaiva

I was able to login as well, but when pressing 'Send SMS' and seeing the 'SMS Sent' notification I am not actually receiving the SMS.

Edit: The above doesn't seem to be an issue as the PSA-CC dashboard does seem to get some data. I am however getting a 404 - Vehicle not found error, and the /get_vehicleinfo/VIN is throwing an HTTP 500 Internal server error

fseverijnen avatar Jun 23 '25 11:06 fseverijnen

For future reference and for other users experiencing the same:

Apparently this is a known issue that can occur and is described in the FAQ.

@flobz The description of point 2 does not reflect all scenarios as I never had the errors as displayed in the FAQ and the resolution of point 5 did not resolve my problem with receiving an SMS. Could you please update the FAQ to cover my scenario? Much appreciated!

fseverijnen avatar Jun 28 '25 17:06 fseverijnen

@fseverijnen you can create a PR with the FAQ updated :)

flobz avatar Sep 13 '25 14:09 flobz