Troubleshooting NzbDrone Start Process [CentOS/init.d]

I’ve been using Sonarr for many years, without much of any issue. However, I stopped the Sonarr service today, and am now unable to bring it back up.

It’s running on CentOS 6, and using the stock Sonarr init.d, and config:
InitD: https://raw.githubusercontent.com/OnceUponALoop/RandomShell/master/NzbDrone-init/nzbdrone.init.centos
Config: https://raw.githubusercontent.com/OnceUponALoop/RandomShell/master/NzbDrone-init/nzbdrone.init-cfg.centos

When starting the nzbdrone process, it seems to start up OK:

/etc/init.d/nzbdrone start
Starting nzbdrone...
nzbdrone started (pid )                                    [  OK  ]

However the PID shows no process ID, and a status returns dead process:

/etc/init.d/nzbdrone status
nzbdrone dead but pid file exists
cat /var/run/nzbdrone.pid

I can also confirm that the mono, or nzbdrone process is also not running.

I’ve reviewed the Installation on CentOS post to make sure there were no new changes:

I’ve also compiled sqlite3.8.5 once again to ensure the DB was working correctly.

I’ve also ran a test version of Sonarr, and it seem to run fine, and was accessible (without the db):

export LPATH_BAK=$LD_LIBRARY_PATH ; export PATH_BAK=$PATH   && \
export LD_LIBRARY_PATH=/opt/mono/lib:/opt/sqlite3.8.5/lib   && \
export PATH=/opt/mono/bin:/opt/sqlite3.8.5/bin:$PATH        && \
/opt/mono/bin/mono /opt/nzbdrone/NzbDrone.exe               ;  \
export PATH=$PATH_BAK ; export LD_LIBRARY_PATH=$LPATH_BAK

I’ve tried running nzbdrone manually, and the error I capture is:

/opt/mono/bin/mono /opt/nzbdrone/NzbDrone.exe
[Fatal] ConsoleApp: EPIC FAIL!

[v2.0.0.4389] System.TypeInitializationException: The type initializer for 'System.Data.SQLite.SQLiteFactory' threw an exception. ---> System.Data.SQLite.SQLiteException: SQL logic error or missing database
Failed to initialize logging.
at System.Data.SQLite.SQLiteLog.Initialize () [0x000aa] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteFactory..cctor () [0x00020] in <61a20cde294d4a3eb43b9d9f6284613b>:0
 --- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr)
at NzbDrone.Core.Datastore.Migration.Framework.MigrationDbFactory.CreateFactory () [0x00000] in <02684a2af4294daca4a93c514a294294>:0
at FluentMigrator.Runner.Processors.DbFactoryBase.get_Factory () [0x00025] in <26bb4df948464ddebb3d8de15736231d>:0
at FluentMigrator.Runner.Processors.DbFactoryBase.CreateConnection (System.String connectionString) [0x00000] in <26bb4df948464ddebb3d8de15736231d>:0
at NzbDrone.Core.Datastore.Migration.Framework.NzbDroneSqliteProcessorFactory.Create (System.String connectionString, FluentMigrator.Runner.IAnnouncer announcer, FluentMigrator.IMigrationProcessorOptions options) [0x00006] in <02684a2af4294daca4a93c514a294294>:0
at NzbDrone.Core.Datastore.Migration.Framework.MigrationController.Migrate (System.String connectionString, NzbDrone.Core.Datastore.Migration.Framework.MigrationContext migrationContext) [0x0005a] in <02684a2af4294daca4a93c514a294294>:0
at NzbDrone.Core.Datastore.DbFactory.Create (NzbDrone.Core.Datastore.Migration.Framework.MigrationContext migrationContext) [0x00048] in <02684a2af4294daca4a93c514a294294>:0
at NzbDrone.Core.Datastore.DbFactory.Create (NzbDrone.Core.Datastore.Migration.Framework.MigrationType migrationType) [0x00010] in <02684a2af4294daca4a93c514a294294>:0
at NzbDrone.Core.Datastore.DbFactory.RegisterDatabase (NzbDrone.Common.Composition.IContainer container) [0x00006] in <02684a2af4294daca4a93c514a294294>:0
at NzbDrone.Host.Bootstrap.Start (NzbDrone.Host.ApplicationModes applicationModes, NzbDrone.Common.EnvironmentInfo.StartupContext startupContext) [0x0003d] in <4afbae1fa38944e2b8b54bcf9e0b1713>:0
at NzbDrone.Host.Bootstrap.Start (NzbDrone.Common.EnvironmentInfo.StartupContext startupContext, NzbDrone.Host.IUserAlert userAlert, System.Action`1[T] startCallback) [0x00075] in <4afbae1fa38944e2b8b54bcf9e0b1713>:0
at NzbDrone.Console.ConsoleApp.Main (System.String[] args) [0x00013] in <ca19c3ec1b01476b9195ae1dd2c1f626>:0

It’s complaining about System.Data.SQLite.SQLiteException: SQL logic error or missing database, but almost certain it’s due to some missing paths or arguments such as sqlite or config path. I can confirm that my nzbdrone.db is not corrupt, and was able to open with no issues in SQLite.

I’ve updated sonarr, and reinstalled SQlite 3.8.5, and still no success.

Anyone able to shed any light on this? I’ve exhausted my resources trying to find out more, so am posting here.

I’ve spent the last 5 hours digging through, and no luck. If I have to completely wipe Sonarr, and do a reinstall, will I be able to backup and import my current DB without access to the Sonarr GUI (copy .config dir)?

What about the logging database (logs.db) in the same folder?
I’m not sure where Failed to initialize logging. is coming from and without line numbers in the stack trace (requires mono running with the --debug switch) I’m not sure exactly where it is failing.

Yes, manually backing up is covered on the ((backup)) wiki page.

I’ve opened up logs.db, and ran a ‘select * from Logs order by Time desc limit 10’, and it looks like this error repeats itself with ‘Unable to connect to Plex Server. Value cannot be null’. Attached a screenshot.

Before shutting down nzbdrone, I was troubleshooting a PlexServer connection in Sonarr settings. It would return an error about the PlexServer IP address I used not existing, even though the info was correct (and Plex up and running). The logs are dated today, but I have a feeling the timestamps are dated in GMT. Starting up the service using initD does not create any new logs. The service does not start, and the ports are not bound to any interface.

I can’t seem to find any other verbose message. FWIW, I’m running sonarr as user ‘media’ with sudo privileges, and the nzbdrone config is also set

I finally found the source of the problem! I have no idea who, why, or how it was set, but the /opt/nzbdrone folder had permissions set to 660 recursively. Changing this to 760 (making it executable) appears to have done the trick.

Will most likely have to search through the audit logs to see what happened here.

One more question (since I’m on here, and it was my initial issue), why does it give me the error of Plex Server being Null, when I’m entering an IP address in the UI field?

The error is because of an unexpected response from Plex, something that should be an array came back as null. If you were running an older version of Sonarr and a newer version of Plex it could be due to the changes in responses a couple months ago. ((Trace logs)) will show the full response body.

1 Like

I’ve updated Sonarr, and this has resolved the issue. Thanks Markus!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.