Jump to content

Not saving any changes to database


Go to solution Solved by Happy2Play,

Recommended Posts

Posted

In the last 24 hours my server has stopped saving anything relevant - media play state, changes to media metadata, changes to library itself in the server dashboard. I followed the steps to fix a corrupted library (https://support.emby.media/support/solutions/articles/44002210894-corrupt-database) and scanned my database file and it says its OK.

Do I need to delete the library database altogether by deleting the library.db file? If so, will this mean I will have to rebuild my libraries from scratch? If so, I'd rather not do that. Other solutions?

LMK if you need a log file.

Cheers.

Posted

Hi, Did you have the SQLite error in your Emby Server?

Can you upload your current server log file so we can take a look at it?

Posted

There is an SQL error related to scanning the library. Here is the entire log file.

embyserver.txt

  • Solution
Happy2Play
Posted
16 minutes ago, AEJ said:

There is an SQL error related to scanning the library. Here is the entire log file.

embyserver.txt 168.01 kB · 0 downloads

Yes you have a locked database.

Busy: database is locked

Please follow the section to remove database lock.

https://support.emby.media/support/solutions/articles/44002210894

But this happens when previous Emby session did not shutdown properly.  The database remains open and the new session can not take control.

 

Posted (edited)

Yes you have the SQLitePCL.pretty.SQLiteException errors in your log.

That would likely indicate you have a locked database from somehow running two versions of Emby.

Completely stop Emby. Check to make sure no Emby tasks are running and follow the directions in the above link to remove the 2 lock files.

Edited by cayars
Spaceboy
Posted

i've also had this twice recently. i see recent complaints about it on both Synology and Linux OS's. I think you need to start accepting that a systemic problem was built into emby at the last major update. no-one is running two versions of emby. please stop offering it as a potential explanation

  • Like 2
Happy2Play
Posted (edited)

It is a shutdown issue as the first instance did not shut down the database properly for some reason and the second/next start is unable to take control of the database.  So yes the explanation is somewhat correct.

Edited by Happy2Play
Posted

So I did everything in that KB multiple times, and for whatever reason on the 6th or 7th time it worked. Strange. I did have several power outages in the last few days, and while I have a UPS, that may be the culprit.

Thanks again for the prompt help. I am always impressed by the support I get here, FWIW.

  • Thanks 1
Posted
1 hour ago, Spaceboy said:

i've also had this twice recently. i see recent complaints about it on both Synology and Linux OS's. I think you need to start accepting that a systemic problem was built into emby at the last major update. no-one is running two versions of emby. please stop offering it as a potential explanation

Oh most certainly it was introduced in 4.6, but we haven't found the cause yet. We originally thought it might be caused by something else but that has proved wrong. This is one of those situations that's hard to reproduce.

I've only seen it once personally on my own servers (running 4 at present) so I haven't been able to find anything useful on my systems.  Seen it on a few machines I've remoted into however.

It's definitely something we are trying to find/fix so any helpful info about how it manifests itself on your (anyone's) system would be helpful!

Spaceboy
Posted

for me, i don't think either time i shut down improperly. nothing specific i can recall.

i still have this ongoing issue where i can't update emby without restarting the machine as the system folder gets locked but i've been experiencing that for around a year and this latest problem only since 4.6.

now i know what it is, i'll try and keep more of an eye out if it recurs

Posted

I've had files locked as well trying to update on Windows (not Synology) but found believe it or not having multiple Emby tabs open in a browser was the culprit for me.
I think it happens for other reasons as well and could be related???

Frustrating when you can't easily narrow stuff like this down!

If you can try keeping an eye on what tasks Emby wise are running when you see a lock that would be great. The one time I saw this on my system I had 1 EmbyServer running but 2 EmbyTray running. When I killed the extra running program after shutting down it cleared the clocks for me.

GrimReaper
Posted

Jumping in on the "SQLitePCL.pretty.SQLiteException" wagon as well, just occurred few minutes ago - out of the blue, there was no activity on the server neither was I shutting it down (or shutting down PC, for that matter), at some point it just become unresponsive, i.e. indefinite spinning circle in Web app. Log attached. 

 

embyserver.txt

Happy2Play
Posted
4 minutes ago, GrimReaper76 said:

Jumping in on the "SQLitePCL.pretty.SQLiteException" wagon as well, just occurred few minutes ago - out of the blue, there was no activity on the server neither was I shutting it down (or shutting down PC, for that matter), at some point it just become unresponsive, i.e. indefinite spinning circle in Web app. Log attached. 

 

embyserver.txt 444.76 kB · 0 downloads

Can you post the previous server log.

Happy2Play
Posted
8 minutes ago, GrimReaper76 said:

Jumping in on the "SQLitePCL.pretty.SQLiteException" wagon as well, just occurred few minutes ago - out of the blue, there was no activity on the server neither was I shutting it down (or shutting down PC, for that matter), at some point it just become unresponsive, i.e. indefinite spinning circle in Web app. Log attached. 

 

embyserver.txt 444.76 kB · 0 downloads

Actually you have a different issue.  Not positive on this one but believe there are other topics "SQLitePCL.pretty.SQLiteException: Error: cannot rollback - no transaction is active", will look.

2021-06-16 12:05:47.354 Error Server: Error processing request
	*** Error Report ***
	Version: 4.6.2.0
	Command line: C:\Users\olegt\AppData\Roaming\Emby-Server\system\EmbyServer.dll
	Operating system: Microsoft Windows 10.0.19042
	Framework: .NET Core 3.1.13
	OS/Process: x64/x64
	Runtime: C:/Users/olegt/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 8
	Data path: C:\Users\olegt\AppData\Roaming\Emby-Server\programdata
	Application path: C:\Users\olegt\AppData\Roaming\Emby-Server\system
	SQLitePCL.pretty.SQLiteException: Error: cannot rollback - no transaction is active
	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 SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, ReadOnlySpan`1 sqlUtf8)
	   at SQLitePCL.pretty.DatabaseConnection.RollbackTransaction(IDatabaseConnection This)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.Update(AuthenticationInfo info)
	   at Emby.Server.Implementations.HttpServer.Security.AuthorizationContext.GetAuthorization(IRequest httpReq)
	   at Emby.Server.Implementations.HttpServer.Security.AuthorizationContext.GetAuthorizationInfo(IRequest requestContext)
	   at Emby.Server.Implementations.HttpServer.Security.AuthService.Authenticate(IRequest request, IAuthenticationAttributes authAttribtues, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.ApplyRequestFilters(IRequest req, IResponse res, Object requestDto, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: SQLitePCL.pretty
	TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)

 

  • Thanks 1
Happy2Play
Posted

@cayarshave you dealt with this error?

SQLitePCL.pretty.SQLiteException: Error: cannot rollback - no transaction is active

 

GrimReaper
Posted

Thanks, but have no idea what might have caused it nor what should I do to prevent it happening again, this happens 2-3 times a week since upgrading to 4.6.2.0., server unresponsive. 

Posted
12 minutes ago, Happy2Play said:

@cayarshave you dealt with this error?


SQLitePCL.pretty.SQLiteException: Error: cannot rollback - no transaction is active

 

Likely because the database is locked which would make it impossible to apply or rollback a transaction.
I'd shut down Emby Server and check for the 2 lock files on the library.db.

Happy2Play
Posted
2 minutes ago, cayars said:

Likely because the database is locked which would make it impossible to apply or rollback a transaction.
I'd shut down Emby Server and check for the 2 lock files on the library.db.

This happened almost 11 hours into the active log though.

Posted

Yep, your right Happy2Play, which makes it even more interesting.

@GrimReaper76 do you have any entries that fired related to Emby in your Task Scheduler for:
2021-06-16 12:01
to
2021-06-16 12:05

?

GrimReaper
Posted

Nope, majority of my tasks is run manually, those few automatic ones run overnight. 

Posted

Just to be clear I'm talking about OS Scheduled Tasks not those inside Emby.

GrimReaper
Posted

I have no Emby-related scheduled tasks at all. 

Posted

You're not assuming but checked?
Emby creates these for scheduling.

GrimReaper
Posted

I was assuming, as I've never made any For Emby myself, but upon checking, still cannot find single Emby-created task, where would that instance be?

132244725_Screenshot2021-06-16153817.thumb.png.902e939183b160f30c0a51ac2539f9f4.png

 

  • Thanks 1
Posted

That is where they would be.  Here's an example
image.png.6a745d098f084a31f0bd34235ce4472a.png

  • Thanks 1

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