Jump to content

[Bug] Can't log in during media scan due to database lock


wintrmute
 Share

Recommended Posts

I've found a bug in Emby.

If the server is busy running a big media scan (eg. due to recent new setup) then logins fail, with errors logged about the database being locked.

Emby version: 3.1.239~beta-1728.1

OS version: Ubuntu 16.04 LTS

 

EDIT: Actually, even after the media scan finished (after 45 minutes), I still received the same errors when trying to log in.

Restarting the emby-server service fixed it though.

Still, not a good first experience on a new install.

2016-11-29 14:08:16.2498 Info HttpServer: HTTP POST http://10.23.1.1:8096/emby/Users/authenticatebyname. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36
2016-11-29 14:08:16.3768 Info UserManager: Authentication request for Toby has succeeded.
2016-11-29 14:08:16.3827 Error HttpServer: Error processing request
    *** Error Report ***
    Version: 3.1.239.0
    Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe -restartpath /usr/lib/emby-server/restart.sh
    Operating system: Unix 4.4.0.47
    64-Bit OS: True
    64-Bit Process: True
    Mono: 4.6.2 (Stable 4.6.2.7/08fd525 Mon Nov 28 20:49:26 UTC 2016)
    Processor count: 2
    Program data path: /var/lib/emby-server
    Application directory: /usr/lib/emby-server/bin
    System.Threading.LockRecursionException: Write lock may not be acquired with read lock held. This pattern is prone to deadlocks. Please ensure that read locks are released before taking a write lock. If an upgrade is necessary, use an upgrade lock in place of the read lock.
      at System.Threading.ReaderWriterLockSlim.TryEnterWriteLockCore (System.Threading.ReaderWriterLockSlim+TimeoutTracker timeout) [0x00084] in <63992662b765477a898ef49cdcc99ee2>:0
      at System.Threading.ReaderWriterLockSlim.TryEnterWriteLock (System.Threading.ReaderWriterLockSlim+TimeoutTracker timeout) [0x00002] in <63992662b765477a898ef49cdcc99ee2>:0
      at System.Threading.ReaderWriterLockSlim.TryEnterWriteLock (System.Int32 millisecondsTimeout) [0x00007] in <63992662b765477a898ef49cdcc99ee2>:0
      at System.Threading.ReaderWriterLockSlim.EnterWriteLock () [0x00000] in <63992662b765477a898ef49cdcc99ee2>:0
      at Emby.Server.Implementations.Data.ReaderWriterLockSlimExtensions+WriteLockToken..ctor (System.Threading.ReaderWriterLockSlim sync) [0x0000d] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Data.ReaderWriterLockSlimExtensions.Write (System.Threading.ReaderWriterLockSlim obj) [0x00000] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Data.BaseSqliteRepository.CreateConnection (System.Boolean isReadOnly) [0x0010b] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Security.AuthenticationRepository.Get (MediaBrowser.Controller.Security.AuthenticationInfoQuery query) [0x0001d] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Session.SessionManager+<GetAuthorizationToken>c__async10.MoveNext () [0x00063] in <69467851aade41f1b491a89f8308d1c2>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at Emby.Server.Implementations.Session.SessionManager+<AuthenticateNewSessionInternal>c__asyncF.MoveNext () [0x0030b] in <69467851aade41f1b491a89f8308d1c2>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at MediaBrowser.Api.UserService+<Post>c__async1.MoveNext () [0x00128] in <c6cb9d7664c2483ba15afecf7107d9f7>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at ServiceStack.Host.ServiceExecGeneral+<Execute>c__async0.MoveNext () [0x00185] in <caa4e1a3c63c489aa524350bc5d2c931>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at ServiceStack.Host.ServiceController+<Execute>c__async0.MoveNext () [0x00142] in <caa4e1a3c63c489aa524350bc5d2c931>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at ServiceStack.Host.RestHandler+<ProcessRequestAsync>c__async1.MoveNext () [0x00167] in <caa4e1a3c63c489aa524350bc5d2c931>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at Emby.Server.Implementations.HttpServer.HttpListenerHost+<RequestHandler>c__async0.MoveNext () [0x0065d] in <69467851aade41f1b491a89f8308d1c2>:0
    System.Threading.LockRecursionException
      at System.Threading.ReaderWriterLockSlim.TryEnterWriteLockCore (System.Threading.ReaderWriterLockSlim+TimeoutTracker timeout) [0x00084] in <63992662b765477a898ef49cdcc99ee2>:0
      at System.Threading.ReaderWriterLockSlim.TryEnterWriteLock (System.Threading.ReaderWriterLockSlim+TimeoutTracker timeout) [0x00002] in <63992662b765477a898ef49cdcc99ee2>:0
      at System.Threading.ReaderWriterLockSlim.TryEnterWriteLock (System.Int32 millisecondsTimeout) [0x00007] in <63992662b765477a898ef49cdcc99ee2>:0
      at System.Threading.ReaderWriterLockSlim.EnterWriteLock () [0x00000] in <63992662b765477a898ef49cdcc99ee2>:0
      at Emby.Server.Implementations.Data.ReaderWriterLockSlimExtensions+WriteLockToken..ctor (System.Threading.ReaderWriterLockSlim sync) [0x0000d] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Data.ReaderWriterLockSlimExtensions.Write (System.Threading.ReaderWriterLockSlim obj) [0x00000] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Data.BaseSqliteRepository.CreateConnection (System.Boolean isReadOnly) [0x0010b] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Security.AuthenticationRepository.Get (MediaBrowser.Controller.Security.AuthenticationInfoQuery query) [0x0001d] in <69467851aade41f1b491a89f8308d1c2>:0
      at Emby.Server.Implementations.Session.SessionManager+<GetAuthorizationToken>c__async10.MoveNext () [0x00063] in <69467851aade41f1b491a89f8308d1c2>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at Emby.Server.Implementations.Session.SessionManager+<AuthenticateNewSessionInternal>c__asyncF.MoveNext () [0x0030b] in <69467851aade41f1b491a89f8308d1c2>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at MediaBrowser.Api.UserService+<Post>c__async1.MoveNext () [0x00128] in <c6cb9d7664c2483ba15afecf7107d9f7>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at ServiceStack.Host.ServiceExecGeneral+<Execute>c__async0.MoveNext () [0x00185] in <caa4e1a3c63c489aa524350bc5d2c931>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at ServiceStack.Host.ServiceController+<Execute>c__async0.MoveNext () [0x00142] in <caa4e1a3c63c489aa524350bc5d2c931>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at ServiceStack.Host.RestHandler+<ProcessRequestAsync>c__async1.MoveNext () [0x00167] in <caa4e1a3c63c489aa524350bc5d2c931>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
      at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
      at Emby.Server.Implementations.HttpServer.HttpListenerHost+<RequestHandler>c__async0.MoveNext () [0x0065d] in <69467851aade41f1b491a89f8308d1c2>:0

Edited by wintrmute
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
 Share

×
×
  • Create New...