Jump to content

[Docker] Database locked resulting in Emby not running


fredflix
Go to solution Solved by Luke,

Recommended Posts

fredflix

My container became unresponsive to the point where I couldn't even kill it (not sure what caused it).
A server reboot let me delete and relaunch the container.
However, while the container is still running, Emby isn't. Something to do with sqlite? I'm not sure.
The log below just keeps looping over and over.

Info Main: Emby
	Command line: /app/emby/EmbyServer.dll -programdata /config -ffdetect /app/emby/ffdetect -ffmpeg /app/emby/ffmpeg -ffprobe /app/emby/ffprobe -restartexitcode 3
	Operating system: Linux version 5.10.0-18-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1
	Framework: .NET 6.0.8
	OS/Process: x64/x64
	Runtime: app/emby/System.Private.CoreLib.dll
	Processor count: 12
	Data path: /config
	Application path: /app/emby
Info Main: Logs path: /config/logs
Info Main: Cache path: /config/cache
Info Main: Internal metadata path: /config/metadata
Info Main: Transcoding temporary files path: /config/transcoding-temp
Info App: Application version: 4.7.8.0
Info App: Loading assemblies
Info App: File /config/plugins/Fanart.dll has version 1.0.13.0
Info App: File /app/emby/plugins/Fanart.dll has version 1.0.13.0
Info App: File /config/plugins/MovieDb.dll has version 1.6.2.0
Info App: File /app/emby/plugins/MovieDb.dll has version 1.6.2.0
Info App: File /config/plugins/EmbyGuideData.dll has version 1.0.7.0
Info App: File /app/emby/plugins/EmbyGuideData.dll has version 1.0.7.0
Info App: File /config/plugins/Tvdb.dll has version 1.3.2.0
Info App: File /app/emby/plugins/Tvdb.dll has version 1.3.1.0
Info App: File /config/plugins/OMDb.dll has version 1.0.18.0
Info App: File /app/emby/plugins/OMDb.dll has version 1.0.18.0
Info App: File /config/plugins/StudioImages.dll has version 1.0.3.0
Info App: File /app/emby/plugins/StudioImages.dll has version 1.0.3.0
Info App: File /config/plugins/Emby.PortMapper.dll has version 1.1.8.0
Info App: File /app/emby/plugins/Emby.PortMapper.dll has version 1.1.8.0
Info App: Loading Fanart, Version=1.0.13.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Fanart.dll
Info App: Loading MovieDb, Version=1.6.2.0, Culture=neutral, PublicKeyToken=null from /config/plugins/MovieDb.dll
Info App: Loading CoverArt, Version=4.1.18.0, Culture=neutral, PublicKeyToken=null from /config/plugins/CoverArt.dll
Info App: Loading MediaBrowser.Plugins.Anime, Version=1.5.3.0, Culture=neutral, PublicKeyToken=null from /config/plugins/MediaBrowser.Plugins.Anime.dll
Info App: Loading EmbyGuideData, Version=1.0.7.0, Culture=neutral, PublicKeyToken=null from /config/plugins/EmbyGuideData.dll
Info App: Loading ThemeSongs, Version=1.6.6.7, Culture=neutral, PublicKeyToken=null from /config/plugins/themesongs.dll
Info App: Loading Tvdb, Version=1.3.2.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Tvdb.dll
Info App: Loading OMDb, Version=1.0.18.0, Culture=neutral, PublicKeyToken=null from /config/plugins/OMDb.dll
Info App: Loading StudioImages, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null from /config/plugins/StudioImages.dll
Info App: Loading InfuseSync, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null from /config/plugins/InfuseSync.dll
Info App: Loading MediaBrowser.Plugins.GotifyNotifications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null from /config/plugins/MediaBrowser.Plugins.GotifyNotifications.dll
Info App: Loading Emby.DiagnosticsPlugin, Version=4.7.0.60, Culture=neutral, PublicKeyToken=null from /config/plugins/Emby.DiagnosticsPlugin.dll
Info App: Loading Emby.PortMapper, Version=1.1.8.0, Culture=neutral, PublicKeyToken=null from /config/plugins/Emby.PortMapper.dll
Info App: Loading Emby.Api, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Web, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading MediaBrowser.Model, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading MediaBrowser.Common, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading MediaBrowser.Controller, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Providers, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Photos, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Server.Implementations, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.LiveTV, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.ActivityLog, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Server.MediaEncoding, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.LocalMetadata, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Notifications, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Codecs.Dxva, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Codecs, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Server.Connect, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading Emby.Server.Sync, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info App: Loading EmbyServer, Version=4.7.8.0, Culture=neutral, PublicKeyToken=null
Info SqliteUserRepository: Sqlite version: 3.39.2
Info SqliteUserRepository: Sqlite compiler options: ATOMIC_INTRINSICS=1,COMPILER=gcc-10.3.0,DEFAULT_AUTOVACUUM,DEFAULT_CACHE_SIZE=-2000,DEFAULT_FILE_FORMAT=4,DEFAULT_JOURNAL_SIZE_LIMIT=-1,DEFAULT_MMAP_SIZE=0,DEFAULT_PAGE_SIZE=4096,DEFAULT_PCACHE_INITSZ=20,DEFAULT_RECURSIVE_TRIGGERS,DEFAULT_SECTOR_SIZE=4096,DEFAULT_SYNCHRONOUS=2,DEFAULT_WAL_AUTOCHECKPOINT=1000,DEFAULT_WAL_SYNCHRONOUS=2,DEFAULT_WORKER_THREADS=0,ENABLE_COLUMN_METADATA,ENABLE_DBSTAT_VTAB,ENABLE_FTS3,ENABLE_FTS3_PARENTHESIS,ENABLE_FTS3_TOKENIZER,ENABLE_FTS4,ENABLE_FTS5,ENABLE_GEOPOLY,ENABLE_MATH_FUNCTIONS,ENABLE_PREUPDATE_HOOK,ENABLE_RTREE,ENABLE_SESSION,ENABLE_UNLOCK_NOTIFY,ENABLE_UPDATE_DELETE_LIMIT,LIKE_DOESNT_MATCH_BLOBS,MALLOC_SOFT_LIMIT=1024,MAX_ATTACHED=10,MAX_COLUMN=2000,MAX_COMPOUND_SELECT=500,MAX_DEFAULT_PAGE_SIZE=8192,MAX_EXPR_DEPTH=1000,MAX_FUNCTION_ARG=127,MAX_LENGTH=1000000000,MAX_LIKE_PATTERN_LENGTH=50000,MAX_MMAP_SIZE=0x7fff0000,MAX_PAGE_COUNT=1073741823,MAX_PAGE_SIZE=65536,MAX_SCHEMA_RETRY=25,MAX_SQL_LENGTH=1000000000,MAX_TRIGGER_DEPTH=1000,MAX_VARIABLE_NUMBER=250000,MAX_VDBE_OP=250000000,MAX_WORKER_THREADS=8,MUTEX_PTHREADS,OMIT_LOOKASIDE,SECURE_DELETE,SYSTEM_MALLOC,TEMP_STORE=1,THREADSAFE=1
Info SqliteUserRepository: Opening sqlite connection to /config/data/users.db
Info SqliteUserRepository: Default journal_mode for /config/data/users.db is wal
Info ActivityRepository: Opening sqlite connection to /config/data/activitylog.db
Info ActivityRepository: Default journal_mode for /config/data/activitylog.db is wal
Info SqliteDisplayPreferencesRepository: Opening sqlite connection to /config/data/displaypreferences.db
Info SqliteDisplayPreferencesRepository: Default journal_mode for /config/data/displaypreferences.db is wal
Info App: Adding HttpListener prefix http://+:8096/
Info NetworkManager: Detecting local network addresses
Info NetworkManager: networkInterface: Ethernet eth0, Speed: 10000000000, Description: eth0
Info NetworkManager: GatewayAddresses: 172.30.110.1
Info NetworkManager: UnicastAddresses: 172.30.110.3
Info NetworkManager: networkInterface: Ethernet eth1, Speed: 10000000000, Description: eth1
Info NetworkManager: GatewayAddresses: 
Info NetworkManager: UnicastAddresses: 172.30.105.4
Info NetworkManager: networkInterface: Loopback lo, Speed: -1, Description: lo
Info NetworkManager: GatewayAddresses: 
Info NetworkManager: UnicastAddresses: 127.0.0.1
Info NetworkManager: Detected local ip addresses: 172.30.110.3, 172.30.105.4, 127.0.0.1
Info AuthenticationRepository: Opening sqlite connection to /config/data/authentication.db
Info AuthenticationRepository: Default journal_mode for /config/data/authentication.db is wal
Info SqliteItemRepository: Opening sqlite connection to /config/data/library.db
Error Main: Error in appHost.Init
	*** Error Report ***
	Version: 4.7.8.0
	Command line: /app/emby/EmbyServer.dll -programdata /config -ffdetect /app/emby/ffdetect -ffmpeg /app/emby/ffmpeg -ffprobe /app/emby/ffprobe -restartexitcode 3
	Operating system: Linux version 5.10.0-18-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1
	Framework: .NET 6.0.8
	OS/Process: x64/x64
	Runtime: app/emby/System.Private.CoreLib.dll
	Processor count: 12
	Data path: /config
	Application path: /app/emby
	SQLitePCL.pretty.SQLiteException: Busy: database is locked - PRAGMA journal_mode
	SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
	   at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(String sql, String& tail)
	   at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, String sql)
	   at Emby.Sqlite.BaseSqliteRepository.CreateConnection(Boolean isReadOnly)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.Initialize(SqliteUserDataRepository userDataRepo, IUserManager userManager)
	   at Emby.Server.Implementations.ApplicationHost.InitDatabases()
	   at Emby.Server.Implementations.ApplicationHost.Init()
	   at EmbyServer.HostedService.StartAsync(CancellationToken cancellationToken)
	Source: SQLitePCL.pretty
	TargetSite: SQLitePCL.pretty.IStatement PrepareStatement(System.String, System.String ByRef)
	
Info Main: Shutdown complete
Info Main: Application path: /app/emby/EmbyServer.dll

 

Edited by fredflix
Link to comment
Share on other sites

fredflix
1 hour ago, Luke said:

Thanks for following up. If this happens again and persists, then this should help get you squared away:

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

This is great. That's basically what I did, without knowing the solution was actually in the FAQ as it seemed like an isolated incident.
Thanks Luke 👍

  • Thanks 1
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...