SMTV91 15 Posted May 24, 2021 Posted May 24, 2021 Hi everyone, I recently had issues with scheduled tasks failing so I followed the instructions from another emby forum post which said the answer was to rebuild the db. So I renamed the original library file and set about rescanning media files. Since then the scan which had been running for about 4-5hrs froze at 86.6% for about 2 hrs and then stopped and gave a failed error message. I then tried scanning each media folder manually but kept getting scan failed error messages. Only about 1/3 of my library files are present. I attached my latest logs and screen shot the scanned media file alert from the dashboard. I'm at a loss for what to do... embyserver.txt
Solution Luke 42085 Posted May 24, 2021 Solution Posted May 24, 2021 HI, please take a look at this and let us know if this helps you resolve it: https://support.emby.media/support/solutions/articles/44002210894-corrupt-database Thanks.
SMTV91 15 Posted May 24, 2021 Author Posted May 24, 2021 Thanks for the reply Luke. I've started following the guide and am in the process of rescanning again after once again deleting the library.db file. I wasn't able to do the step in the guide to delete the library.db-shm & library.db-wal files as they would disappear when I shut down the server and weren't able to be deleted when the server was up as they were in use by the server. Right now the scan is at 95.5% so if that doesn't work I'll move on to the database integrity steps.
SMTV91 15 Posted May 24, 2021 Author Posted May 24, 2021 Looks like deleting the db file and rescanning until I get a successful media scan did the trick Luke. Thanks again. I'll save this guide for next time
Carlo 4561 Posted May 24, 2021 Posted May 24, 2021 Did you try the other 2 possible solutions before deleting the db file? BTW, after your scan finishes, shut down Emby and save a copy of your DB files. In the future if something ever happens you could put the file back, do a library scan and only scan what's changed.
SMTV91 15 Posted May 25, 2021 Author Posted May 25, 2021 @cayars Did you mean the delete the library.db-shm & library.db-wal files and ensuring the db path was correct or the integrity check? And thanks I backed up this new db file for next time.
Carlo 4561 Posted May 25, 2021 Posted May 25, 2021 Yes those 2 files. There are 3 different things to try in that article. 1. just removing library locks 2. integrity checks and recover of database 3. renaming library.db to start fresh The first one is the easiest to do and usually the fix for most people.
SMTV91 15 Posted May 25, 2021 Author Posted May 25, 2021 @cayars So I wasn't able to do the step in the guide to delete the library.db-shm & library.db-wal files as they would disappear when I shut down the server and weren't able to be deleted when the server was up as they were in use by the server. But I had found an earlier forum post that suggested renaming and start fresh which is what I did and what worked this time around. Thanks for following up 1
Carlo 4561 Posted May 25, 2021 Posted May 25, 2021 Sounds good. Yes the locks SHOULD only be in place when Emby was running. So ideally there is nothing to delete. You could have tried the recover step as well which is what I'd suggest if you have a big library but if it's on the smaller side or can be scanned back in rather quickly going the route you went is easy. Now that you have a rebuilt library.db file, next time you shut Emby down grab a copy of the few db files you have. That way you never need to rebuild from scratch again as you could put one back and rescan for new/removed media!
SMTV91 15 Posted May 28, 2021 Author Posted May 28, 2021 Ohhh ok that makes sense. And yeah I've backed up all of the db files. Thanks again! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now