Jump to content

Nvidia Shield server unsuccesful scan


prunhardt

Recommended Posts

RangerdangerOss

I have the same problem on the shield.

I tried to do the following:

1-TV Series with 10 episodes

2-Delete 9 episodes and the scan works fine

3-Delete the last episode the scan fails

4-Put back one episode the scan works ok again

5-No problem if I delete a movie

Regards

 

Link to comment
Share on other sites

On 7/17/2021 at 10:52 AM, RangerdangerOss said:

I have the same problem on the shield.

I tried to do the following:

1-TV Series with 10 episodes

2-Delete 9 episodes and the scan works fine

3-Delete the last episode the scan fails

4-Put back one episode the scan works ok again

5-No problem if I delete a movie

Regards

 

Hi @RangerdangerOss, what do you mean by the scan failed?

Link to comment
Share on other sites

RangerdangerOss
11 hours ago, Luke said:

Hi @RangerdangerOss, what do you mean by the scan failed?

Sorry, I was thinking this was clear. The scan aborts and you get all the sqllite errors: I get this after deleting a directory with TV-Series. When I put back the directory the scan runs fine again. I found a workaround by generating the NFO files when scanning my library and when I only delete the *.mkv files the scan keeps working. You need to have a season.nfo file and a tvshow.nfo file. The series will still show in your library but will be marked as "Watched"

Removing a directory with a movie works fine.

 

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

Edited by RangerdangerOss
Link to comment
Share on other sites

RangerdangerOss
2 minutes ago, cayars said:

Sorry if you already answered this but what version of the Emby Server are you running?

Have you tried the first solution in this KB article?
https://support.emby.media/support/solutions/articles/44002210894-corrupt-database

It's version 4.6.4.0. That would be a miracle, delete a directory witk mkv files and the database is corrupt. Put the directory back and the database is ok 🙂 The article you are mentioning is where i started trying to solve the problem but that didn't work. I even made a complete backup of the database before deleting the directory and putting it back aftwerwords. The scan still fails. Did you try on the shield what I tried ?

Link to comment
Share on other sites

Not sure what directory you're referring to deleting but there are no directories deleted in that KB artcile.
The first step in that article is checking and removing lock file ONLY and that's all.

If there are lock files present when Emby is Shutdown you will get the sqlite errors shown in your log.

Link to comment
Share on other sites

RangerdangerOss
7 minutes ago, cayars said:

Not sure what directory you're referring to deleting but there are no directories deleted in that KB artcile.
The first step in that article is checking and removing lock file ONLY and that's all.

If there are lock files present when Emby is Shutdown you will get the sqlite errors shown in your log.

Sorry but I get the feeling you don't read my post very well. So again, I have a directory on disk with mkv files containing a TV-Series, the scan works fine. If i remove this directory, the scan fails with the sqllite errors I posted. If I put the directory back again the scan works ok. Hope you get the picture this time 🙂 

Did you try steps 1 to 5 on a shield with an external USB disk?

 

1-TV Series with 10 episodes on an external disk

2-Delete 9 episodes and the scan works fine

3-Delete the last episode the scan fails with all the sqllite messages

4-Put back one episode the scan works ok again

5-No problem if I delete a movie

Edited by RangerdangerOss
Link to comment
Share on other sites

RangerdangerOss

This time I searched the embyserver.txt file for the moment the scan fails:

 

2021-07-20 09:10:38.842 Info Server: http/1.1 Response 200 to 192.168.68.106. Time: 10ms. http://192.168.68.107:8096/emby/ScheduledTasks?IsEnabled=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome&X-Emby-Device-Id=9c1fed56-2742-4ce3-8a45-da6094a99fa8&X-Emby-Client-Version=4.6.4.0
2021-07-20 09:10:40.606 Info App: Removing item from database, Type: Series, Name: Coyote (2021), Path: /storage/5DA4-941D/NVIDIA_SHIELD/Series/Coyote, Id: 6356
2021-07-20 09:10:40.611 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/b5/b5e3d6383f6b436a74b3f52bab593f8f
2021-07-20 09:10:40.611 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/b1/b1942ca54cd1ef7861233e94f3b83ff7
2021-07-20 09:10:40.611 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/8f/8ffb1df21e9c59be7bf84b7ca42ad85b
2021-07-20 09:10:40.611 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/bf/bffdcb3206c08bb0962f2aee27f59953
2021-07-20 09:10:40.611 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/97/975730e4cf15c305ccdb4f0d94297e5e
2021-07-20 09:10:40.612 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/0a/0a698ca815e4c1bcc6232aa81c813bc0
2021-07-20 09:10:40.612 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/8f/8fb875c0c3d74c3d956b1a68136a5f47
2021-07-20 09:10:40.612 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/14/14d8d178af75af01c2164746a1343629
2021-07-20 09:10:40.639 Error TaskManager: Error
    *** Error Report ***
    Version: 4.6.4.0
    Command line: /data/app/com.emby.embyserver-jVXH5qQfQrMwOWsv6nOIOw==/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/mdarcy/mdarcy:9/PPR1.180610.011/4079208_2740.7538:user/release-keys
    Model: SHIELD Android TV - NVIDIA/NVIDIA
    Hardware: mdarcy/mdarcy/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.

Link to comment
Share on other sites

Yes I read your post and gave you the solution.  You have a corrupted database that likely needs fixing.

You're getting this foreign key error when trying to remove items but not when they are present (no need to delete database records). But regardless there is an underlying problem with your database that needs looking at/needs fixing.

Most likely to try and fix this will require the 2nd or 3rd step mentioned in the previously posted KB article but try all steps in order.

Link to comment
Share on other sites

RangerdangerOss
2 minutes ago, cayars said:

Yes I read your post and gave you the solution.  You have a corrupted database that likely needs fixing.

You're getting this foreign key error when trying to remove items but not when they are present (no need to delete database records). But regardless there is an underlying problem with your database that needs looking at/needs fixing.

Most likely to try and fix this will require the 2nd or 3rd step mentioned in the previously posted KB article but try all steps in order.

Wow, again I did everything mentioned in the article. I does not solve the problem and if it worked it would mean you can't delete anything on disk without completely redoing all the stuff mentioned in the article which would be idiot offcourse. Also just deleting one episode, two or whatever number works fine as you can see in the log file below. As long as you don't delete them all and the series. The problem exists only when you delete all episodes and the series. From my side I ask you again: did you do what I did on a Shield ?

 

2021-07-20 11:34:42.773 Info App: Removing item from database, Type: Episode, Name: Episode 1, Path: /storage/5DA4-941D/NVIDIA_SHIELD/Series/Advokaten/Seizoen 1/Advokaten.s01e01.Swedish.1080p.BluRau.DTS.x264-NDF.mkv, Id: 6872
2021-07-20 11:34:42.773 Info App: Deleting path /storage/emulated/0/Android/data/com.emby.embyserver/files/metadata/library/d2/d27e3a0621a08b508ab8c4266d3724d2

Link to comment
Share on other sites

What result did you get for the integrity check?
Was the recovered library.db file the same size as the original library.db file?
Did it pass the integrity check after doing the recovery?

Link to comment
Share on other sites

RangerdangerOss
11 minutes ago, cayars said:

What result did you get for the integrity check?
Was the recovered library.db file the same size as the original library.db file?
Did it pass the integrity check after doing the recovery?

Please stop mentioning this KB article, it did not solve the problem ok.? Yes it did pass, yes it was smaller , yes it did pass.

Why do you not anwer my question about doing this yourself on a shield tv. ????

And my last contribution: I did the following:

-remove the current emby server install and to make sure completely remove the \\192.168.68.107\internal\Android\data\com.emby.embyserver directory

-install the Emby server

-Create a directory on an external disk and put in 6 episode of a TV-Serie

-Create a library with only this one TV-Series

-Scan the library, no problem works fine

-Delete 5 episodes

-Scan again, works fine

-Delete the last episode, scan fails.

Your answer:the database is corrupt 😞 . If this is true Emby server is not usable.

 

Edited by RangerdangerOss
Link to comment
Share on other sites

Yes there is some type of corruption with at least one row of the MediaItems table to a support table.
Emby wasn't able to delete the row properly and this caused the exception to be thrown.

The only reason I've mentioned that article is the things mentioned in it historically will fix 90%+ of like problems.

Could you upload your complete server log to let us have a look at it.  Right now everything is based on log fragments which may not tell the whole story.

Link to comment
Share on other sites

RangerdangerOss
5 minutes ago, cayars said:

Yes there is some type of corruption with at least one row of the MediaItems table to a support table.
Emby wasn't able to delete the row properly and this caused the exception to be thrown.

The only reason I've mentioned that article is the things mentioned in it historically will fix 90%+ of like problems.

Could you upload your complete server log to let us have a look at it.  Right now everything is based on log fragments which may not tell the whole story.

 

embyserver (3).txt

Link to comment
Share on other sites

Thanks,  short log file with only one error being thrown but it looks like it's having an issue deleting from the transaction log file.

Could you post yesterdays log file which is hopefully bigger?
Trying to get more info.

Link to comment
Share on other sites

RangerdangerOss
2 minutes ago, cayars said:

Thanks,  short log file with only one error being thrown but it looks like it's having an issue deleting from the transaction log file.

Could you post yesterdays log file which is hopefully bigger?
Trying to get more info.

The errors in the beginning not finding the directory's is because the harddisks go to sleep.

embyserver-63762377543.txt

Link to comment
Share on other sites

Thank you.  This bigger log shows 3 "foreign key" errors tying to delete Coyote (2021) while the earlier log shows foreign key errors trying to delete The Lawyer.

So it doesn't seem like it's just one show but multiple.  You're only going to see this error in the log when trying to delete an object so we really don't know how wide spread the issue is.

Do you have your shield tv setup for remote file access so you can get to the database files easily from a PC?

 

 

Link to comment
Share on other sites

RangerdangerOss
2 hours ago, cayars said:

Thank you.  This bigger log shows 3 "foreign key" errors tying to delete Coyote (2021) while the earlier log shows foreign key errors trying to delete The Lawyer.

So it doesn't seem like it's just one show but multiple.  You're only going to see this error in the log when trying to delete an object so we really don't know how wide spread the issue is.

Do you have your shield tv setup for remote file access so you can get to the database files easily from a PC?

 

 

The coyote is not an other problem. It's just an example to create the log file I showed earlier. It happens as soon you delete a complete serie. And yes I can remotely access the database files. 

 

Edited by RangerdangerOss
Link to comment
Share on other sites

Right, so it's not just a problem with a single media file but any series.

Could we do a remote session so I can take a look at what might be causing this and see if I can fix it?

Link to comment
Share on other sites

RangerdangerOss
4 minutes ago, cayars said:

Right, so it's not just a problem with a single media file but any series.

Could we do a remote session so I can take a look at what might be causing this and see if I can fix it?

No sorry. You can try it yourself on a Nvidia Shield pro. Please let me now what happened. I will now remove the attachements if you don't mind. 

 

Link to comment
Share on other sites

OK, let us know if you change your mind as there really isn't anything we can do for you without seeing this or trying to fix the database itself which is documented in the KB article.

The solution will be one of the steps mentioned, depending on it's severity.

https://support.emby.media/support/solutions/articles/44002210894-corrupt-database

Separate solutions in that article in order to try:
DB Removal of Locks and Transactions
DB Integrity Check
DB Recovery
DB Library Reset
 

Link to comment
Share on other sites

RangerdangerOss
1 minute ago, cayars said:

OK, let us know if you change your mind as there really isn't anything we can do for you without seeing this or trying to fix the database itself which is documented in the KB article.

The solution will be one of the steps mentioned, depending on it's severity.

https://support.emby.media/support/solutions/articles/44002210894-corrupt-database

Separate solutions in that article in order to try:
DB Removal of Locks and Transactions
DB Integrity Check
DB Recovery
DB Library Reset
 

This is stupid. I told you 20 times before I did everything mentioned in the article but it does not work !!!!!!!  The solution I found is to delete all episodes but don't delete the directory structure and the nfo files. The problem is that if I delete the directory structure containing the files the scan fails. This has nothing to do with a corrupt database. But you keep mentioning this article again and again and again. Did you find something in the database I uploaded?? No response, did you try it your self on a Nvidia? No response. 

I will go back to Plex and only use Emby to populate my track collection.

Link to comment
Share on other sites

I have not seen a database you uploaded?  Where would I find this?

 

Link to comment
Share on other sites

RangerdangerOss
Just now, cayars said:

I have not seen a database you uploaded?  Where would I find this?

 

I removed it a few minutes ago. Don't bother anymore buy a Nvidia shield and try it. This way it's complete useless.

Link to comment
Share on other sites

I have a shield but just because I have one doesn't mean I'm going to have a corrupt database that needs fixing.  This can happen on any OS that runs SQLite databases.

I wish you would put as much effort into trying to follow the KB article as wanting to discuss the cause or how to work around the problem as it really would fix your problem even if you had to reset the database.  It would be impossible to have this error after completely following the steps of the article.

Just saying.

If you do change your mind the offer to do a support session with you to get the system working again stands.

Regardless all the best

Edited by cayars
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...