Closed sod75 closed 6 months ago
I tried http://192.168.0.91:3000/get_vehicleinfo/VF3M4DGZUPSxxxxxx from a browserwindow and it gives an Internal Server Error. the log is a bit more verbose.
2024-01-25 17:27:16,051 :: ERROR :: Exception on /get_vehicleinfo/VF3M4DGZUP[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/api.py", line 43, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 109, in get_vehicle_info
self.record_info(car)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 195, in record_info
Database.record_position(self.weather_api, car.vin, mileage, latitude, longitude, altitude, date, level,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/repository/db.py", line 257, in record_position
temp = get_temp(latitude, longitude, weather_api)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/utils/utils.py", line 20, in get_temp
temp = weather_res_json.get("current", weather_res_json.get("main"))["temp"]
TypeError: 'NoneType' object is not subscriptable
2024-01-25 17:27:16,051 :: ERROR :: Exception on /get_vehicleinfo/VF3M4DGZUPS [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/api.py", line 43, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 109, in get_vehicle_info
self.record_info(car)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 195, in record_info
Database.record_position(self.weather_api, car.vin, mileage, latitude, longitude, altitude, date, level,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/repository/db.py", line 257, in record_position
temp = get_temp(latitude, longitude, weather_api)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/utils/utils.py", line 20, in get_temp
temp = weather_res_json.get("current", weather_res_json.get("main"))["temp"]
TypeError: 'NoneType' object is not subscriptable
2024-01-25 17:27:16,052 :: INFO :: 172.18.0.1 - - [25/Jan/2024 17:27:16] "GET /get_vehicleinfo/VF3M4DGZUPS HTTP/1.1" 500 -
2024-01-25 17:27:38,299 :: ERROR :: refresh_vehicle_info:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 126, in __refresh_vehicle_info
self.get_vehicle_info(car.vin)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 109, in get_vehicle_info
self.record_info(car)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 195, in record_info
Database.record_position(self.weather_api, car.vin, mileage, latitude, longitude, altitude, date, level,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/repository/db.py", line 257, in record_position
temp = get_temp(latitude, longitude, weather_api)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/utils/utils.py", line 20, in get_temp
temp = weather_res_json.get("current", weather_res_json.get("main"))["temp"]
TypeError: 'NoneType' object is not subscriptable
2024-01-25 17:27:42,789 :: INFO :: 192.168.0.91 - - [25/Jan/2024 17:27:42] "GET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1" 200 -
Hi, I have observed the same issue, the database info.db isn't updated anymore with version 3.3.2. As soon as I downgrade to version 3.3.1 is see that database is updated again.
The issue might be related to this error message TypeError: 'NoneType' object is not subscriptable
. At least the error messages disappeared after rolling back to version 3.3.1.
2024-02-05T13:08:40.454181+01:00 mdha02-n psa-car-controller[1666030]: 2024-02-05 13:08:40,452 :: DEBUG :: vin:VINxxxxxxxxxxxxxx longitude:x.xxxxx latitude:yy.yyyyy date:2024-02-05 11:36:51+00:00 mileage:20672.5 level:27.0 charge_date:2024-02-05 11:37:47+00:00 level_fuel:None moving:False
2024-02-05T13:08:40.672681+01:00 mdha02-n psa-car-controller[1666030]: 2024-02-05 13:08:40,669 :: ERROR :: refresh_vehicle_info:
2024-02-05T13:08:40.672869+01:00 mdha02-n psa-car-controller[1666030]: Traceback (most recent call last):
2024-02-05T13:08:40.672944+01:00 mdha02-n psa-car-controller[1666030]: File "/opt/psa-car-controller/lib/python3.11/site-packages/psa_car_controller/psacc/application/psa_client.py", line 126, in __refresh_vehicle_info
2024-02-05T13:08:40.673003+01:00 mdha02-n psa-car-controller[1666030]: self.get_vehicle_info(car.vin)
2024-02-05T13:08:40.673064+01:00 mdha02-n psa-car-controller[1666030]: File "/opt/psa-car-controller/lib/python3.11/site-packages/psa_car_controller/psacc/application/psa_client.py", line 109, in get_vehicle_info
2024-02-05T13:08:40.673119+01:00 mdha02-n psa-car-controller[1666030]: self.record_info(car)
2024-02-05T13:08:40.673168+01:00 mdha02-n psa-car-controller[1666030]: File "/opt/psa-car-controller/lib/python3.11/site-packages/psa_car_controller/psacc/application/psa_client.py", line 195, in record_info
2024-02-05T13:08:40.673261+01:00 mdha02-n psa-car-controller[1666030]: Database.record_position(self.weather_api, car.vin, mileage, latitude, longitude, altitude, date, level,
2024-02-05T13:08:40.673318+01:00 mdha02-n psa-car-controller[1666030]: File "/opt/psa-car-controller/lib/python3.11/site-packages/psa_car_controller/psacc/repository/db.py", line 257, in record_position
2024-02-05T13:08:40.673372+01:00 mdha02-n psa-car-controller[1666030]: temp = get_temp(latitude, longitude, weather_api)
2024-02-05T13:08:40.673418+01:00 mdha02-n psa-car-controller[1666030]:
2024-02-05T13:08:40.673471+01:00 mdha02-n psa-car-controller[1666030]: File "/opt/psa-car-controller/lib/python3.11/site-packages/psa_car_controller/psacc/utils/utils.py", line 20, in get_temp
2024-02-05T13:08:40.673524+01:00 mdha02-n psa-car-controller[1666030]: temp = weather_res_json.get("current", weather_res_json.get("main"))["temp"]
2024-02-05T13:08:40.673578+01:00 mdha02-n psa-car-controller[1666030]:
2024-02-05T13:08:40.673625+01:00 mdha02-n psa-car-controller[1666030]: TypeError: 'NoneType' object is not subscriptable
It seems fixed to me, in the sense that the error again no longer "crashes" the program.
I again have a similar error as with v3.3.1
2024-03-06 17:51:06,952 :: INFO :: 172.18.0.1 - - [06/Mar/2024 17:51:06] "GET /assets/images/battery-soh.svg HTTP/1.1" 200 -
2024-03-06 17:51:06,955 :: INFO :: 172.18.0.1 - - [06/Mar/2024 17:51:06] "GET /assets/images/battery-charge.svg HTTP/1.1" 200 -
2024-03-06 17:51:06,957 :: INFO :: 172.18.0.1 - - [06/Mar/2024 17:51:06] "GET /assets/images/mileage.svg HTTP/1.1" 200 -
2024-03-06 17:51:17,904 :: ERROR :: Unable to get temperature from openweathermap :
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/utils/utils.py", line 20, in get_temp
temp = weather_res_json.get("current", weather_res_json.get("main"))["temp"]
TypeError: 'NoneType' object is not subscriptable
2024-03-06 17:51:18,394 :: INFO :: new position recorded for VF3M4DGZUPxxxxxx
2024-03-06 17:51:18,573 :: INFO :: update_data
happy to close this bug and have this error as a new one if that's the preference.
ok, I just realized the error is due to me not have set up the "paid" plan for openweathermap. not the cleanest error message, but that's irrelevant. Closing
Describe the bug After upgrade from 3.3.1 to 3.3.2 trips, position or chargings don't get registered anymore.
To Reproduce Steps to reproduce the behavior: Upgrade from 3.3.1 to 3.3.2 via docker
what command did you use docker-compose stop psa, docker-compose pull psa; docker-compose up -d psa
when the bug append ? After the update
Does it persist after restarting the program? Yes
Does it persist after recreate config by going to http://server_address:port/config? not tried, but downgrading to 3.3.1 again solves the issue. It ran fine for days again, I gave the 3.3.2 another go, same issue again.
Config file
Environment (please complete the following information):
this is what I get in 3.3.1
Additional context Add any other context about the problem here.