teslamate-org / teslamate

A self-hosted data logger for your Tesla 🚘
https://docs.teslamate.org
MIT License
5.61k stars 703 forks source link

Can't set charging session cost #4058

Closed djpalmis closed 1 week ago

djpalmis commented 1 week ago

Is there an existing issue for this?

What happened?

I can't set no more the charging session cost. Page is showed but the text field is frozen, after a while the page refreshes itself.

Is it a teslamate bug (i'm using the latest 1.30). Can it be due to a corrupted database as per https://github.com/teslamate-org/teslamate/discussions/3991

Expected Behavior

No response

Steps To Reproduce

No response

Relevant log output

teslamate-1  | 2024-07-07 10:52:04.350 [info] Starting logger for 'xxx'
teslamate-1  | 2024-07-07 10:52:04.737 [info] MQTT connection has been established
teslamate-1  | 2024-07-07 10:52:29.174 car_id=1 [info] Start / :offline
teslamate-1  | 2024-07-07 10:52:41.995 [info] GET /
teslamate-1  | 2024-07-07 10:52:47.259 [info] Sent 200 in 5263ms
teslamate-1  | 2024-07-07 10:56:54.494 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 10:57:12.619 [info] Sent 200 in 18022ms
teslamate-1  | 2024-07-07 10:57:30.546 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 10:57:53.495 [info] Sent 200 in 22908ms
teslamate-1  | 2024-07-07 10:58:14.916 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 10:58:29.633 [info] Sent 200 in 14613ms
teslamate-1  | 2024-07-07 10:58:48.093 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 10:59:01.586 [info] Sent 200 in 13460ms
teslamate-1  | 2024-07-07 10:59:23.280 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 10:59:43.735 [info] Sent 200 in 20382ms
teslamate-1  | 2024-07-07 11:00:04.808 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 11:00:17.996 [info] Postgrex.Protocol (#PID<0.2448.0>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.2857.0> exited
teslamate-1  | 2024-07-07 11:00:18.058 [info] GET /
teslamate-1  | 2024-07-07 11:03:38.636 [info] GET /charge-cost/1259
teslamate-1  | 2024-07-07 11:03:52.557 [info] Sent 200 in 13628ms
teslamate-1  | 2024-07-07 11:07:50.532 [info] GET /
teslamate-1  | 2024-07-07 11:07:51.831 [info] Sent 200 in 1111ms

Screenshots

No response

Additional data

latest charging process which i can't set cost

id,start_date,end_date,charge_energy_added,start_ideal_range_km,end_ideal_range_km,start_battery_level,end_battery_level,duration_min,outside_temp_avg,car_id,position_id,address_id,start_rated_range_km,end_rated_range_km,geofence_id,$ 1258,2024-07-06 13:17:39.333,2024-07-06 13:31:03.17,31.80,75.14,284.03,16,61,13,29.0,1,9307119,542,75.14,284.03,,33.92, 1260,2024-07-06 17:48:45.498,2024-07-06 17:48:53.199,0.00,137.94,137.94,30,30,0,30.5,1,9329259,11,137.94,137.94,3,,0.00

Type of installation

Docker

Version

v1.30

JakobLichterfeld commented 1 week ago

Can it be due to a corrupted database as per #3991

Your log indicates so

teslamate-1  | 2024-07-07 11:00:17.996 [info] Postgrex.Protocol (#PID<0.2448.0>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.2857.0> exited

Is it a teslamate bug (i'm using the latest 1.30).

No TeslaMate Bug

djpalmis commented 1 week ago

Can it be due to a corrupted database as per #3991

Your log indicates so

teslamate-1  | 2024-07-07 11:00:17.996 [info] Postgrex.Protocol (#PID<0.2448.0>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.2857.0> exited

Thank You. Any tip on what shall I do? I tried to backup/restore: No luck. It's a shame to loose a 3 years database 🥲

djpalmis commented 1 week ago

Generally speaking, there is no error management or error reporting. I was thinking about those days when the Tesla API stopped working. Even in that case, the webpage just freezes.

Personally, I don't like software that behaves in such a way: errors should be managed better, and the user should be informed.

I have an issue with my data? Okay, but you should inform me. A database error should be reported at the user interface and, in the log, I should be able to debug the issue.

Nowadays, the user is "blind" and in the log I see messages that shall be reported at user level..

brianmay commented 1 week ago

Not much software can cope well when there are unexpected problems with the database. And based on #3991 it looks like there were problems creating the indexes for your database. Unfortunately, in typical fashion, when there was an error, instead of reporting what it was trying to do, it has blindly proceeded to the next step. This is not something we can fix.

djpalmis commented 1 week ago

I' skilled in embedded sw (actually it is worst: safety-critical embedded application). In my job I must evaluate the return value of the previous function call and behave accordly. I do not expect that Teslamate fixes an error but, at least, shall throw a message "Ehy user, something went wrong, check the log if you are skilled enought to debug it".

I.e. I didn't know that in my database there where unclosed drive/charge since @jheredianet introduced the "incomplete data" dashboard (thank you so much!!!).

That is due to "user problem hiding" philosophy.

JakobLichterfeld commented 1 week ago

I' skilled in embedded sw (actually it is worst: safety-critical embedded application).

Thanks for your openness. In my experience, no one who says they are skilled in SW is actually so. We can discuss on safety-critical embedded software or application, endless if you want. And yes, the worst SW I have seen is in safety environment, and yes power off is not the safe state in all applications.

But we lose focus here: There are >22 Million docker pulls of TeslaMate. One user do have a problem on user side with an SW which is currently licensed under MIT. For sure error handling can be improved, but as you already see, the logs do indicate your issue.

As I do not see any new information provided by you to let users guess how they can help with your individual issue, I'm going to close this issue.