Jump to content

Media removed making error in database


Go to solution Solved by Luke,

Recommended Posts

Posted

Hi all,

I have an issue with my EMby server on Synology.
When I put new medias in a folder they aren't found by server.
I found that the issue is caused by an old media (removed) still in the database.
Seems Emby can't remove it and is not able to continue to "parse" the folder.

I tried to put a file with the same name and remove it from Emby, not succedded.

 

Here the error in the log, maybe someone could help me :)

Thank you.

 

2023-06-21 23:54:05.370 Info App: Removing item from database, Type: Movie, Name: Jean-Philippe, Path: /volume1/video/001-Films/J/Jean-Philippe (2006).avi, Id: 1486
2023-06-21 23:54:05.500 Error BaseItem: Error validating children for J 37 /volume1/video/001-Films/J
	*** Error Report ***
	Version: 4.7.13.0
	Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology72_{version}_x86_64.spk
	Operating system: Linux version 4.4.302+ (root@build5) (gcc version 12.2.0 (GCC) ) #64561 SMP Fri May 19 01:27:06 CST 2023
	Framework: .NET 6.0.14
	OS/Process: x64/x64
	Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: /var/packages/EmbyServer/var
	Application path: /volume1/@appstore/EmbyServer/system
	SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed
	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 Emby.Server.Implementations.Data.SqliteItemRepository.ExecuteWithStringFormatParam(IDatabaseConnection db, String query, String valueText, Int64[] values)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItemsInTransaction(IDatabaseConnection db, Int64[] ids, Boolean containsFolders, Boolean supportsPeople, Boolean supportsChapters, Boolean supportsCollections, Boolean supportsMediaStreams, Boolean supportsListItems, Boolean supportsExternalDatabases)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItemsInChunks(Int64[] ids, IDatabaseConnection db, Boolean containsFolders, Boolean supportsPeople, Boolean supportsChapters, Boolean supportsCollections, Boolean supportsMediaStreams, Boolean supportsListItems, Boolean supportsExternalDatabases)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItems(Int64[] ids)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItems(BaseItem[] items)
	   at Emby.Server.Implementations.Library.LibraryManager.DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, Boolean notifyParentItem)
	   at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal(IProgress`1 progress, CancellationToken cancellationToken, Boolean recursive, Boolean refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
	   at MediaBrowser.Controller.Entities.Folder.ValidateSubFolders(BaseItem[] children, IDirectoryService directoryService, IProgress`1 progress, CancellationToken cancellationToken)
	Source: SQLitePCL.pretty
	TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)

 

Posted

Hello Luke,

Thank you for your answer. But today my main concern is to access the DB on my Synology. Tried many things but, for now, I didn't succedded (I would try to remove manualy this entry :/) :(

Posted
12 hours ago, Hjlfmir said:

Hello Luke,

Thank you for your answer. But today my main concern is to access the DB on my Synology. Tried many things but, for now, I didn't succedded (I would try to remove manualy this entry :/) :(

Hi, what did you try to do?

Posted (edited)

Hi, for now, I follow the link and did these following :

Remove Database Locks

- Run Integrity Check

- Recover library.db : here, at the end, I can't start Emby (always return to "Manually stop"). I have to delete library.db and restore from library.old :s (check owner and permissions, all is good).

Edited by Hjlfmir
Posted

Are you all set now?

Posted (edited)

Hello Luke,

Nope, still the same issue and I didn't succeed in recovering the Library (Emby wasn't starting after the file "exchange").
So for now I'm still stuck :s

Is there any way to remove easily this entry from the database ?

Edited by Hjlfmir
Posted

Deleting the database file altogether will be the best way.

Posted

Hi Luke,

Too many years of manual entries inside, can't imagine re-do everthing oO !

Hjlfmir
Posted

Hi,

Is there anyway to "repare" the database whithout deleting it ?

  • Solution
Posted
On 7/4/2023 at 4:25 PM, Hjlfmir said:

Hi,

Is there anyway to "repare" the database whithout deleting it ?

You're going to have to delete the rows from the MediaItems table. When you try to do that, you're going to get errors about foreign key constraints from other tables, so basically, you'll need to delete rows from those other tables first before you can delete the rows from MediaItems. Try it with something like DB Browser for sqlite to see what I mean. This is assuming you have experience working with databases though.

  • Like 1
  • 2 weeks later...
Posted

Hi Luke,

Tahnk you for your help. I'll have a look into this :)

  • Thanks 1
Posted

Hi Luke,

After manually removed all items manually, DB and Emby is going well :)

Thank you for your help :)

  • Thanks 1
Posted

Thanks for the feedback !

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...