charlesk 2 Posted January 26, 2022 Posted January 26, 2022 When scanning the library getting a fail error with the below. i've tried restarting both the machine and Emby? Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown. at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc) at SQLitePCL.pretty.StatementImpl.MoveNext() at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItem(IDatabaseConnection db, BaseItem item, Int64 topParentId, Int64 userDataKeyId, IStatement insertItemStatement, IStatement updateItemStatement) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItemsInTranscation(IDatabaseConnection db, List`1 tuples) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, Action`1 afterSave, CancellationToken cancellationToken) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, Boolean setDateLastSaved, Boolean saveMetadata, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason) at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepository(ItemUpdateType updateReason) at MediaBrowser.Providers.Manager.MetadataService`2.SaveItem(MetadataResult`1 result, Boolean isFirstRefresh, LibraryOptions libraryOptions, ItemUpdateType reason, IDirectoryService directoryService, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, LibraryOptions libraryOptions, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.TV.Series.RefreshAllMetadata(MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, IProgress`1 progress, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Folder.RefreshAllMetadataForContainer(IMetadataContainer container, MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, IProgress`1 progress, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Folder.RefreshMetadataRecursive(BaseItem[] children, MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Folder.RefreshMetadataRecursive(BaseItem[] children, MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, Boolean recursive, IProgress`1 progress, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal(IProgress`1 progress, CancellationToken cancellationToken, Boolean recursive, Boolean refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService) at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation(IProgress`1 progress, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken) at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
Happy2Play 9780 Posted January 26, 2022 Posted January 26, 2022 @charleskPlease post the server log to show the exact error.
Happy2Play 9780 Posted January 26, 2022 Posted January 26, 2022 3 minutes ago, charlesk said: Sorry, here you go!embyserver.txt Sorry you have a corrupt datadata. SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed Unfortunately, you will have to reset your database.
Luke 42077 Posted January 26, 2022 Posted January 26, 2022 Actually please go through the help document from the beginning: https://support.emby.media/support/solutions/articles/44002210894-corrupt-database It will give you a few things to try first to see if you can avoid completely resetting the database. Please let us know if this helps. Thanks. 1
Davey's 37 Posted June 21, 2024 Posted June 21, 2024 Currently I am logged out or kicked out by Emby and when I try to log in I get the above mentioned error. Is there any other way to try the mentioned solution(s) ?
GrimReaper 4739 Posted June 21, 2024 Posted June 21, 2024 8 minutes ago, Davey's said: Currently I am logged out or kicked out by Emby and when I try to log in I get the above mentioned error. Is there any other way to try the mentioned solution(s) ? Sorry, not following, any other way to try what? Steps to troubleshoot corrupted database? Integrity check/database recovery? For that your server needs to be shut down, so I'm unclear how's not being able to log in preventing you? But before any action taken, I'd suggest posting server log.
Davey's 37 Posted June 21, 2024 Posted June 21, 2024 @GrimReaperthanks. Well, sometimes it just takes some time, it seems, because I can now 'normally' log in again. -And view content. This afternoon I gave Emby some commands to update Metedata and images
albumman 7 Posted August 12, 2024 Posted August 12, 2024 fwiw i saw similar behavior when I kicked off a very long-running transaction (deleting a library with 22 folders and more tv shows than i'd care to admit in it). Server would throw these exceptions for pretty much any request while the database was churning away, but after enough patience the embyServer process completed (I had done an exit) and after that was able to restart with everything checking out as ok. 1
Luke 42077 Posted August 14, 2024 Posted August 14, 2024 On 1/26/2022 at 1:19 PM, Luke said: Actually please go through the help document from the beginning: https://support.emby.media/support/solutions/articles/44002210894-corrupt-database It will give you a few things to try first to see if you can avoid completely resetting the database. Please let us know if this helps. Thanks. @charlesk?
TVTech 7 Posted January 11, 2025 Posted January 11, 2025 (edited) I interrupted a library scan earlier today because Emby was scanning the wrong folders and now I am unable to remove that library. I keep getting the above error message each time I try to remove the library. Here are my most recent server logs and keep mind that I tried to follow the steps outlined in that link you posted but something seems to be amiss in the following directions: Remove Database Locks Shutdown Emby Navigate to the folder containing your database file Delete library.db-shm & library.db-wal Restart Emby librry.db-shm & library.db-wal are not visible in the folder while the Emby server is shutdown. Clearly there is some mishap in the order of directions here. embyserver.txt Edited January 11, 2025 by TVTech
TVTech 7 Posted January 12, 2025 Posted January 12, 2025 15 hours ago, TVTech said: I interrupted a library scan earlier today because Emby was scanning the wrong folders and now I am unable to remove that library. I keep getting the above error message each time I try to remove the library. Here are my most recent server logs and keep mind that I tried to follow the steps outlined in that link you posted but something seems to be amiss in the following directions: Remove Database Locks Shutdown Emby Navigate to the folder containing your database file Delete library.db-shm & library.db-wal Restart Emby librry.db-shm & library.db-wal are not visible in the folder while the Emby server is shutdown. Clearly there is some mishap in the order of directions here. embyserver.txt 40.27 kB · 0 downloads I anyone available to help me fix this problem?
GrimReaper 4739 Posted January 12, 2025 Posted January 12, 2025 (edited) 9 minutes ago, TVTech said: I anyone available to help me fix this problem? Unfortunately, it appears you'll have to rebuild your database (hopefully you have full backup) as you've added overlapping/nested folder paths to your libraries, with one of them having parent (X:\) folder/drive which you are trying to delete and you broke your db in the process. Quote 2025-01-11 16:50:15.362 Info LibraryMonitor: Watching directory with new FileSystemWatcher for X:\MOVIES\Musical for item 84206 2025-01-11 16:58:15.052 Info App: Removing item from database, Type: Folder, Name: X:\, Path: X:\, Id: 85807 2025-01-11 16:58:58.217 Error App: Error removing library SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown. Related thread: Edited January 12, 2025 by GrimReaper
TVTech 7 Posted January 12, 2025 Posted January 12, 2025 (edited) 17 minutes ago, GrimReaper said: Unfortunately, it appears you'll have to rebuild your database (hopefully you have full backup) as you've added overlapping/nested folder paths to your libraries, with one of them having parent (X:\) folder/drive which you are trying to delete and you broke your db in the process. Related thread: I don't have a backup of my library database and I wouldn't even know how to begin rebuilding my database. What are my other options here? Surely there must be something else besides a complex process which I am not familiar with. At least tell me the exact steps that I need to do to fix this instead of just dropping this massively bad news on me without any other feedback. Edited January 12, 2025 by TVTech
Happy2Play 9780 Posted January 12, 2025 Posted January 12, 2025 3 hours ago, TVTech said: I don't have a backup of my library database and I wouldn't even know how to begin rebuilding my database. What are my other options here? Surely there must be something else besides a complex process which I am not familiar with. At least tell me the exact steps that I need to do to fix this instead of just dropping this massively bad news on me without any other feedback. It will be difficult to say unless one of the database gurus has some advice as your parent and child folder paths sort of breaks the database. @sa2000 Have you tried removing folder paths of the child libraries working back to ie parent path X:\? Otherwise you will potentially have to start a new database unless someone provides the manual commands to attempt to correct the db issue. As there really needs to be more features in-place to prevent parent and child paths from being added at all. But think thinks have been put in-place for future versions but not current versions.
sa2000 674 Posted January 12, 2025 Posted January 12, 2025 1 hour ago, Happy2Play said: It will be difficult to say unless one of the database gurus has some advice as your parent and child folder paths sort of breaks the database 5 hours ago, TVTech said: I don't have a backup of my library database and I wouldn't even know how to begin rebuilding my database. What are my other options here? Surely there must be something else besides a complex process which I am not familiar with. At least tell me the exact steps that I need to do to fix this instead of just dropping this massively bad news on me without any other feedback. If you had "X:\" as a path as well as lower levels eg "X:\Movies" as a path as well, then I think you will need to delete all the libraries that had any path starting with "X:" and recreate them - start by deleting those libraries and then after all are deleted, then recreate them ensuring no overlapping paths. Also it is not recommended to have a path with just a drive letter - ensure you have folders eg "X:\Movies" and "X:\TV" etc. And do them serially - create one, wait for it to be created and the scan completed and then create the next
LyraTheLycan 5 Posted January 26, 2025 Posted January 26, 2025 I seem to have triggered this database error while attempting to use certain built-in subtitles from a video file. Perhaps an FFMPEG write error? It destroyed all connections to Emby while the video was playing, throwing that error on login attempts. It resolved itself - shutting down Emby automatically removed the library.library.db-shm & library.db-wal files, and everything runs perfectly with a separately downloaded subs file.
Luke 42077 Posted January 26, 2025 Posted January 26, 2025 22 minutes ago, LyraTheLycan said: I seem to have triggered this database error while attempting to use certain built-in subtitles from a video file. Perhaps an FFMPEG write error? It destroyed all connections to Emby while the video was playing, throwing that error on login attempts. It resolved itself - shutting down Emby automatically removed the library.library.db-shm & library.db-wal files, and everything runs perfectly with a separately downloaded subs file. Hi, please attach the Emby server log: How to Report a Problem Thanks.
LyraTheLycan 5 Posted January 26, 2025 Posted January 26, 2025 7 minutes ago, Luke said: Hi, please attach the Emby server log: How to Report a Problem Thanks. This was when I restarted, and tried using the subtitles... I believe I see the issue. Testing now. embyserver-63873516907.txt
LyraTheLycan 5 Posted January 26, 2025 Posted January 26, 2025 18 minutes ago, LyraTheLycan said: This was when I restarted, and tried using the subtitles... I believe I see the issue. Testing now. embyserver-63873516907.txt 81.92 kB · 1 download My disk was full. Looking at a 9GB metadata folder now, either way it turns out my issue wasn't related to this thread, sorry. 1
IAmHugh 63 Posted May 28, 2025 Posted May 28, 2025 I have the Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown error trying to sign into Emby. I installed the beta by mistake and I would leave it but for some reason the FireTV apps will not pick it up. I uninstalled it and installed the official Emby-server and now get that message. I stooped the Emby service, uninstalled Emby, removed the Emby items in /var/lib/, reinstalled Emby and am still getting that error. I would just as soon remove EVERYTHING and start from scratch.
Luke 42077 Posted May 28, 2025 Posted May 28, 2025 4 minutes ago, CummingCowGirl said: I have the Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown error trying to sign into Emby. I installed the beta by mistake and I would leave it but for some reason the FireTV apps will not pick it up. I uninstalled it and installed the official Emby-server and now get that message. I stooped the Emby service, uninstalled Emby, removed the Emby items in /var/lib/, reinstalled Emby and am still getting that error. I would just as soon remove EVERYTHING and start from scratch. Hi, you can't go back and forth between the two. What emby items did you remove?
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