Endymion 6 Posted January 8, 2025 Posted January 8, 2025 For the past week, I noticed that all my episodes disappear from my shows in 1 volume. All the shows would still be listed, but with no episodes. Emby would go through the whole process of rescanning and rebuilding that part of the library. I just let it do what it had to do. BUT, then it happen again the very next day to my other volume I have shows on. Again, I just let it do what it had to do. Mind you, it takes over a day to scan and rebuild one of those volumes Now, all the shows are coming up like that... shows are listed in app, but they don't have any episodes or seasons. It just shows the main title of a show and actors. I have tried to restore from a few older backup before I started having this issue and the same thing is happening. It all looked and worked good (minus any episodes I recently added). But, as soon as Emby started scanning to add the new episodes, it would add them just fine and then it would start making things disappear. lol Now what is crazy... most of the new stuff that was added is there (including the older episodes of that show) but, 99 percent of the rest is gone at the moment. That is until it spends the next 3 days rebuilding it and then doing it again... the vicious cycle lol I have no clue how to fix this. I haven't done anything to the server it self. I've just been letting it do what it has to do for quite a while now. So, I'm just lost on why all of a sudden I'm getting this error. Please help me fix this. PS. This is on an Asustor (Linux base) please move this, if this where it needs to be. embyserver.txt
Happy2Play 9780 Posted January 8, 2025 Posted January 8, 2025 Devs will have to comment further but suggests a broken database. SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed May have to go over how many library's setup and the path/folder assigned to each.
Luke 42078 Posted January 10, 2025 Posted January 10, 2025 Hi @Endymionhow many Emby libraries have you created, and what folder paths are added to each one?
Endymion 6 Posted January 10, 2025 Author Posted January 10, 2025 I figured it would be easier to show you. It is fairly simple... Movies is on one volume in a raid 1 with two folders /share/MoviesHD and /share/MoviesSD (one set of HDD) Shows are in two volumes in a raid 1... /share/Shows and /share/Shows2 (one set of HDD for each volume) I ran across "Corrupt Database" in KB Articles yesterday. I'm thinking that may be what's going on. I'm not good or real familiar with command prompts. I very rarely use it, so I'm going the DB Browser way. I'm stuck at dumping data. I haven't figured out how to do that in DB Browser yet. This is/was just something I was gonna try and see if it solves the problem. Or at least while waiting to see if anybody could give me a solution. I would really hate to have to rebuild the library from scratch. I have 100s of hours invested in editing each show, episodes and actors, to basically have it all rest. And that seems like it was doing that. Though, there is a funny thing going on now. I did a restore from an older back up (like I did before) after I posted here. I also turned off library scans, so it wouldn't do as I described. I notice now all of my shows have all the episodes and seasons, BUT the seasons pictures are missing from most of the shows (added an example pic). I would be fine going through each one and re-adding them, if that helps solves a complete rebuild... any thing to avoid that. lol By the way, everything else is running fine. I'm just not doing any updates to libraries at this time.
Endymion 6 Posted January 12, 2025 Author Posted January 12, 2025 Can someone help me make sense of this... I followed the instructions from KB Articles and I saw some Parse errors during the rebuild. I'm sure that isn't normal, but the integrity check came back ok. So, I tried the recovered db in Emby and it would start then shut down. I couldn't access Emby at all. I went back with a backed up db to get it to start back up. I've included all that info here... It's back to as I had it before. But, as before I'll get that error "SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed" and it will start removing episodes (entire seasons) from the Shows library and deleting the posters from the Shows seasons. Even if I manually re-added the posters. I also tried to just "Refresh Metadata" with just "Search for missing metadata" as a Hail Mary. Unfortunately, I received the same result. lol I'm not seeing any issues when scanning any other library except the Shows library. embyserver-recovered db.txt embyserver-old db restored.txt
sa2000 674 Posted January 13, 2025 Posted January 13, 2025 12 hours ago, Endymion said: It's back to as I had it before. But, as before I'll get that error "SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed" and it will start removing episodes (entire seasons) from the Shows library and deleting the posters from the Shows seasons. Even if I manually re-added the posters. I also tried to just "Refresh Metadata" with just "Search for missing metadata" as a Hail Mary. Unfortunately, I received the same result. lol This is known to arise if at any point you had overlapping folder paths in a library definition with a parent folder path as well as lower level folder path inadevertantly set in a library defintion. Happy to look at this original database before any restores/recovery attempts made to see what is the giving rise to the FOREIGN KEY constraint error and to establish if it was caused by overlapping paths or some other issue. Shutdown Emby Server, copy out the library.db file (and if shutdown is tidy, there won;t br any db-shm or db-wal) to copy out and zip and upload externally and send me a private message with a link to download the zip from
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