Suspected db corruption after update following rebuild with new sd

Hi. Not having much luck here…
Just bought new osmc sd card following suspected os/file corruption on previous RP install of osmc.
All set up ok. Completed library scans.
Subsequent automatic update then seems to have corrupted the new databases. Now my Movies and TV Shows lists are completely empty, and rescanning succeeds but nothing ever shows up.
Tried several reboots etc.
Info/Log extract here - https://paste.osmc.tv/rokihububi
Seems to be a few mentions of db corruption, e.g.:

SQL: [MyVideos121.db] SQLite error SQLITE_CORRUPT (database disk image is malformed)
Query: select * from movie_view ORDER BY dateAdded desc, idMovie desc LIMIT 10
2024-02-04 14:23:12.904 T:538 error : GetMoviesByWhere failed

Is there any way to repair from here, or am I starting all over again?

Thanks in advance, Mike.

So the old card fully failed?
SQLITE data recovery would take more effort than a new install is my point of view especially as I would not trust the SD Card.

  1. Make a backup of your settings
  2. Test the SDcard extensively with H2TestW
  3. If point 2 succeed do a reinstall

Maybe that error is just because there is nothing in a library yet and the widgets that Estuary is trying to populate can’t get a result back from something that isn’t there? If you manually browse your video sources (Videos>Files>) do they actually show up? I see in the log…
Unable to lookup host: 'DISKSTATION'
so maybe you have a dns issue?

Those logs don’t appear to have an attempt to update the library in them which may have provided a bit more insight.

Thanks. I’m not sure what has happened… The connection to Diskstation is/was good, and I had movies and tv shows from multiple sources all showing up ok in the right categories. And then after a restart they were gone.
The restart became necessary because the scanning/scraping of sources seemed to have frozen part way through and the ui became unresponsive. Perhaps the reboot in these circumstances is unwise, and that is what is corrupting the database(s)…?
I wonder if somehow the network connection to Diskstation is timing out mid-scan and it is unable to recover. I will look into the network/timeout settings on the Synology NAS and see if anything can be extended there.
For now I have started over (reset from the My OSMC menu) readded sources etc, scanned the smallest ok, verified they appear on the library, and then backed up.
I will now scan each source one at a time, backing up as I go, and see if that gets me over the line.
Thanks again, Mike.

Update - making steady progress with the above approach. No further freezes during scanning.
Though I have had both a ‘Movies’ and ‘TV Shows’ wipeout that I was able to recover from by restoring a full back up. The ‘Movies’ one was after successfully scanning a local drive source, and the ‘TV Shows’ one was following a clean reboot after backing up. So whatever is causing this does not seem to be ‘update’ related, nor ‘freeze during scanning’ related. No idea, but I am progressing and the regular backups mean I am not having to start over.

Since you still have the issue then I would suspect you have an issue with a failing SD or PSU that is dropping voltage under load.

Thanks. I ploughed on regardless to complete the scans.
I then ran a backup and upon completion of the backup, the TV Show library had been wiped out.
Tried to restore a previous backup, but no diff.
Tried a clean shutdown to then reboot and the box went into File System repair but came up ok, again still with wiped out TV Show library.
Tried to restore backup again, and now all I have is a sad face doom loop, which is back where I was 3 weeks ago, and I cannot make the connection remotely to even get logs!

This was a brand new osmc sd card, on a previously working (though fairly old) Pi.
I thought completing the scans might get me to a happier place, but the opposite has happened!

Then decided to start over and reformatted and reflashed the osmc sd with the Feb build.

After booting from that and restoring backups, it turns out my last two backups restore a ‘wiped out’ (corrupted?) TV Show library, but the one before those does restore it ok. So back to scanning again, on the reflashed osmc card…

That eventually completed but always resulted in further library wipeouts.

As a Hail Mary, I reformatted and reflashed my original Pi sd card, installed osmc, and then restored my known good backup and completed the scanning… and that now seems ok.

So I’ve no idea what the problem was. It seems that some combination of the new osmc sd card and my old Pi (and psu?) will not play happily together, leading to what appears to be library db corruption (wipeouts!).

I don’t have much faith in this reflashed old sd either, but it will do for now til I can get hold of another. And now I have a good known backup with completed scans.

Thanks anyway for the help and suggestions. Always good to know you lot are out there.
Cheers, Mike.

I don’t understand why you do all that efforts and not once checked the SD card with H2TestW

I was too impatient to wait for it…! But I will run it now against the 32gb osmc sd card and see if it reveals any problems. Thanks.

Great, if it comes out clean then surely power supply is the next direction.

Here’s the results of the 32gb osmc sd from H2testw:

Warning: Only 30407 of 30408 MByte tested.
Test finished without errors.
You can now delete the test files *.h2w or verify them again.
Writing speed: 17.8 MByte/s
Reading speed: 76.2 MByte/s
H2testw v1.4

That is great news so issue must be somewhere else (like power supply or software).