Trying to switch Preconditioning generates a 500 Server Error from the psa_car_controller
Describe the bug
When I submit a "http://
To Reproduce
submit a "http://
Config file
cat config.json { "abrp": { "abrp_enable_vin": [], "token": "" }, "client_id": "xxxxxxxxxxxxxx", "client_secret": "xxxxxxxxxxxxxx", "co2_signal_api": "xxxxxxxxxxxxxx", "country_code": "NL", "customer_id": "AP-ACNTxxxxxxxxxxxxxx", "proxies": { "http": "", "https": "" }, "realm": "clientsB2CPeugeot", "refresh_token": "xxxxxxxxxxxxxx", "remote_refresh_token": "xxxxxxxxxxxxxx", "weather_api": "xxxxxxxxxxxxxx"
Environment (please complete the following information):
- OS: Ubuntu 22.04
- Brand and model of car: Peugeot e208 (2022)
- Application version (commit number, branch or tag) v.3.5.3
- Log from http://server_address:port/log and browser console log
2024-10-19 13:28:00,150 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:28:00] "GET /get_vehicleinfo/yyyy HTTP/1.1" 200 - 2024-10-19 13:28:00,369 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:28:00] "GET /favicon.ico HTTP/1.1" 200 - 2024-10-19 13:29:41,659 :: INFO :: Preconditioning: topic: psa/RemoteServices/from/cid/AP-ACNT200007631251/ThermalPrecond: {'asap': 'activate', 'programs': {'program1': {'day': [0, 0, 0, 0, 0, 0, 0], 'hour': 34, 'minute': 7, 'on': 0}, 'program2': {'day': [0, 0, 0, 0, 0, 0, 0], 'hour': 34, 'minute': 7, 'on': 0}, 'program3': {'day': [0, 0, 0, 0, 0, 0, 0], 'hour': 34, 'minute': 7, 'on': 0}, 'program4': {'day': [0, 0, 0, 0, 0, 0, 0], 'hour': 34, 'minute': 7, 'on': 0}}} 2024-10-19 13:29:42,843 :: ERROR :: Exception on /preconditioning/yyyy/1 [GET] Traceback (most recent call last): File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app response = self.full_dispatch_request() File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/web/view/api.py", line 89, in preconditioning return jsonify(APP.myp.remote_client.preconditioning(vin, activate)) File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/psa/RemoteClient.py", line 252, in preconditioning self.publish(msg) File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/psa/RemoteClient.py", line 139, in publish self._refresh_remote_token() File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/psa/RemoteClient.py", line 179, in _refresh_remote_token self.mqtt_client.username_pw_set("IMA_OAUTH_ACCESS_TOKEN", self.remoteCredentials.access_token) AttributeError: 'NoneType' object has no attribute 'username_pw_set' 2024-10-19 13:29:42,843 :: ERROR :: Exception on /preconditioning/yyyy/1 [GET] Traceback (most recent call last): File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app response = self.full_dispatch_request() File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/.local/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/web/view/api.py", line 89, in preconditioning return jsonify(APP.myp.remote_client.preconditioning(vin, activate)) File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/psa/RemoteClient.py", line 252, in preconditioning self.publish(msg) File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/psa/RemoteClient.py", line 139, in publish self._refresh_remote_token() File "/home/pi/.local/lib/python3.10/site-packages/psa_car_controller/psa/RemoteClient.py", line 179, in _refresh_remote_token self.mqtt_client.username_pw_set("IMA_OAUTH_ACCESS_TOKEN", self.remoteCredentials.access_token) AttributeError: 'NoneType' object has no attribute 'username_pw_set' 2024-10-19 13:29:42,846 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:29:42] "[35m[1mGET /preconditioning/yyyy/1 HTTP/1.1[0m" 500 - 2024-10-19 13:29:43,249 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:29:43] "GET /favicon.ico HTTP/1.1" 200 - 2024-10-19 13:29:47,495 :: INFO :: save config change 2024-10-19 13:30:01,147 :: INFO :: 127.0.0.1 - - [19/Oct/2024 13:30:01] "GET /get_vehicleinfo/yyyy HTTP/1.1" 200 - 2024-10-19 13:30:08,345 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:30:08] "GET /config HTTP/1.1" 200 - 2024-10-19 13:30:08,413 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:30:08] "[36mGET /assets/99_custom_overides.css?m=1729108675.1199687 HTTP/1.1[0m" 304 - 2024-10-19 13:30:08,420 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:30:08] "[36mGET /assets/clientside.js?m=1729108675.1199687 HTTP/1.1[0m" 304 - 2024-10-19 13:30:08,838 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:30:08] "GET /_dash-layout HTTP/1.1" 200 - 2024-10-19 13:30:08,847 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:30:08] "GET /_dash-dependencies HTTP/1.1" 200 - 2024-10-19 13:30:08,855 :: INFO :: 192.168.1.52 - - [19/Oct/2024 13:30:08] "GET /_favicon.ico?v=2.18.1 HTTP/1.1" 200 -