Jump to content

Scan media library failed latest 4.6.0.50


Recommended Posts

cappa.dot
Posted

I have been receiving this error on my DS416play for the last week while trying the last few version of the beta and now moving to the official release. Can anyone help? Scan works on the manual scan after the install but I get this email in the morning when the system generates the email error message and every manual scan after the first. 

image.thumb.png.a8c6da08769ce1e98687ae6e322e36a0.png

Scan media library failed

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.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, 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 Emby.Server.Implementations.Library.LibraryManager.ValidateTopLibraryFolders(Boolean refreshMetadatas, CancellationToken cancellationToken)
  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)

Posted

Hi there, please attach the complete emby server log. thanks.

cappa.dot
Posted

Morning Luke. Looking at the file it is looking like the database is locked. How should I proceed? @cayars

cappa.dot
Posted

I may have fixed this by setting the watchdog folder back to an original I had. I will let you know if I still have this issue tomorrow morning once the NAS starts up again.

@cayars

Posted

Let us know how you get on. Thanks.

cappa.dot
Posted

Looks like everything is working fine now. I returned the watchdog episode folder back to one I had earlier and no more errors.

Posted

Thanks for the feedback.

Carlo
Posted

Glad you got it worked out.

In case this happens to anyone else, we have added a new article to the knowledge base with a few things to do to resolve this.
https://support.emby.media/support/solutions/articles/44002210894-corrupt-database

PS I was adjusting notification settings over the weekend to stop my flood of emails and I think your "pings" got by my while I was adjusting things.  Sorry wasn't ignoring you.
Always feel free to PM me if you don't get a response in a thread.

maegibbons
Posted

Just happened to me on Windows too with latest beta

Will proceed with rebuild.

Krs

 

Mark

Posted
1 minute ago, maegibbons said:

Just happened to me on Windows too with latest beta

Will proceed with rebuild.

Krs

 

Mark

Actually you may not need that. You can probably just delete the database temp files as mentioned in cayar's link above.

maegibbons
Posted

Ok will do that 1st.

Krs

Mark

  • Thanks 1
Carlo
Posted
14 hours ago, maegibbons said:

Ok will do that 1st.

Krs

Mark

How did you make out?

cappa.dot
Posted

Does not look like the new update works and I'm still receiving errors on the database media scan. Another side effect is that it does not show any of my actors. I have deleted the db file, tried to start a fresh and also restored from a backup with no luck. It does say on one of the line that the database is locked?

embyserver (1).txt

Posted
3 hours ago, cappa.dot said:

Does not look like the new update works and I'm still receiving errors on the database media scan. Another side effect is that it does not show any of my actors. I have deleted the db file, tried to start a fresh and also restored from a backup with no luck. It does say on one of the line that the database is locked?

embyserver (1).txt 813.22 kB · 0 downloads

Hi, please go through the steps listed here:

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

And let us know if this resolves it for you. Thanks.

  • 2 weeks later...
cappa.dot
Posted

Morning @Luke. I followed the steps and it continues to fail in the morning once the NAS boots up. I leave it 15 minutes before a fresh media scan in the morning and it generates the error and it sends me an email telling me of the fail. I have renamed the DB, deleted the DB and removed the two additional files with mixed results. When I run a manual scan now it is hit or miss whether it can get to 100% or not. Would you like me to send the txt file again?

Posted
9 hours ago, cappa.dot said:

Morning @Luke. I followed the steps and it continues to fail in the morning once the NAS boots up. I leave it 15 minutes before a fresh media scan in the morning and it generates the error and it sends me an email telling me of the fail. I have renamed the DB, deleted the DB and removed the two additional files with mixed results. When I run a manual scan now it is hit or miss whether it can get to 100% or not. Would you like me to send the txt file again?

Hi, yes please that would be great, thanks.

Happy2Play
Posted
22 minutes ago, Finlay said:

Thank you for taking a look

embyserver.txt 1021.21 kB · 0 downloads

You have a locked database. 

SQLitePCL.pretty.SQLiteException: Busy: database is locked

please follow the steps in the KB for a locked database.

Database Issues : Emby

cappa.dot
Posted

@Happy2Play thank you for the advice. I have tried many of the things on the site to unlock the DB and it works until the next day and locks again. The only thing I did not try is the section about downloading the sqlite editor and running an integrity check. I will try that next.

Happy2Play
Posted
1 minute ago, cappa.dot said:

@Happy2Play thank you for the advice. I have tried many of the things on the site to unlock the DB and it works until the next day and locks again. The only thing I did not try is the section about downloading the sqlite editor and running an integrity check. I will try that next.

That does not make any since as once Emby starts and has control of the database and it is locked to that session.  Now if Emby is restarting then sure this could be possible as the previous session not shutting down properly leaving a locked database.

cappa.dot
Posted

I think he might have hit the nail on the head with the shutdown comment. My server turns off at about midnight every night and then when it starts up in the first thing in the morning I normally encounter errors. If I manually restart or shut down the server from within Emby then I don’t have these errors when I start up again. 

Happy2Play
Posted
1 hour ago, cappa.dot said:

I think he might have hit the nail on the head with the shutdown comment. My server turns off at about midnight every night and then when it starts up in the first thing in the morning I normally encounter errors. If I manually restart or shut down the server from within Emby then I don’t have these errors when I start up again. 

How are you shutting down your server at night?

cappa.dot
Posted

I use the Synology schedule to shut down and startup. For years it's always managed to do this without issue. Recent updates have generated this locked DB.

Happy2Play
Posted

@cayarsare you seeing any issue with Emby database with shutdown and startup?

@cappa.dotare you able to check and see if the database remains open (the shm and wal files remain) when your task shuts down Emby?  But I guess the question is how is the Synology task shutting down Emby?

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