Jump to content

TV series are identified but episodes are completely missing


Go to solution Solved by sa2000,

Recommended Posts

Happy2Play
Posted

@Lukeis this not a broke database?

Looks like every episode and "Error saving items"

2024-07-02 19:04:10.520 Error BaseItem: Error refreshing item We're Not in Kansas Anymore 1722921 U:\90210\90210.S01.1080p.NF.WEB-DL.DD5.1.x264-DEEP\90210.S01E01.We.Are.Not.In.Kansas.Anymore-The.Jet.Set.1080p.NF.WEB-DL.DD5.1.x264-DEEP.mkv
	*** Error Report ***
	Version: 4.8.8.0
	Command line: C:\Users\Owner\AppData\Roaming\Emby-Server\system\EmbyServer.dll
	Operating system: Microsoft Windows 10.0.22631
	Framework: .NET 6.0.30
	OS/Process: x64/x64
	Runtime: C:/Users/Owner/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 12
	Data path: C:\Users\Owner\AppData\Roaming\Emby-Server
	Application path: C:\Users\Owner\AppData\Roaming\Emby-Server\system
	SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed
	SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
	   at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
	   at SQLitePCL.pretty.StatementImpl.MoveNext()
	   at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, String sql)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItemsInTranscation(IDatabaseConnection db, List`1 tuples, MetadataRefreshOptions metadataRefreshOptions)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, MetadataRefreshOptions metadataRefreshOptions, Action`1 afterSave, Boolean disableForeignKeys, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Library.LibraryManager.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, Boolean setDateLastSaved, Boolean saveMetadata, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Library.LibraryManager.UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, MetadataRefreshOptions metadataRefreshOptions)
	   at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepository(ItemUpdateType updateReason, BaseItem parent, MetadataRefreshOptions metadataRefreshOptions)
	   at Emby.Providers.Manager.MetadataService`2.SaveItem(MetadataResult`1 result, Boolean isFirstRefresh, LibraryOptions libraryOptions, ItemUpdateType reason, IDirectoryService directoryService, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken)
	   at Emby.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, BaseItem[] collectionFolders, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, BaseItem[] collectionFolders, LibraryOptions libraryOptions, CancellationToken cancellationToken)
	   at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadataRecursive(BaseItem[] children, MetadataRefreshOptions refreshOptions, BaseItem[] collectionFolders, LibraryOptions libraryOptions, Boolean recursive, Dictionary`2 newItemIds, IProgress`1 progress, CancellationToken cancellationToken)
	Source: SQLitePCL.pretty
	TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)

 

RanmaCanada
Posted

If the database is broken I take it my only option then to wipe the server directory and reinstall?

Does the backup and restore plugin save the users or do I have to do all the manually as before? It's been a while since I've had to use it and previously it was just easier to grab the user folder and move it across as it did not grab the user info.

Thanks @Happy2Playfor always being so awesome. I'm pretty sure I owe you a pizza at this point.

Happy2Play
Posted
1 hour ago, RanmaCanada said:

If the database is broken I take it my only option then to wipe the server directory and reinstall?

Does the backup and restore plugin save the users or do I have to do all the manually as before? It's been a while since I've had to use it and previously it was just easier to grab the user folder and move it across as it did not grab the user info.

Thanks @Happy2Playfor always being so awesome. I'm pretty sure I owe you a pizza at this point.

Your backups will have the users.db, but all libraries are db only now so you will have to manually recreate all of them.  Playlists will be broken as there are usershares and the db is no longer viable.

I guess technically you can GET your libraries from the API then reapply them one by one via the API again if you don't want to enter and set them up again.

That being said I have only done limited testing with users.db and new library.db and have seen quirks with user access or parental controls having to be toggled on a new library to be seen per user.

But dev many if you have to nuke the current db or if there is a way to salvage the db as a db god would have to look at it.

As I have mentioned in other topics if the db goes bad and there is no backup that can be recovered we need a proper way to restore users and userdata at a minimum.  Libraries can be a lot of work but can be reentered.  As for users folder they really only contain say user image now as I don't believe policy/config is read but could be wrong (but the folder does not create users).

sa2000
Posted

Wondering if this is this is the same series replicated or has overlap? and if that has a bearing on the problem

2024-07-02 18:31:57.474 Debug SqliteItemRepository: GetitemById Series 1671017 U:\90210
2024-07-02 18:33:29.067 Debug SqliteItemRepository: GetitemById Series 1671013 U:\Beverly Hills 90210 (1990-2000 Complete Series)

 

RanmaCanada
Posted
4 hours ago, sa2000 said:

Wondering if this is this is the same series replicated or has overlap? and if that has a bearing on the problem

2024-07-02 18:31:57.474 Debug SqliteItemRepository: GetitemById Series 1671017 U:\90210
2024-07-02 18:33:29.067 Debug SqliteItemRepository: GetitemById Series 1671013 U:\Beverly Hills 90210 (1990-2000 Complete Series)

 

I have both the original 90210 and the re-imagination or whatever the stupid updated one was. Different series.

RanmaCanada
Posted

As long as the users are backed up I don't care about anything else as I store the .nfo file in every directory to make this process easier. If this happens again I'll just nuke everything and start from scratch and hope my user's are fine.

Let me know how to send you your pizza

rbjtech
Posted
22 minutes ago, RanmaCanada said:

As long as the users are backed up I don't care about anything else as I store the .nfo file in every directory to make this process easier. If this happens again I'll just nuke everything and start from scratch and hope my user's are fine.

I'm sure there is a better way, but I have in the past, just shutdown emby, deleted the library.db file (leaving users.db well alone) and re-started emby.  Then just rebuilt the database by doing a full library scan.   User history is linked by provider id - so each users watch history is maintained.

 

Happy2Play
Posted
41 minutes ago, rbjtech said:

I'm sure there is a better way, but I have in the past, just shutdown emby, deleted the library.db file (leaving users.db well alone) and re-started emby.  Then just rebuilt the database by doing a full library scan.   User history is linked by provider id - so each users watch history is maintained.

 

Issue now is Library config is db only so root/default/eachlibrary no longer exists or is no longer read if exists.  But will have to export userdata from backup db via plugin or manual export/import userdatas table from db to db.

  • Thanks 1
rbjtech
Posted
2 minutes ago, Happy2Play said:

Issue now is Library config is db only so root/default/eachlibrary no longer exists or is no longer read if exists.  But will have to export userdata from backup db via plugin or manual export/import userdatas table from db to db.

Ah ok thanks for the correction.  👍  I should probably try a test recovery myself ...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...