Jump to content

scan media library failed - every time.


jonas.hansson@live.se

Recommended Posts

jonas.hansson@live.se

Hi.   Every time I try to scan my library it says that it fails... I do get a log, but I can´t make anything out. 

Please see failure log below if anyone knows what that means!?   



LOG: 

Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
at SQLitePCL.pretty.SQLiteException.CheckOk (SQLitePCLEx.sqlite3 db, System.Int32 rc) [0x00017] in <1319f47a49f34f6db3822eb2e43ff130>:0
at SQLitePCL.pretty.SQLiteException.CheckOk (SQLitePCLEx.sqlite3_stmt stmt, System.Int32 rc) [0x00006] in <1319f47a49f34f6db3822eb2e43ff130>:0
at SQLitePCL.pretty.StatementImpl.MoveNext () [0x0004a] in <1319f47a49f34f6db3822eb2e43ff130>:0
at Emby.Server.Implementations.Data.SqliteItemRepository.ExecuteWithStringFormatParam (SQLitePCL.pretty.IDatabaseConnection db, System.String query, System.String valueText, System.Int64[] values) [0x00034] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItemsInTransaction (SQLitePCL.pretty.IDatabaseConnection db, System.Int64[] ids, System.Boolean supportsPeople, System.Boolean supportsChapters, System.Boolean supportsCollections, System.Boolean supportsMediaStreams, System.Boolean supportsListItems, System.Boolean supportsExternalDatabases) [0x00114] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItemsInChunks (System.Int64[] ids, SQLitePCL.pretty.IDatabaseConnection db, System.Boolean supportsPeople, System.Boolean supportsChapters, System.Boolean supportsCollections, System.Boolean supportsMediaStreams, System.Boolean supportsListItems, System.Boolean supportsExternalDatabases) [0x00027] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItems (System.Int64[] ids) [0x00048] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItems (MediaBrowser.Controller.Entities.BaseItem[] items) [0x0002b] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.Library.LibraryManager.DeleteItem (MediaBrowser.Controller.Entities.BaseItem item, MediaBrowser.Controller.Library.DeleteOptions options, MediaBrowser.Controller.Entities.BaseItem parent, System.Boolean notifyParentItem) [0x00265] in <05979d9270ab4dafac52ba5587e41c17>:0
at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken, System.Boolean recursive, System.Boolean refreshChildMetadata, MediaBrowser.Controller.Providers.MetadataRefreshOptions refreshOptions, MediaBrowser.Controller.Providers.IDirectoryService directoryService) [0x0022e] in <42f6882bd6d34115bbdd5b6f8b48c222>:0
at MediaBrowser.Controller.Entities.Folder.ValidateSubFolders (MediaBrowser.Controller.Entities.BaseItem[] children, MediaBrowser.Controller.Providers.IDirectoryService directoryService, System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken) [0x0013f] in <42f6882bd6d34115bbdd5b6f8b48c222>:0
at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken, System.Boolean recursive, System.Boolean refreshChildMetadata, MediaBrowser.Controller.Providers.MetadataRefreshOptions refreshOptions, MediaBrowser.Controller.Providers.IDirectoryService directoryService) [0x00395] in <42f6882bd6d34115bbdd5b6f8b48c222>:0
at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken) [0x0014a] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken) [0x00092] in <05979d9270ab4dafac52ba5587e41c17>:0
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal (MediaBrowser.Model.Tasks.TaskOptions options) [0x001b0] in <05979d9270ab4dafac52ba5587e41c17>:0

Link to comment
Share on other sites

jonas.hansson@live.se

I have a nVidia Shield that runs on Android.    I have just updated the server to the latest version and after that it doesn´t work. 

Link to comment
Share on other sites

Happy2Play
3 minutes ago, jonas.hansson@live.se said:

I don´t underastand "happy2play"... post the log to the actaul error?   This is it...  

Please post a server log.

Link to comment
Share on other sites

jonas.hansson@live.se
2 minutes ago, Happy2Play said:

Please post a server log.

how is that any different from what I did?      This is the message I got under "messages" under the control panel interface.
image.thumb.png.000be7e8728a9c0ad7a0e090af968ba1.png
 

Link to comment
Share on other sites

Happy2Play

The dashboard error info does not show the same information that the Log file does.  So we need to see the server log to give you the correct information.

 

Log file will show if you have a Malformed corrupt database or a Locked database or even a different error that we may have not seen yet.

Edited by Happy2Play
Link to comment
Share on other sites

jonas.hansson@live.se
1 minute ago, Happy2Play said:

The dashboard error info does not show the same information that the Log file does.  So we need to see the server log to give you the correct information.

any chance of a guide on how to get the server log then? 

Link to comment
Share on other sites

Happy2Play
Just now, jonas.hansson@live.se said:

any chance of a guide on how to get the server log then? 

If you don't have direct access to the log folder, path shown on dashboard, you can go to Dashboard-Logs and download the server log and attach here.

If you do not want to sanitize your log of private information you can pm.

Link to comment
Share on other sites

jonas.hansson@live.se
3 minutes ago, Happy2Play said:

If you don't have direct access to the log folder, path shown on dashboard, you can go to Dashboard-Logs and download the server log and attach here.

If you do not want to sanitize your log of private information you can pm.

Took a while before I found it...  (I think).

Is this is?  

embyserver.txt

Link to comment
Share on other sites

Happy2Play

I would wait for @Luketo comment but in another topic user ended up deleting library.db and starting over.

SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed

https://emby.media/community/index.php?/topic/100996-scan-library-files-failing

@cayarsdo you know if a "Check Database Integrity and Recover Database" would correct this?

 

Link to comment
Share on other sites

jonas.hansson@live.se
21 minutes ago, Happy2Play said:

I would wait for @Luketo comment but in another topic user ended up deleting library.db and starting over.


SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed

https://emby.media/community/index.php?/topic/100996-scan-library-files-failing

@cayarsdo you know if a "Check Database Integrity and Recover Database" would correct this?

 

if that is the case, then how do I delete it?   

 

Link to comment
Share on other sites

Happy2Play
1 minute ago, jonas.hansson@live.se said:

if that is the case, then how do I delete it?   

 

I am not a Android user but you would navigate to "Data path: /storage/emulated/0/Android/data/com.emby.embyserver/files/data" and rename/delete the library.db.

Note your userdata is in that database also so I would back it up to possiblely recover the userdata table to new database.

Now if you use the Server Configuration Backup plugin it is already backing up your users and userdata.

But I would still wait for DEV to comment as he may have other ideas.  As all I can show you is what other users did.

Link to comment
Share on other sites

jonas.hansson@live.se
16 minutes ago, Happy2Play said:

I am not a Android user but you would navigate to "Data path: /storage/emulated/0/Android/data/com.emby.embyserver/files/data" and rename/delete the library.db.

Note your userdata is in that database also so I would back it up to possiblely recover the userdata table to new database.

Now if you use the Server Configuration Backup plugin it is already backing up your users and userdata.

But I would still wait for DEV to comment as he may have other ideas.  As all I can show you is what other users did.

Thank you, I will...

 

Link to comment
Share on other sites

6 hours ago, Happy2Play said:

I would wait for @Luketo comment but in another topic user ended up deleting library.db and starting over.


SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed

https://emby.media/community/index.php?/topic/100996-scan-library-files-failing

@cayarsdo you know if a "Check Database Integrity and Recover Database" would correct this?

 

I don't think so.  I believe this is a bug in the Android Server as a few Shield TV users have reported this.

Seems to show it's head when removing rows from the database.

Link to comment
Share on other sites

Happy2Play
2 minutes ago, cayars said:

I don't think so.  I believe this is a bug in the Android Server as a few Shield TV users have reported this.

Seems to show it's head when removing rows from the database.

Yes as the log shows removing a Series from the database at that time.  But need @Luketo comment on whether this is recoverable or needs to start a new database.

Link to comment
Share on other sites

jonas.hansson@live.se
4 hours ago, Happy2Play said:

Yes as the log shows removing a Series from the database at that time.  But need @Luketo comment on whether this is recoverable or needs to start a new database.

lets wait for @Luke to have a say in this!  

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
masterjay
On 10/2/2021 at 5:53 PM, Luke said:

We are looking into this issue on Android. Thanks.

Hey Luke... Any news on this one?

Hoping for some good news

Edited by masterjay
Link to comment
Share on other sites

LordRunningClam

Hello!
I am having a similar issue.

I’m running an Emby server on an Nvidia Shield with a 5tb USB Hd for storage. When I did the initial Emby setup last weekend, everything scanned fine.

Today I manually added some TV Shows and Movie files. The TV Shows scanned fine, but the new movie files will not appear, and the server keeps saying the scan failed. 
 

I have attached the server log file below.

Any help is appreciated- thanks!

embyserver.txt

Edited by LordRunningClam
Link to comment
Share on other sites

Happy2Play
4 minutes ago, LordRunningClam said:

Hello!
I am having a similar issue.

I’m running an Emby server on an Nvidia Shield with a 5tb USB Hd for storage. When I did the initial Emmy setup last weekend, everything scanned fine.

Today I manually added some TV Shows and Movie files. The TV Shows scanned fine, but the new movie files will not appear, and the server keeps saying the scan failed. 
 

I have attached the server log file below.

Any help is appreciated- thanks!

embyserver.txt 21.25 kB · 0 downloads

Unfortunately there is a issue with this platform and removing items from the database, it appears to corrupt the database throwing "Constraint: FOREIGN KEY constraint failed".

 

Spoiler

2021-10-19 19:49:24.914 Debug TaskManager: Executing Scan media library
2021-10-19 19:49:24.915 Info Server: http/1.1 Response 204 to 192.168.0.100. Time: 3ms. http://192.168.0.214:8096/emby/ScheduledTasks/Running/6330ee8fb4a957f33981f89aa78b030f?X-Emby-Client=Emby Web&X-Emby-Device-Name=Safari&X-Emby-Device-Id=f5cd1c11-74dd-4b81-b2dc-159cb6627dec&X-Emby-Client-Version=4.6.4.0


2021-10-19 19:49:34.955 Debug BaseItem: Removed item: /storage/6027-F31F/Movies/Friday the 13th
2021-10-19 19:49:34.955 Info App: Removing item from database, Type: Folder, Name: Friday the 13th, Path: /storage/6027-F31F/Movies/Friday the 13th, Id: 2008

2021-10-19 19:49:34.957 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/eb/eb18bda8d27844404eb1ca45084bf903
2021-10-19 19:49:34.957 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/35/35526985cf8fa9dd59ba38878770aa36
2021-10-19 19:49:34.957 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/12/1228dd01d80ea7274d156410807dca51
2021-10-19 19:49:34.957 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/72/726e48f85dc2d641fa5e62f5a7ddbc8d
2021-10-19 19:49:34.975 Error TaskManager: Error
    *** Error Report ***
    Version: 4.6.4.0
    Command line: /data/app/com.emby.embyserver-RviI1Q-L5cE50X-DcTVV_A==/base.apk
    Operating system: Android 9 (REL) SDK:P BuildId:PPR1.180610.011  Incremental:4079208_2740.7538 Patch-Level: 2021-04-05
    Framework: Mono 6.12.0 (2020-02/5e9cb6d1c1d) 4.0.50524.0
    OS/Process: Arm64/Arm64
    Runtime: mscorlib.dll
    Processor count: 4
    Data path: /storage/emulated/0/Android/data/com.emby.embyserver/files
    Application path: /data/user/0/com.emby.embyserver
    Fingerprint: NVIDIA/darcy/darcy:9/PPR1.180610.011/4079208_2740.7538:user/release-keys
    Model: SHIELD Android TV - NVIDIA/NVIDIA
    Hardware: darcy/darcy/darcy/darcy
    SupportedAbis: arm64-v8a, armeabi-v7a, armeabi
    SQLitePCL.pretty.SQLiteException: Constraint: FOREIGN KEY constraint failed
    SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
      at SQLitePCL.pretty.SQLiteException.CheckOk (SQLitePCLEx.sqlite3 db, System.Int32 rc) [0x00017] in <1319f47a49f34f6db3822eb2e43ff130>:0 
      at SQLitePCL.pretty.SQLiteException.CheckOk (SQLitePCLEx.sqlite3_stmt stmt, System.Int32 rc) [0x00006] in <1319f47a49f34f6db3822eb2e43ff130>:0 
      at SQLitePCL.pretty.StatementImpl.MoveNext () [0x0004a] in <1319f47a49f34f6db3822eb2e43ff130>:0 
      at Emby.Server.Implementations.Data.SqliteItemRepository.ExecuteWithStringFormatParam (SQLitePCL.pretty.IDatabaseConnection db, System.String query, System.String valueText, System.Int64[] values) [0x00034] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItemsInTransaction (SQLitePCL.pretty.IDatabaseConnection db, System.Int64[] ids, System.Boolean supportsPeople, System.Boolean supportsChapters, System.Boolean supportsCollections, System.Boolean supportsMediaStreams, System.Boolean supportsListItems, System.Boolean supportsExternalDatabases) [0x00114] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItemsInChunks (System.Int64[] ids, SQLitePCL.pretty.IDatabaseConnection db, System.Boolean supportsPeople, System.Boolean supportsChapters, System.Boolean supportsCollections, System.Boolean supportsMediaStreams, System.Boolean supportsListItems, System.Boolean supportsExternalDatabases) [0x00027] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItems (System.Int64[] ids) [0x00048] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.Data.SqliteItemRepository.DeleteItems (MediaBrowser.Controller.Entities.BaseItem[] items) [0x0002b] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.Library.LibraryManager.DeleteItem (MediaBrowser.Controller.Entities.BaseItem item, MediaBrowser.Controller.Library.DeleteOptions options, MediaBrowser.Controller.Entities.BaseItem parent, System.Boolean notifyParentItem) [0x00265] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken, System.Boolean recursive, System.Boolean refreshChildMetadata, MediaBrowser.Controller.Providers.MetadataRefreshOptions refreshOptions, MediaBrowser.Controller.Providers.IDirectoryService directoryService) [0x0022e] in <42f6882bd6d34115bbdd5b6f8b48c222>:0 
      at MediaBrowser.Controller.Entities.Folder.ValidateSubFolders (MediaBrowser.Controller.Entities.BaseItem[] children, MediaBrowser.Controller.Providers.IDirectoryService directoryService, System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken) [0x0013f] in <42f6882bd6d34115bbdd5b6f8b48c222>:0 
      at MediaBrowser.Controller.Entities.Folder.ValidateChildrenInternal (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken, System.Boolean recursive, System.Boolean refreshChildMetadata, MediaBrowser.Controller.Providers.MetadataRefreshOptions refreshOptions, MediaBrowser.Controller.Providers.IDirectoryService directoryService) [0x00395] in <42f6882bd6d34115bbdd5b6f8b48c222>:0 
      at Emby.Server.Implementations.Library.LibraryManager.PerformLibraryValidation (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken) [0x0014a] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal (System.IProgress`1[T] progress, System.Threading.CancellationToken cancellationToken) [0x00092] in <05979d9270ab4dafac52ba5587e41c17>:0 
      at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal (MediaBrowser.Model.Tasks.TaskOptions options) [0x001b0] in <05979d9270ab4dafac52ba5587e41c17>:0 
    Source: mscorlib
    TargetSite: Void Throw()
    
2021-10-19 19:49:34.976 Debug TaskManager: Scan media library Failed after 0 minute(s) and 10 seconds

@Luke @cayarsIs the only recourse a new database?

Link to comment
Share on other sites

LordRunningClam

Thanks for the fast reply.

A follow up question - how did I trigger the issue when I only added files, and didn’t remove any?

What do you suggest as a path forward from here?

Just don’t tell me to go back to Plex - I can’t live like that anymore.

 

Link to comment
Share on other sites

Happy2Play
Just now, LordRunningClam said:

Thanks for the fast reply.

A follow up question - how did I trigger the issue when I only added files, and didn’t remove any?

What do you suggest as a path forward from here?

Just don’t tell me to go back to Plex - I can’t live like that anymore.

 

As Luke mentioned above this is a defect they are looking into.  But not entirely sure why Emby thinks media "Friday the 13th" for example needed removed from the database.

My current understanding is you would have to build a new database, but with this issue it is bound to happen again.  Unless Luke or Cayars knows how to fix the current database.

Link to comment
Share on other sites

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