Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonarr error: Database is locked #6070

Open
1 task done
geotibi opened this issue Apr 12, 2024 · 10 comments
Open
1 task done

Sonarr error: Database is locked #6070

geotibi opened this issue Apr 12, 2024 · 10 comments
Labels

Comments

@geotibi
Copy link

geotibi commented Apr 12, 2024

Is this a new Bug?

  • I checked that the bug hasn't been reported before

Package Name

Sonarr v4

Package Version

20240114-4

Device Model

DS920+

Device Architecture

x86_64

Firmware Version

DSM 7.2.1-69057 Update 4

What happened?

Series are not updated from TVdb. Looking at the logs I see the error "database is locked"

Reproduction steps

  1. Connect to WebUI
  2. Go to a Series
  3. Hit "Refresh Series"

Install Log

2024/01/15 09:31:22	upgrade sonarr 20231129-3 Begin start-stop-status stop
2024/01/15 09:31:37	upgrade sonarr 20231129-3 End start-stop-status stop ret=[0]
2024/01/15 09:31:38	upgrade sonarr 20231129-3 Begin preupgrade
2024/01/15 09:31:38	Begin initialize_variables
2024/01/15 09:31:38	End initialize_variables
2024/01/15 09:31:38	===> Step preupgrade. STATUS=UPGRADE USER=sonarr GROUP= SHARE_PATH=
2024/01/15 09:31:38	Begin service_preupgrade
2024/01/15 09:31:38	Backup existing distribution to /volume1/@tmp/synopkg.tmp/sonarr/backup
2024/01/15 09:31:48	End service_preupgrade
2024/01/15 09:31:48	upgrade sonarr 20231129-3 End preupgrade ret=[0]
2024/01/15 09:31:48	upgrade sonarr 20231129-3 Begin preuninst
2024/01/15 09:31:48	Begin initialize_variables
2024/01/15 09:31:48	End initialize_variables
2024/01/15 09:31:48	===> Step preuninst. STATUS=UPGRADE USER=sonarr GROUP= SHARE_PATH=
2024/01/15 09:31:48	upgrade sonarr 20231129-3 End preuninst ret=[0]
2024/01/15 09:31:49	upgrade sonarr 20231129-3 Begin /bin/rm -rf /volume1/@appstore/sonarr
2024/01/15 09:31:51	upgrade sonarr 20231129-3 End /bin/rm -rf /volume1/@appstore/sonarr ret=[0]
2024/01/15 09:31:51	upgrade sonarr 20231129-3 Begin /bin/rm -rf /volume1/@apptemp/sonarr
2024/01/15 09:31:51	upgrade sonarr 20231129-3 End /bin/rm -rf /volume1/@apptemp/sonarr ret=[0]
2024/01/15 09:31:53	upgrade sonarr 20231129-3 Begin postuninst
2024/01/15 09:31:53	Begin initialize_variables
2024/01/15 09:31:53	End initialize_variables
2024/01/15 09:31:53	===> Step postuninst. STATUS=UPGRADE USER=sonarr GROUP= SHARE_PATH=
2024/01/15 09:31:53	upgrade sonarr 20231129-3 End postuninst ret=[0]
2024/01/15 09:31:54	upgrade sonarr 20240114-4 Begin preinst
2024/01/15 09:31:54	Begin initialize_variables
2024/01/15 09:31:54	End initialize_variables
2024/01/15 09:31:54	===> Step preinst. STATUS=UPGRADE USER=sonarr GROUP= SHARE_PATH=
2024/01/15 09:31:54	Begin validate_preinst
2024/01/15 09:31:54	End validate_preinst
2024/01/15 09:31:54	upgrade sonarr 20240114-4 End preinst ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mkdir -p /volume1/@appstore/sonarr -m 755
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mkdir -p /volume1/@appstore/sonarr -m 755 ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/rm -rf /volume1/@appstore/sonarr
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/rm -rf /volume1/@appstore/sonarr ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/package /volume1/@appstore/sonarr
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/package /volume1/@appstore/sonarr ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/rm -rf /var/packages/sonarr
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/rm -rf /var/packages/sonarr ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mkdir -p /var/packages/sonarr -m 755
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mkdir -p /var/packages/sonarr -m 755 ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/touch /var/packages/sonarr/installing
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/touch /var/packages/sonarr/installing ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/INFO /var/packages/sonarr/INFO
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/INFO /var/packages/sonarr/INFO ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/rm -rf /var/packages/sonarr/scripts
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/rm -rf /var/packages/sonarr/scripts ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/scripts /var/packages/sonarr/scripts
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/scripts /var/packages/sonarr/scripts ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/rm -rf /var/packages/sonarr/WIZARD_UIFILES
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/rm -rf /var/packages/sonarr/WIZARD_UIFILES ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/WIZARD_UIFILES /var/packages/sonarr/WIZARD_UIFILES
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/WIZARD_UIFILES /var/packages/sonarr/WIZARD_UIFILES ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/rm -rf /var/packages/sonarr/conf
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/rm -rf /var/packages/sonarr/conf ret=[0]
2024/01/15 09:31:55	upgrade sonarr 20240114-4 Begin /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/conf /var/packages/sonarr/conf
2024/01/15 09:31:55	upgrade sonarr 20240114-4 End /bin/mv -f /volume1/@tmp/synopkg/install.z2rUDf/conf /var/packages/sonarr/conf ret=[0]
2024/01/15 09:32:04	upgrade sonarr 20240114-4 Begin postinst
2024/01/15 09:32:04	Begin initialize_variables
2024/01/15 09:32:04	End initialize_variables
2024/01/15 09:32:04	===> Step postinst. STATUS=UPGRADE USER=sonarr GROUP= SHARE_PATH=
2024/01/15 09:32:04	Begin save_wizard_variables
2024/01/15 09:32:04	End save_wizard_variables
2024/01/15 09:32:04	Begin syno_sync_var_folder
2024/01/15 09:32:04	Install files from var folder
2024/01/15 09:32:04	/bin/rsync -avh --ignore-existing --remove-source-files /volume1/@appstore/sonarr/var/ /volume1/@appdata/sonarr
2024/01/15 09:32:04	sending incremental file list
2024/01/15 09:32:04	./
2024/01/15 09:32:04	.config/
2024/01/15 09:32:04	.config/Sonarr/
2024/01/15 09:32:04	sent 138 bytes  received 27 bytes  330.00 bytes/sec
2024/01/15 09:32:04	total size is 197  speedup is 1.19
2024/01/15 09:32:04	/bin/rsync -avh --remove-source-files /volume1/@appstore/sonarr/var/ /volume1/@appdata/sonarr
2024/01/15 09:32:04	sending incremental file list
2024/01/15 09:32:04	.config/Sonarr/
2024/01/15 09:32:04	.config/Sonarr/config.xml.new
2024/01/15 09:32:04	sent 390 bytes  received 48 bytes  876.00 bytes/sec
2024/01/15 09:32:04	total size is 197  speedup is 0.45
2024/01/15 09:32:04	End syno_sync_var_folder
2024/01/15 09:32:04	Begin service_postinst
2024/01/15 09:32:04	Set update required
2024/01/15 09:32:04	End service_postinst
2024/01/15 09:32:04	upgrade sonarr 20240114-4 End postinst ret=[0]
2024/01/15 09:32:04	upgrade sonarr 20240114-4 Begin postupgrade
2024/01/15 09:32:04	Begin initialize_variables
2024/01/15 09:32:04	End initialize_variables
2024/01/15 09:32:04	===> Step postupgrade. STATUS=UPGRADE USER=sonarr GROUP= SHARE_PATH=
2024/01/15 09:32:04	Resore var folder from DSM6
2024/01/15 09:32:04	/bin/rsync -avh /volume1/@tmp/synopkg.tmp/sonarr/ /volume1/@appdata/sonarr
2024/01/15 09:32:04	sending incremental file list
2024/01/15 09:32:04	./
2024/01/15 09:32:05	backup/
2024/01/15 09:32:05	backup/share/Sonarr/package_info
2024/01/15 09:32:05	backup/share/Sonarr/bin/
2024/01/15 09:32:05	backup/share/Sonarr/bin/Sonarr.Api.V3.dll
2024/01/15 09:32:05	backup/share/Sonarr/bin/Sonarr.Api.V3.pdb
2024/01/15 09:32:05	backup/share/Sonarr/bin/Sonarr.Common.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Common.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Core.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Core.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Host.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Host.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Http.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Http.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Mono.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.Mono.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.RuntimePatches.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.RuntimePatches.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.SignalR.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.SignalR.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.dll
2024/01/15 09:32:06	backup/share/Sonarr/bin/Sonarr.pdb
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/cs.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/de.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/en.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/es.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/fi.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/fr.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/hu.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/id.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/it.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/lv.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/nl.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/pl.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/pt.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/pt_BR.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/ru.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/tr.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/Localization/Core/zh_CN.json
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/196-c13c60efe2610caf57c5.js
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/196-c13c60efe2610caf57c5.js.map
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/index-2b8430f58fb30f170850.js
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/index-2b8430f58fb30f170850.js.map
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/index.html
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/Content/
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/Content/196-1f4add368b1baec1317c.css
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/Content/196-1f4add368b1baec1317c.css.map
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/Content/Images/Icons/
2024/01/15 09:32:06	backup/share/Sonarr/bin/UI/Content/Images/Icons/manifest.json
2024/01/15 09:32:06	sent 10.66M bytes  received 905 bytes  7.10M bytes/sec
2024/01/15 09:32:06	total size is 155.45M  speedup is 14.59
2024/01/15 09:32:06	Begin syno_sync_var_folder
2024/01/15 09:32:06	End syno_sync_var_folder
2024/01/15 09:32:06	Begin service_postupgrade
2024/01/15 09:32:06	Restore previous distribution from /volume1/@tmp/synopkg.tmp/sonarr/backup
2024/01/15 09:32:07	End service_postupgrade
2024/01/15 09:32:07	upgrade sonarr 20240114-4 End postupgrade ret=[0]
2024/01/15 09:32:09	upgrade sonarr 20240114-4 Begin start-stop-status start
2024/01/15 09:32:14	upgrade sonarr 20240114-4 End start-stop-status start ret=[0]

Service Log

[Info] DownloadDecisionMaker: Processing 200 releases 
[Info] RssSyncService: RSS Sync Completed. Reports found: 200, Reports grabbed: 0 
[Info] SceneMappingService: Updating Scene mappings 
[Info] RefreshSeriesService: Updating Las Fierbinți 
[Info] Auth: Auth-Success ip 192.168.0.183 username 'geotibi' 
[Info] RefreshEpisodeService: Starting episode info refresh for: [276730][Las Fierbinți] 
[Error] TaskExtensions: Task Error 

[v4.0.3.1413] code = Busy (5), message = System.Data.SQLite.SQLiteException (0x800007AF): database is locked
database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1075
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 1058
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 188
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 151
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push[TCommand](TCommand command, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 138
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push(String commandName, Nullable`1 lastExecutionTime, Nullable`1 lastStartTime, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 142
   at NzbDrone.Core.Jobs.Scheduler.ExecuteCommands() in ./Sonarr.Core/Jobs/Scheduler.cs:line 42
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

[Error] TaskExtensions: Task Error 

[v4.0.3.1413] code = Busy (5), message = System.Data.SQLite.SQLiteException (0x800007AF): database is locked
database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1075
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 1058
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 188
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 151
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push[TCommand](TCommand command, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 138
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push(String commandName, Nullable`1 lastExecutionTime, Nullable`1 lastStartTime, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 142
   at NzbDrone.Core.Jobs.Scheduler.ExecuteCommands() in ./Sonarr.Core/Jobs/Scheduler.cs:line 42
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

[Error] TaskExtensions: Task Error 

[v4.0.3.1413] code = Busy (5), message = System.Data.SQLite.SQLiteException (0x800007AF): database is locked
database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1075
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 1058
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 188
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 151
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push[TCommand](TCommand command, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 138
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push(String commandName, Nullable`1 lastExecutionTime, Nullable`1 lastStartTime, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 142
   at NzbDrone.Core.Jobs.Scheduler.ExecuteCommands() in ./Sonarr.Core/Jobs/Scheduler.cs:line 42
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

[Error] CommandExecutor: Error occurred while executing task RefreshMonitoredDownloads 

[v4.0.3.1413] code = Busy (5), message = System.Data.SQLite.SQLiteException (0x800007AF): database is locked
database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader) in /_/Dapper/SqlMapper.cs:line 2858
   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 581
   at NzbDrone.Core.Datastore.BasicRepository`1.UpdateFields(IDbConnection connection, IDbTransaction transaction, TModel model, List`1 propertiesToUpdate) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 385
   at NzbDrone.Core.Datastore.BasicRepository`1.SetFields(TModel model, Expression`1[] properties) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 335
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Update(CommandModel command, CommandStatus status, String message) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 258
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Fail(CommandModel command, String message, Exception e) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 213
   at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand](TCommand command, CommandModel commandModel) in ./Sonarr.Core/Messaging/Commands/CommandExecutor.cs:line 116
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands() in ./Sonarr.Core/Messaging/Commands/CommandExecutor.cs:line 42

[Error] TaskExtensions: Task Error 

[v4.0.3.1413] code = Busy (5), message = System.Data.SQLite.SQLiteException (0x800007AF): database is locked
database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1075
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 1058
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 188
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 151
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push[TCommand](TCommand command, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 138
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push(String commandName, Nullable`1 lastExecutionTime, Nullable`1 lastStartTime, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 142
   at NzbDrone.Core.Jobs.Scheduler.ExecuteCommands() in ./Sonarr.Core/Jobs/Scheduler.cs:line 42
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

[Error] TaskExtensions: Task Error 

[v4.0.3.1413] code = Busy (5), message = System.Data.SQLite.SQLiteException (0x800007AF): database is locked
database is locked
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1075
   at Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 1058
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(IDbConnection connection, IDbTransaction transaction, TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 188
   at NzbDrone.Core.Datastore.BasicRepository`1.Insert(TModel model) in ./Sonarr.Core/Datastore/BasicRepository.cs:line 151
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push[TCommand](TCommand command, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 138
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at NzbDrone.Core.Messaging.Commands.CommandQueueManager.Push(String commandName, Nullable`1 lastExecutionTime, Nullable`1 lastStartTime, CommandPriority priority, CommandTrigger trigger) in ./Sonarr.Core/Messaging/Commands/CommandQueueManager.cs:line 142
   at NzbDrone.Core.Jobs.Scheduler.ExecuteCommands() in ./Sonarr.Core/Jobs/Scheduler.cs:line 42
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

[Info] RefreshEpisodeService: Finished episode refresh for series: [276730][Las Fierbinți]. 
[Info] DiskScanService: Scanning Las Fierbinți 
[Info] DiskScanService: Completed scanning disk for Las Fierbinți 
[Info] ExistingMetadataImporter: Found 0 existing metadata files 
[Info] ExistingSubtitleImporter: Found 0 existing subtitle files 
[Info] ExistingOtherExtraImporter: Found 0 existing other extra files 
[Info] ExistingExtraFileService: Found 0 possible extra files, imported 0 files. 
[Info] RssSyncService: Starting RSS Sync 
[Info] DownloadDecisionMaker: Processing 200 releases 
[Info] RssSyncService: RSS Sync Completed. Reports found: 200, Reports grabbed: 0 
[Info] Auth: Auth-Success ip 192.168.0.183 username 'geotibi' 
[Info] RssSyncService: Starting RSS Sync 
[Info] DownloadDecisionMaker: Processing 200 releases 
[Info] RssSyncService: RSS Sync Completed. Reports found: 200, Reports grabbed: 0 
[Info] SceneMappingService: Updating Scene mappings 
[Info] RssSyncService: Starting RSS Sync 
[Info] DownloadDecisionMaker: Processing 200 releases 
[Info] RssSyncService: RSS Sync Completed. Reports found: 200, Reports grabbed: 0 
[Info] RssSyncService: Starting RSS Sync 
[Info] DownloadDecisionMaker: Processing 200 releases 
[Info] RssSyncService: RSS Sync Completed. Reports found: 200, Reports grabbed: 0

Other Logs

No response

@geotibi geotibi added the bug label Apr 12, 2024
@mreid-tt
Copy link
Contributor

Hi @geotibi, I've identified the primary issue as a database lock error. According to Sonarr/Sonarr#5402, "the database being locked on it's own isn't an error". Did you encounter this problem prior to the automatic update to v4.0.3.1413? Regardless, the developers at the upstream repository need a trace log to effectively troubleshoot. You can find instructions on enabling this feature here: https://wiki.servarr.com/sonarr/troubleshooting. Let me know if you need any further assistance.

@geotibi
Copy link
Author

geotibi commented Apr 12, 2024

Hello,
The installed version is 4.0.3.1413, synology package version 20240114-4. I observed since last 2-3 weeks than one Series is not updating and I've started looking in the logs and I saw that database locked error and I don't know how to fix it.
sonarr traces.txt
I've attahced also the traces

@mreid-tt
Copy link
Contributor

@geotibi, as this may be an upstream issue I've logged an upstream ticket on your behalf. Will update here on the findings.

@mreid-tt mreid-tt added upstream and removed bug labels Apr 12, 2024
@mreid-tt
Copy link
Contributor

@geotibi, the upstream team closed the issue I opened with the following note:

the database being locked is not an issue.
Episode information not being updated is a result of an ongoing issue with the TVDB API not returning all the information is should - see this issue for reference: thetvdb/v4-api#323

@bakerboy448
Copy link

Database locks are generally never bugs and are always due to under powered systems that are unable to keep up with the IOps required

BTFS filesystems also weren't playing nice but believe this was fixed downstream and pulled back to sonarr

@mreid-tt
Copy link
Contributor

hi @bakerboy448, while it is true that databases can be affected by underpowered systems, I don't believe there is evidence to support that in this instance.

I run a DS916+ system which has an Intel Pentium N3710 CPU. The benchmarks for this show an average CPU mark of 1386. I also have my drives configured with btrfs and with my setup I've not seen database locking issues on my rig. I do acknowledge that I used to see issues with Radarr which were acknowledged as a bug under Radarr/Radarr#9173 but this was subsequently resolved.

As for this user, they run a newer DS920+ which has an Intel Celeron J4125 CPU. The benchmarks show a much faster performance than my own with an average CPU mark of 2961. Additionally, given that this issue only started for them about 2-3 weeks ago and not before I don't support the view that there is evidence that the database is being CPU limited.

As such, I believe the issue cited upstream regarding the TVdb API is a much more likely candidate as a root cause.

hey @geotibi, out of curiosity, is it only one series that has issues updating or do all your series have issues updating?

@bakerboy448
Copy link

It'd be drive constrained for IOWait more than CPU

but yes agree upstream poor data on TVDb is likely the root cause as sonarr team said

@geotibi
Copy link
Author

geotibi commented Apr 12, 2024

Hello @mreid-tt I observed indeed that this is happening to one series because almost each week new episodes are added in TVdb for that one, but I'm not 100% sure because I do not have any other Series which is ongoing and updated weekly on TVdb.

@geotibi
Copy link
Author

geotibi commented Apr 15, 2024

Yesterday, after around 3 weeks the series got updated suddenly. As I mentioned, the issue with database locked is happenig very often but when this is not locked, the update is working smoothly.

@geotibi
Copy link
Author

geotibi commented Apr 16, 2024

Today I did an update on TVdb 1 hours and a half ago, I did a series update now and everything was updated in Sonarr without any issue, no database lock message. It seems that it started to work without any fix from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants