Open djpalmis opened 1 day ago
Did it just start happening in 1.32.0?
What is the amount you are trying to insert?
What is the hardware that you are running TeslaMate on?
What version of PSQL are you running?
Just tested on a Raspberry Pi 3b+, 1.32.0 (updated moments before), no issues.
Not an issue introduced by this new version! Sorry, I should have said that before! It is an issue that I have since June but only now I "learned" how to "debug" my database.
It is a VM Instance on Google Cloud e2-micro (yeah it is not good but it worked before june) PostgreSQL v17.2 Docker Compose v2.27.1
About the amount: I can't even select the textbox because the page is frozen like it is waiting some background data.
If i try to delete a geofence location it just refresh the page with the geofence still there.
Can you create a new geofence from the web interface? Can you modify the settings for the car from the web interface?
How large is the database, if you know? And an estimate of how many charges the database has?
I tend to lean towards a service / hosting issue. Although, my Pi 3b+ has to be weaker than your gCloud VM. Can you see any load increases from a VM monitoring perspective when you try to edit a charge / geofence?
Can you create a new geofence from the web interface? No, I cannot create a new geofence from the web interface. When I try to create or delete a geofence through the web interface, TeslaMate hangs and I get a "Bad Gateway" page. (See below) However, I can successfully perform these actions using direct SQL commands on the database.
Can you modify the settings for the car from the web interface? I'm unsure what is meant by "settings for the car." If this refers to changing the vehicle's nickname, configuration, or similar options via TeslaMate's web interface, I can check this and provide more details if needed. Please clarify if this is what you mean.
How large is the database, if you know? The database size is approximately 1.8 GB, and the positions table is the largest, occupying around 1.1 GB.
Here are the full database statistics: Table | Size --------------------+--------- positions | 1164 MB charges | 104 MB addresses | 912 kB drives | 768 kB states | 528 kB charging_processes | 352 kB cars | 96 kB updates | 40 kB settings | 32 kB tokens | 32 kB schema_migrations | 24 kB car_settings | 24 kB geofences | 24 kB (13 rows)
How many charges does the database have?
teslamate=# ANALYZE VERBOSE charging_processes; INFO: analyzing "public.charging_processes" INFO: "charging_processes": scanned 24 of 24 pages, containing 1428 live rows and 30 dead rows; 1428 rows in sample, 1428 estimated total rows ANALYZE
teslamate=# ANALYZE VERBOSE geofences; INFO: analyzing "public.geofences" INFO: "geofences": scanned 1 of 1 pages, containing 14 live rows and 2 dead rows; 14 rows in sample, 14 estimate d total rows ANALYZE
teslamate=# SELECT 'addresses', COUNT() FROM addresses
teslamate-# UNION ALL
teslamate-# SELECT 'car_settings', COUNT() FROM car_settings
teslamate-# UNION ALL
teslamate-# SELECT 'cars', COUNT() FROM cars
teslamate-# UNION ALL
teslamate-# SELECT 'charges', COUNT() FROM charges
teslamate-# UNION ALL
teslamate-# SELECT 'positions', COUNT() FROM positions
teslamate-# UNION ALL
teslamate-# SELECT 'charging_processes', COUNT() FROM charging_processes
teslamate-# UNION ALL
teslamate-# SELECT 'drives', COUNT() FROM drives
teslamate-# UNION ALL
teslamate-# SELECT 'states', COUNT() FROM states;
?column? | count
--------------------+----------
addresses | 613
car_settings | 1
cars | 1
charges | 571633
positions | 10982683
charging_processes | 1428
drives | 2062
states | 4992
Can you see any load increases from a VM monitoring perspective when you try to edit a charge or geofence? I have noticed significant load increases on the VM during these operations. However, my VM is a Google Cloud e2-micro instance, which has limited CPU and memory resources. Here it is when I tried to create a new geofence. At this moment a "bad gateway" message is displayed. To fix it I ran: sudo docker compose restart teslamate
Despite this, direct SQL operations on the database (e.g., creating, updating, or deleting geofences or charges) work without any issues or delays. The problems only occur through the web interface.
Is there an existing issue for this?
What happened?
[NOT AN ISSUE WITH NEW VERSION, PROBLEM PRESENT BEFORE]
I am experiencing persistent issues with TeslaMate when attempting to modify charges or geofences via the web interface.
Specifically:
Running SQL commands directly in the database works perfectly for both modifying costs and deleting geofences. The database appears healthy and responds well to manual queries.
Expected Behavior
Changes to charges or geofences should be applied without delays or errors, similar to manual SQL operations.
Steps To Reproduce
Relevant log output
Screenshots
No response
Additional data
What I’ve Tried
No signs of corruption or issues with table structure.
Direct SQL operations (e.g., updating costs or deleting geofences) complete successfully.
Web interface logs show timeout errors (see below).
Database logs show no critical errors during manual SQL commands.
Updated DATABASE_TIMEOUT in docker-compose.yml to 120000. No effect on the behavior.
Verified table indexes.
Ran VACUUM FULL and ANALYZE to ensure optimal performance.
Type of installation
Docker
Version
v1.32.0