Closed ptar closed 2 years ago
I found a - kind of - easy solution to the problem: I could just reindex the table.
This is what I did:
docker-compose exec database psql teslamate teslamate
select tablename from pg_indexes where indexname = 'cars_eid_index';
reindex table cars;
select * from cars;
Suggestion: On getting a broken index, this could be the default solution within Teslamate. Maybe you could implement some 'check and fix indexes'?
The rest of the story to close the issue...
Due to the broken index the pg_dump failed to generate a complete backup, starting at the end of August. After fixing the index, I encountered another problem: The table charges
wasn't completely selectable (using offset and limit I could get all rows below 190 and beyond 300 up to ~25000). So I extracted the rows missing from the last backup. I prepared a bck-file containing only the charges-entries (since no other table is depending on charges). Then I dropped charges
and restored the table with the prepared bck-file.
After that, I could vacuum all the tables and pg_dump runs again, so I created a complete backup.
I purged all the images and recreated them from scratch. After restoring the complete backup, everything but the very last charging session was back there again, including all drives in September!
Hurray!
Is there an existing issue for this?
What happened?
There's a problem with an index In the database-log, I can see
ERROR: version mismatch in index "cars_eid_index": file version 132, current version 4, minimal supported version 2
In the teslamate log I can see a follow-up;
** (Postgrex.Error) ERROR XX002 (index_corrupted) version mismatch in index "cars_eid_index": file version 132, current version 4, minimal supported version 2
and a restart (full logs see below)Expected Behavior
There shouldn't be an index problem and Teslamate should start normally.
Steps To Reproduce
docker-compose up -d
Relevant log output
Screenshots
No response
Additional data
No response
Type of installation
Docker
Version
pulled it before the test (2022-09-09)