Jump to content

Recommended Posts

Misinthe
Posted

Good afternoon everyone, I have been getting fail errors when Emby tries to scan the libraries for new or modified files. I'm not sure what's going on. Sometimes it works after I reboot the whole server (the actual windows machine) but then it breaks down again.

New Media Notification Fail:

The process cannot access the file 'C:\Users\miky_\AppData\Roaming\Emby-Server\programdata\config\playback_reporting.xml' because it is being used by another process.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Emby.Server.Implementations.Serialization.MyXmlSerializer.SerializeToFile(Object obj, String file)
at Emby.Server.Implementations.AppBase.BaseConfigurationManager.SaveConfiguration(String key, Object configuration)
at playback_reporting.Tasks.TaskNotifictionMediaReport.Execute(CancellationToken cancellationToken, IProgress`1 progress)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)

Scan Media Library Fail:

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

 

Happy2Play
Posted

Your server log will show more on the sql error but more then likely it is the database locked.  Please follow the sets in that KB for the error that you have.

Misinthe
Posted
1 hour ago, ebr said:

 

5 minutes ago, Happy2Play said:

Your server log will show more on the sql error but more then likely it is the database locked.  Please follow the sets in that KB for the error that you have.

I did the delete library.db-shm & library.db-wal steps and it seems to be working, altough, I wanted to check the DB integrity just in case, and I get the next error.

DB.PNG.12a570db205083fd254a01dd667e268d.PNG

Happy2Play
Posted
1 minute ago, Misinthe said:

 

I did the delete library.db-shm & library.db-wal steps and it seems to be working, altough, I wanted to check the DB integrity just in case, and I get the next error.

DB.PNG.12a570db205083fd254a01dd667e268d.PNG

You need to shutdown Emby to open the database in another program.

Misinthe
Posted
8 minutes ago, Happy2Play said:

You need to shutdown Emby to open the database in another program.

Thank you, looks like the DB is good, so hopefully the file removal fixed it. Thank you for your help!Results.PNG.09213224fa4bf94be92d69f0ff7b2dd4.PNG

  • Like 1
Posted

Let us know how you get on. Thanks.

Misinthe
Posted
3 hours ago, Luke said:

Let us know how you get on. Thanks.

What do you mean? I'm running it on a Windows 10 Pro dedicated machine, I remote into that machine from my personal one and then right click on the Emby Server in the system tray and "Configure Emby". 

Posted

"Let us know how you get on. Thanks."
Luke just means

Let us know how you make out in a couple of days.

Misinthe
Posted
2 minutes ago, cayars said:

"Let us know how you get on. Thanks."
Luke just means

Let us know how you make out in a couple of days.

Oh Haha, okay. I'll give an update next week! 

Happy2Play
Posted

🙂To me the topic was resolved, but yes it would appear Luke was looking for a follow up as this database locking is still a mystery.

Misinthe
Posted
19 hours ago, Luke said:

Let us know how you get on. Thanks.

 

15 hours ago, Happy2Play said:

🙂To me the topic was resolved, but yes it would appear Luke was looking for a follow up as this database locking is still a mystery.

So, yesterday it was working fine after I deleted the files, I woke up this morning and I have the same issue again and now even more, I have a new issue that was not happening yesterday, it is not saving what we watch, like, I went on and started my show where it was saved from last night, I watched 3 episodes, closed it down, then I went back in to continue and it did not recognize I watched anything this morning, it's set back to how it was last night. I've tried manually doing the "Watched" checkmark on the episodes and it gets marked, then when I go home and back in it's like nothing happened.

Misinthe
Posted
On 11/06/2021 at 14:27, Luke said:

Let us know how you get on. Thanks.

 

21 hours ago, Happy2Play said:

🙂To me the topic was resolved, but yes it would appear Luke was looking for a follow up as this database locking is still a mystery.

So I tried doing the fix from the Corrupt Database steps and the library.db-shm & library.db-wal are not there anymore, so I can't delete them. How can I fix it now? I ran the command to check integrity and it said the DB was ok and no errors reported.

Here's the log file, maybe that helps a little more.

 

embyserver.txt

Happy2Play
Posted
2 minutes ago, Misinthe said:

 

So I tried doing the fix from the Corrupt Database steps and the library.db-shm & library.db-wal are not there anymore, so I can't delete them. How can I fix it now? I ran the command to check integrity and it said the DB was ok and no errors reported.

Here's the log file, maybe that helps a little more.

 

embyserver.txt 978.91 kB · 0 downloads

But this log shows a Locked Database.

Busy: database is locked

@cayarsCan the KB have a different title as it covers more then just Corrupt database, say to something like Database Issues.  As a locked database is not a corrupt database.

Misinthe
Posted
4 minutes ago, Happy2Play said:

But this log shows a Locked Database.


Busy: database is locked

@cayarsCan the KB have a different title as it covers more then just Corrupt database, say to something like Database Issues.  As a locked database is not a corrupt database.

I just ran it again and I keep getting an OK restult. Should I do the Steps to Reset Library Database & Load Fresh?

image.png.b48e413f1e213ee8f1a2d7c6760c90fe.png

 

Posted
7 minutes ago, Happy2Play said:

@cayarsCan the KB have a different title as it covers more then just Corrupt database, say to something like Database Issues.  As a locked database is not a corrupt database.

If I were to change the title in anyway it would break all links to it unfortunately.

2 minutes ago, Misinthe said:

I just ran it again and I keep getting an OK restult. Should I do the Steps to Reset Library Database & Load Fresh?

Can you try a new full library scan and upload a new server log if it fails?

Happy2Play
Posted

The integrity check really has nothing to do with a Locked database.

The database lock represents a improper Emby shutdown so previous instance did not close its database lock and a new instance can not work properly do to the database already being locked.

Misinthe
Posted
3 minutes ago, cayars said:

If I were to change the title in anyway it would break all links to it unfortunately.

Can you try a new full library scan and upload a new server log if it fails?

I did one right before I uploaded that one, but yes, here you go, freshly scanned error.

 

embyserver.txt

Misinthe
Posted
2 minutes ago, Happy2Play said:

The integrity check really has nothing to do with a Locked database.

The database lock represents a improper Emby shutdown so previous instance did not close its database lock and a new instance can not work properly do to the database already being locked.

Oh, I see, I did have a power loss the other day due to a thunderstorm, and the server shut down abruptly.

Happy2Play
Posted
1 minute ago, Misinthe said:

I did one right before I uploaded that one, but yes, here you go, freshly scanned error.

 

embyserver.txt 67.72 kB · 0 downloads

So if you shutdown Emby do the shm and wal files remain?

Posted

The errors are still in your log file.

What you might want to try is shutting down Emby, clearing the 2 lock files.

Then reboot the machine and start fresh.

Let us know how that goes.

Also do me a favor.  If you see the error in the log take a look at task manage and let us know what "Emby" processes are running.

Misinthe
Posted
3 minutes ago, Happy2Play said:

So if you shutdown Emby do the shm and wal files remain?

Yes, they're there.

 

3 minutes ago, cayars said:

The errors are still in your log file.

What you might want to try is shutting down Emby, clearing the 2 lock files.

Then reboot the machine and start fresh.

Let us know how that goes.

Also do me a favor.  If you see the error in the log take a look at task manage and let us know what "Emby" processes are running.

By the 2 lock files, you mean the shm and wal? There was a second Emby service running but I Force Closed it yesterday.

Happy2Play
Posted

I see you are running as a "-service", is "run at startup" enabled also? Dashboard-Settings.

1 minute ago, Misinthe said:

Yes, they're there.

 

By the 2 lock files, you mean the shm and wal? There was a second Emby service running but I Force Closed it yesterday.

When you shutdown Emby those files should not exist.  So you may have to delete them again.

Misinthe
Posted
4 minutes ago, Happy2Play said:

I see you are running as a "-service", is "run at startup" enabled also? Dashboard-Settings.

When you shutdown Emby those files should not exist.  So you may have to delete them again.

I'm sorry, they were there because I had the DB Browser with the Library DB open, they went away when I closed the program.

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