Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrade from 3.3.1 to 3.3.2 trips, position or charges don't get registered anymore. #744

Closed
sod75 opened this issue Jan 25, 2024 · 5 comments

Comments

@sod75
Copy link

sod75 commented Jan 25, 2024

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

  1. what command did you use
    docker-compose stop psa, docker-compose pull psa; docker-compose up -d psa

  2. when the bug append ?
    After the update

  3. Does it persist after restarting the program?
    Yes

  4. 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

[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 = 1
# for future use
length unit = km
export format = csv
[Electricity config]
# price by kw/h
day price = 0.35
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: Linux xxx 4.4.180+ #42962 SMP Tue Sep 20 22:35:56 CST 2022 x86_64 GNU/Linux synology_geminilake_920+
  • Brand and model of car: Peugeot SUV 3008 Hybrid 225
  • Application version 3.3.2
  • Log from http://server_address:port/log and browser console log
 -2024-01-25 08:03:29,028 :: INFO :: App version 3.3.2
2024-01-25 08:03:35,343 :: INFO :: ["{'vin': 'VF3M4DGZUPS -2024-01-25 08:03:29,028 :: INFO :: App version 3.3.2
2024-01-25 08:03:35,343 :: INFO :: ["{'vin': 'VF3M4DGZUPS', 'vehicle_id': '1596ea144f82dba0ac516f0d5ec3a0f64ecd1ffb1b3c4aae6b40d58b566b0048e73e2852add7467fbc10adfb75b976fcaa59f481475831b5a86049c00ea4381354429768de3ea6acfa2defb17aba26a96ef54590cd8c34d37b2d50f52e58dea26', 'label': 'SUV 3008 Hybrid 225', 'brand': None, 'abrp_name': None, 'battery_power': 13.2, 'fuel_capacity': 43, 'max_elec_consumption': 70, 'max_fuel_consumption': 30}"]
2024-01-25 08:03:37,460 :: INFO :: save config change
2024-01-25 08:03:37,650 :: INFO :: ask wakeup to VF3M4DGZUPS
2024-01-25 08:03:37,650 :: INFO :: topic: psa/RemoteServices/from/cid/AP-ACNT200008553362/VehCharge/state: {'action': 'state'}
2024-01-25 08:03:37,776 :: INFO :: Connected with result code {'session present': 0}
2024-01-25 08:03:37,777 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200008553362/#
2024-01-25 08:03:37,777 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VF3M4DGZUPS
2024-01-25 08:03:37,986 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-25T07:03:37Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","process_code":"900","process_message":"[process.900.request.accepted.key]"}'
2024-01-25 08:03:38,084 :: WARNING :: Can't get language
2024-01-25 08:03:38,084 :: WARNING :: Can't get language
2024-01-25 08:03:38,140 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-25T07:03:38Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","process_code":"901","process_message":"[process.901.vehicle.asleep.key]"}'
2024-01-25 08:03:43,912 :: INFO :: update_data
2024-01-25 08:03:46,643 :: INFO ::  * Running on http://0.0.0.0:3000/ (Press CTRL+C to quit)
2024-01-25 08:03:54,576 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-25T07:03:54Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","process_code":"903","process_message":"[process.903.request.forwarded.to.vehicle.key]"}'
2024-01-25 08:03:54,986 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state b'{"resp_date":"2024-01-25T07:03:54Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","return_code":"0"}'
2024-01-25 08:04:42,110 :: INFO :: 192.168.0.91 - - [25/Jan/2024 08:04:42] "�[37mGET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1�[0m" 200 -
2024-01-25 08:04:42,112 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>
2024-01-25 08:04:42,113 :: INFO :: save config change
2024-01-25 08:04:42,113 :: INFO :: 192.168.0.91 - - [25/Jan/2024 08:04:42] "�[37mGET /charge_control?vin=VF3M4DGZUPS&?always_check=true HTTP/1.1�[0m" 200 -
2024-01-25 08:05:38,592 :: 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 08:05:42,109 :: INFO :: 192.168.0.91 - - [25/Jan/2024 08:05:42] "�[37mGET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1�[0m" 200 -
2024-01-25 08:05:42,110 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>731', 'vehicle_id': '1596ea144f82dba0ac516f0d5ec3a0f64ecd1ffb1b3c4aae6b40d58b566b0048e73e2852add7467fbc10adfb75b976fcaa59f481475831b5a86049c00ea4381354429768de3ea6acfa2defb17aba26a96ef54590cd8c34d37b2d50f52e58dea26', 'label': 'SUV 3008 Hybrid 225', 'brand': None, 'abrp_name': None, 'battery_power': 13.2, 'fuel_capacity': 43, 'max_elec_consumption': 70, 'max_fuel_consumption': 30}"]
2024-01-25 08:03:37,460 :: INFO :: save config change
2024-01-25 08:03:37,650 :: INFO :: ask wakeup to VF3M4DGZUPS
2024-01-25 08:03:37,650 :: INFO :: topic: psa/RemoteServices/from/cid/AP-ACNT200008553362/VehCharge/state: {'action': 'state'}
2024-01-25 08:03:37,776 :: INFO :: Connected with result code {'session present': 0}
2024-01-25 08:03:37,777 :: INFO :: subscribe to psa/RemoteServices/to/cid/AP-ACNT200008553362/#
2024-01-25 08:03:37,777 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VF3M4DGZUPS
2024-01-25 08:03:37,986 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-25T07:03:37Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","process_code":"900","process_message":"[process.900.request.accepted.key]"}'
2024-01-25 08:03:38,084 :: WARNING :: Can't get language
2024-01-25 08:03:38,084 :: WARNING :: Can't get language
2024-01-25 08:03:38,140 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-25T07:03:38Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","process_code":"901","process_message":"[process.901.vehicle.asleep.key]"}'
2024-01-25 08:03:43,912 :: INFO :: update_data
2024-01-25 08:03:46,643 :: INFO ::  * Running on http://0.0.0.0:3000/ (Press CTRL+C to quit)
2024-01-25 08:03:54,576 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-25T07:03:54Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","process_code":"903","process_message":"[process.903.request.forwarded.to.vehicle.key]"}'
2024-01-25 08:03:54,986 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state b'{"resp_date":"2024-01-25T07:03:54Z","vin":"VF3M4DGZUPS","correlation_id":"e2f729b6eb4d4c64a2f2649a43e2e12720240125070337650","return_code":"0"}'
2024-01-25 08:04:42,110 :: INFO :: 192.168.0.91 - - [25/Jan/2024 08:04:42] "�[37mGET /get_vehicleinfo/VF3M4DGZUP?from_cache=1 HTTP/1.1�[0m" 200 -
2024-01-25 08:04:42,112 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>
2024-01-25 08:04:42,113 :: INFO :: save config change
2024-01-25 08:04:42,113 :: INFO :: 192.168.0.91 - - [25/Jan/2024 08:04:42] "�[37mGET /charge_control?vin=VF3M4DGZUPS&?always_check=true HTTP/1.1�[0m" 200 -
2024-01-25 08:05:38,592 :: 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 08:05:42,109 :: INFO :: 192.168.0.91 - - [25/Jan/2024 08:05:42] "�[37mGET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1�[0m" 200 -
2024-01-25 08:05:42,110 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>

this is what I get in 3.3.1

2024-01-24 14:50:39,596 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:50:39] "^[[37mGET /charge_control?vin=VF3M4DGZUPS&?always_check=true HTTP/1.1^[[0m" 200 -
2024-01-24 14:51:11,431 :: INFO :: ask wakeup to VF3M4DGZUPS
2024-01-24 14:51:11,432 :: INFO :: topic: psa/RemoteServices/from/cid/AP-ACNT200008553362/VehCharge/state: {'action': 'state'}
2024-01-24 14:51:12,431 :: INFO :: save config change
2024-01-24 14:51:12,697 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-24T13:51:12Z","vin":"VF3M4DGZUPS","correlation_id":"148b8402a3204e5b83bd5457d23150e020240124135112432","process_code":"900","process_message":"[process.900.request.accepted.key]"}'
2024-01-24 14:51:12,864 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-24T13:51:12Z","vin":"VF3M4DGZUPS","correlation_id":"148b8402a3204e5b83bd5457d23150e020240124135112432","process_code":"901","process_message":"[process.901.vehicle.asleep.key]"}'
2024-01-24 14:51:33,556 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state/ProcessManagement b'{"process_date":"2024-01-24T13:51:33Z","vin":"VF3M4DGZUPS","correlation_id":"148b8402a3204e5b83bd5457d23150e020240124135112432","process_code":"903","process_message":"[process.903.request.forwarded.to.vehicle.key]"}'
2024-01-24 14:51:33,774 :: INFO :: mqtt msg received: psa/RemoteServices/to/cid/AP-ACNT200008553362/VehCharge/state b'{"resp_date":"2024-01-24T13:51:33Z","vin":"VF3M4DGZUPS","correlation_id":"148b8402a3204e5b83bd5457d23150e020240124135112432","return_code":"0"}'
2024-01-24 14:51:39,596 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:51:39] "^[[37mGET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1^[[0m" 200 -
2024-01-24 14:51:39,598 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>
2024-01-24 14:51:39,599 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:51:39] "^[[37mGET /charge_control?vin=VF3M4DGZUPS&?always_check=true HTTP/1.1^[[0m" 200 -
2024-01-24 14:52:39,597 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:52:39] "^[[37mGET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1^[[0m" 200 -
2024-01-24 14:52:39,599 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>
2024-01-24 14:52:39,600 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:52:39] "^[[37mGET /charge_control?vin=VF3M4DGZUPS&?always_check=true HTTP/1.1^[[0m" 200 -
2024-01-24 14:53:11,318 :: 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 19, in get_temp
    temp = weather_rep.json()["current"]["temp"]
KeyError: 'current'
2024-01-24 14:53:11,647 :: INFO :: new position recorded for VF3M4DGZUPS
2024-01-24 14:53:11,648 :: INFO :: update_data
2024-01-24 14:53:39,598 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:53:39] "^[[37mGET /get_vehicleinfo/VF3M4DGZUPS?from_cache=1 HTTP/1.1^[[0m" 200 -
2024-01-24 14:53:39,600 :: INFO :: <Request 'http://192.168.0.91:3000/charge_control?vin=VF3M4DGZUPS&%3Falways_check=true' [GET]>
2024-01-24 14:53:39,601 :: INFO :: 192.168.0.91 - - [24/Jan/2024 14:53:39] "^[[37mGET /charge_control?vin=VF3M4DGZUPS&?always_check=true HTTP/1.1^[[0m" 200 -

Additional context
Add any other context about the problem here.

@sod75
Copy link
Author

sod75 commented Jan 25, 2024

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 -
```

@mdino-gh
Copy link

mdino-gh commented Feb 5, 2024

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.

@mdino-gh
Copy link

mdino-gh commented Feb 5, 2024

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

flobz added a commit that referenced this issue Feb 19, 2024
flobz added a commit that referenced this issue Feb 19, 2024
flobz added a commit that referenced this issue Feb 19, 2024
@sod75
Copy link
Author

sod75 commented Mar 6, 2024

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.

@sod75
Copy link
Author

sod75 commented Mar 6, 2024

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

@sod75 sod75 closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants