Dev Update 3738 hosed clean install of 3732 - Ubuntu 15.10 (Logs)

Permissions issue I believe. I’ve resolved the problem, this reporting is FYI.

Applied update from the Webui and status box in the lower right of screen said it lost contact and offered a restart. I clicked it and nothing happened. Not sure if browser displayed a “Cannot connect” message at that point but it did when I subsequently tried to load the page. Found the daemon was no longer running. Rebooted the computer and daemon still did not start. Browser still unable to connect. Tried manually starting it at command line but nothing appeared to happen:


xxxx@ZZZZ:~/.config/NzbDrone/UpdateLogs$ sudo service nzbdrone restart
[sudo] password for xxxx:
xxxx@ZZZZ:~/.config/NzbDrone/UpdateLogs$ sudo service nzbdrone status
● nzbdrone.service - LSB: starts instance of NzbDrone
Loaded: loaded (/etc/init.d/nzbdrone)
Active: active (exited) since Tue 2016-02-02 22:05:02 PST; 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 2080 ExecStop=/etc/init.d/nzbdrone stop (code=exited, status=1/FAILURE)
Process: 2089 ExecStart=/etc/init.d/nzbdrone start (code=exited, status=0/SUCCESS)

Feb 02 22:05:02 ZZZZ systemd[1]: nzbdrone.service: Control process exited, code=exited status=1
Feb 02 22:05:02 ZZZZ systemd[1]: Stopped LSB: starts instance of NzbDrone.
Feb 02 22:05:02 ZZZZ systemd[1]: nzbdrone.service: Unit entered failed state.
Feb 02 22:05:02 ZZZZ systemd[1]: nzbdrone.service: Failed with result ‘exit-code’.
Feb 02 22:05:02 ZZZZ systemd[1]: Starting LSB: starts instance of NzbDrone…
Feb 02 22:05:02 ZZZZ nzbdrone[2089]: Removing stale /var/run/nzbdrone/nzbdrone.pid
Feb 02 22:05:02 ZZZZ nzbdrone[2089]: Starting NzbDrone
Feb 02 22:05:02 ZZZZ systemd[1]: Started LSB: starts instance of NzbDrone.

From the following excerpt from the UpdateLog I’m gathering there was an Access Denied failure deleting FontAwesome.otf and maybe again during the rollback? Regardless, it left the system quietly kaput.

– FROM UPDATE LOG ---------------------

16-2-2 21:13:20.6|Info|UpdateApp|Starting Sonarr Update Client
16-2-2 21:13:21.0|Info|UpdateApp|Updating Sonarr to version 2.0.0.3778
16-2-2 21:13:21.1|Debug|UpdateApp|NzbDrone process ID: 819
16-2-2 21:13:21.1|Debug|UpdateApp|Arguments:
16-2-2 21:13:21.1|Debug|UpdateApp| 819
16-2-2 21:13:21.1|Debug|UpdateApp| /tmp/nzbdrone_update
16-2-2 21:13:21.1|Debug|UpdateApp| /opt/NzbDrone/NzbDrone.exe
16-2-2 21:13:21.1|Debug|UpdateApp|Using executing application: /opt/NzbDrone/NzbDrone.exe
16-2-2 21:13:21.1|Debug|UpdateApp|Executable location: /opt/NzbDrone/NzbDrone.exe
16-2-2 21:13:21.1|Info|UpdateApp|Starting update process. Target Path:/opt/NzbDrone
16-2-2 21:13:21.1|Info|InstallUpdateService|Verifying requirements before update…
16-2-2 21:13:21.2|Debug|ProcessProvider|Finding process with Id:819
16-2-2 21:13:21.5|Debug|ProcessProvider|Found process 819:mono-sgen [/usr/bin/mono-sgen]
16-2-2 21:13:21.5|Info|InstallUpdateService|Verifying Update Folder
16-2-2 21:13:22.4|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone.Console
16-2-2 21:13:23.3|Debug|ProcessProvider|Found 1 processes with the name: NzbDrone
16-2-2 21:13:23.3|Debug|ProcessProvider| - [819] mono-sgen
16-2-2 21:13:23.3|Info|BackupAndRestore|Creating backup of existing installation
16-2-2 21:13:23.3|Debug|DiskTransferService|Copy [/opt/NzbDrone/UI/Content/FontAwesome/FontAwesome.otf] > [/tmp/nzbdrone_update/nzbdrone_backup/UI/Content/FontAwesome/FontAwesome.otf]

blah blah

16-2-2 21:13:25.0|Debug|DiskTransferService|Copy [/opt/NzbDrone/System.Data.SQLite.dll] > [/tmp/nzbdrone_update/nzbdrone_backup/System.Data.SQLite.dll]
16-2-2 21:13:25.1|Info|BackupAppData|Backing up appdata (database/config)
16-2-2 21:13:25.1|Debug|DiskTransferService|Copy [/home/xxxx/.config/NzbDrone/config.xml] > [/tmp/nzbdrone_update/nzbdrone_appdata_backup/config.xml]
16-2-2 21:13:25.1|Debug|DiskTransferService|Copy [/home/xxxx/.config/NzbDrone/nzbdrone.db] > [/tmp/nzbdrone_update/nzbdrone_appdata_backup/nzbdrone.db]
16-2-2 21:13:25.1|Info|InstallUpdateService|Emptying installation folder
16-2-2 21:13:25.1|Trace|DiskProviderBase|Deleting file: /opt/NzbDrone/CookComputing.XmlRpcV2.dll

blah blah

16-2-2 21:13:25.2|Trace|DiskProviderBase|Deleting file: /opt/NzbDrone/System.Data.SQLite.dll
16-2-2 21:13:25.2|Fatal|InstallUpdateService|Failed to copy upgrade package to target folder.

System.UnauthorizedAccessException: Access to the path “/opt/NzbDrone/UI/Content/FontAwesome/FontAwesome.otf” is denied.
at System.IO.File.Delete (System.String path) <0x7fb852559ea0 + 0x0015c> in :0
at System.IO.Directory.RecursiveDelete (System.String path) <0x7fb8525565d0 + 0x0009f> in :0
at System.IO.Directory.RecursiveDelete (System.String path) <0x7fb8525565d0 + 0x0006a> in :0
at System.IO.Directory.RecursiveDelete (System.String path) <0x7fb8525565d0 + 0x0006a> in :0
at System.IO.Directory.Delete (System.String path, Boolean recursive) <0x7fb8525566a0 + 0x00023> in :0
at NzbDrone.Common.Disk.DiskProviderBase.DeleteFolder (System.String path, Boolean recursive) [0x00068] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskProviderBase.cs:222
at NzbDrone.Common.Disk.DiskProviderBase.EmptyFolder (System.String path) [0x00083] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskProviderBase.cs:343
at NzbDrone.Update.UpdateEngine.InstallUpdateService.Start (System.String installationFolder, Int32 processId) [0x00070] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateEngine\InstallUpdateService.cs:99

16-2-2 21:13:25.2|Info|BackupAndRestore|Attempting to rollback upgrade
16-2-2 21:13:25.2|Debug|DiskTransferService|Copy [/tmp/nzbdrone_update/nzbdrone_backup/UI/Content/FontAwesome/FontAwesome.otf] > [/opt/NzbDrone/UI/Content/FontAwesome/FontAwesome.otf]
16-2-2 21:13:25.2|Trace|DiskProviderBase|Deleting file: /opt/NzbDrone/UI/Content/FontAwesome/FontAwesome.otf
16-2-2 21:13:25.2|Info|TerminateNzbDrone|Killing all running processes
16-2-2 21:13:26.5|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone.Console
16-2-2 21:13:26.5|Debug|ProcessProvider|Found 0 processes to kill
16-2-2 21:13:27.5|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:27.5|Debug|ProcessProvider|Found 0 processes to kill
16-2-2 21:13:27.5|Info|ProcessProvider|[819]: Killing process
16-2-2 21:13:27.5|Info|ProcessProvider|[819]: Waiting for exit
16-2-2 21:13:27.5|Info|ProcessProvider|[819]: Process terminated successfully
16-2-2 21:13:27.5|Info|InstallUpdateService|Waiting for external auto-restart.
16-2-2 21:13:29.2|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:31.3|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:33.5|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:35.7|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:37.9|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:39.1|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
16-2-2 21:13:39.1|Info|StartNzbDrone|Starting NzbDrone
16-2-2 21:13:39.1|Info|StartNzbDrone|Starting NzbDrone.exe
16-2-2 21:13:39.1|Debug|ProcessProvider|Starting mono --debug /opt/NzbDrone/NzbDrone.exe /nobrowser
16-2-2 21:13:39.2|Fatal|UpdateApp|An error has occurred while applying update package.

System.UnauthorizedAccessException: Access to the path “/opt/NzbDrone/UI/Content/FontAwesome/FontAwesome.otf” is denied.
at System.IO.File.Delete (System.String path) <0x7fb852559ea0 + 0x0015c> in :0
at NzbDrone.Common.Disk.DiskProviderBase.DeleteFile (System.String path) [0x0005e] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskProviderBase.cs:178
at NzbDrone.Common.Disk.DiskTransferService.ClearTargetPath (System.String targetPath, Boolean overwrite) [0x00011] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskTransferService.cs:215
at NzbDrone.Common.Disk.DiskTransferService.TransferFile (System.String sourcePath, System.String targetPath, TransferMode mode, Boolean overwrite, Boolean verified) [0x00221] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskTransferService.cs:142
at NzbDrone.Common.Disk.DiskTransferService.TransferFolder (System.String sourcePath, System.String targetPath, TransferMode mode, Boolean verified) [0x0013b] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskTransferService.cs:68
at NzbDrone.Common.Disk.DiskTransferService.TransferFolder (System.String sourcePath, System.String targetPath, TransferMode mode, Boolean verified) [0x000c8] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskTransferService.cs:61
at NzbDrone.Common.Disk.DiskTransferService.TransferFolder (System.String sourcePath, System.String targetPath, TransferMode mode, Boolean verified) [0x000c8] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskTransferService.cs:61
at NzbDrone.Common.Disk.DiskTransferService.TransferFolder (System.String sourcePath, System.String targetPath, TransferMode mode, Boolean verified) [0x000c8] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Disk\DiskTransferService.cs:61
at NzbDrone.Update.UpdateEngine.BackupAndRestore.Restore (System.String target) [0x00010] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateEngine\BackupAndRestore.cs:36
at NzbDrone.Update.UpdateEngine.InstallUpdateService.Start (System.String installationFolder, Int32 processId) [0x000de] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateEngine\InstallUpdateService.cs:113
at NzbDrone.Update.UpdateApp.Start (System.String[] args) [0x00020] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateApp.cs:59
at NzbDrone.Update.UpdateApp.Main (System.String[] args) [0x00042] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateApp.cs:43

– FROM nzbdrone.txt LOG ---------------------


16-2-2 21:00:27.8|Error|InstallUpdateService|Update process failed

NzbDrone.Core.Update.UpdateFolderNotWritableException: Cannot install update because startup folder ‘/opt/NzbDrone’ is not writable by the user ‘xxxx’.
at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) <0x41ad1030 + 0x004cb> in :0
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x41ad0c00 + 0x0015f> in :0

16-2-2 21:00:28.1|Error|CommandExecutor|Error occurred while executing task ApplicationUpdate

NzbDrone.Core.Messaging.Commands.CommandFailedException: Startup folder not writable by user ‘xxxx’ —> NzbDrone.Core.Update.UpdateFolderNotWritableException: Cannot install update because startup folder ‘/opt/NzbDrone’ is not writable by the user ‘xxxx’.
at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) <0x41ad1030 + 0x004cb> in :0
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x41ad0c00 + 0x0015f> in :0
— End of inner exception stack trace —
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x41ad0c00 + 0x00267> in :0
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (NzbDrone.Core.Messaging.Commands.TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) <0x4199f780 + 0x001c2> in :0

16-2-2 21:01:28.9|Error|InstallUpdateService|Update process failed

NzbDrone.Core.Update.UpdateFolderNotWritableException: Cannot install update because startup folder ‘/opt/NzbDrone’ is not writable by the user ‘xxxx’.
at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) <0x41ad1030 + 0x004cb> in :0
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x41ad0c00 + 0x0015f> in :0

16-2-2 21:01:29.1|Error|CommandExecutor|Error occurred while executing task ApplicationUpdate

NzbDrone.Core.Messaging.Commands.CommandFailedException: Startup folder not writable by user ‘xxxx’ —> NzbDrone.Core.Update.UpdateFolderNotWritableException: Cannot install update because startup folder ‘/opt/NzbDrone’ is not writable by the user ‘xxxx’.
at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) <0x41ad1030 + 0x004cb> in :0
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x41ad0c00 + 0x0015f> in :0
— End of inner exception stack trace —
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x41ad0c00 + 0x00267> in :0
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (NzbDrone.Core.Messaging.Commands.TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) <0x4199f780 + 0x001c2> in :0

The files in question were marked thus:
drwxr-xr-x 3 root root 4096 Jan 31 03:04 opt

drwxrwxrwx 4 root root 4096 Feb 2 21:13 NzbDrone

drwxr-xr-x 3 root root 4096 Jan 31 02:08 UI

drwxr-xr-x 7 root root 4096 Jan 31 02:08 Content
-rw-r–r-- 1 root root 25175 Jan 14 21:13 handlebars.runtime.js
-rw-r–r-- 1 root root 3973 Jan 14 21:13 index.html
-rw-r–r-- 1 root root 2487 Jan 14 21:13 login.html
-rw-r–r-- 1 root root 501641 Jan 14 21:14 main.js
-rw-r–r-- 1 root root 639117 Jan 14 21:14 main.map
-rw-r–r-- 1 root root 292 Jan 14 21:14 oauth.html
-rw-r–r-- 1 root root 1459 Jan 14 21:13 polyfills.js
-rw-r–r-- 1 root root 381231 Jan 14 21:14 templates.js
-rw-r–r-- 1 root root 2002060 Jan 14 21:14 vendor.js
-rw-r–r-- 1 root root 2356469 Jan 14 21:14 vendor.map

blah blah
drwxr-xr-x 2 root root 4096 Jan 31 02:08 FontAwesome
blah blah

-rw-r–r-- 1 root root 93888 Jan 14 21:14 FontAwesome.otf
-rw-r–r-- 1 root root 60767 Jan 14 21:14 fontawesome-webfont.eot
-rw-r–r-- 1 root root 313398 Jan 14 21:14 fontawesome-webfont.svg
-rw-r–r-- 1 root root 122092 Jan 14 21:14 fontawesome-webfont.ttf
-rw-r–r-- 1 root root 71508 Jan 14 21:14 fontawesome-webfont.woff
-rw-r–r-- 1 root root 56780 Jan 14 21:14 fontawesome-webfont.woff2

I ended up CHMOD’ing the entire folder hierarchy and then apt-get install --reinstall nzbdrone

I started the service and the webui connected right up.

I applied the update again and it proceed without errors. Log files indicate a clean upgrade.

make sure you only use one update method to update sonarr.(repo of sonarrs build-in). if you use both then you get permission problems.

Are you referring to Settings | General -> Updates -> Branch? Like switching back and forth between “Master” and “Develop”?

Or are you referring to applying updates via the Webui Vs. at the command line?

The first, I won’t be changing back to “Master” unless I have a good and well-considered reason to. No worries there.

The second, I’ll need to think about. I most likely will tend to use the built-in webui updater because the software will be prompting with an update notification. I can’t imagine at the moment why I might want to update at a command line, but who knows. 6 months from now I may have forgotten all about this stuff. :wink:

The problem is the permissions on the folders were mixed up, which is caused by using apt-get to upgrade the install, then Sonarr attempts to update and fails because one or more files are not writable and when it tries to restore the previous version that fails because things aren’t properly writable.

You’re going to have the same issue because different files have different permissions, you should replay the chmod changes now and avoid upgrading Sonarr though apt-get.

Well, that makes things curiouser because as far as I know I never upgraded it via apt-get. This was a fresh install that I had just gotten up and running the night before. It wasn’t until the following day that I went in to finalize the configuration and saw the Update Available notification and decided to do so before I dove into the rest of the configuration.

It’s also the only thing in /opt so any permissions on those files were put there by the installer?


Edit:
Yeah, I just went back and dug up the two main online installation docs I followed and after adding the source repository then apt-get install nzbdrone there’s nothing else I’d construe as “upgrading”.

If you just installed you’d need to make the directory (and its contents) writable, unless you chowned the folder recursively to the user running Sonarr or chmoded the files/folders to allow other read/write access the update would fail as it did.

If I’m reading what you said correctly, that should probably be fixed or heavily documented.

I can find nothing mentioning it,

here: https://github.com/Sonarr/Sonarr/wiki/Installation
or
here: http://www.htpcbeginner.com/install-nzbdrone-on-ubuntu/
or
here: http://www.htpcguides.com/install-nzbdrone-ubuntu/

I suspect I may have found the problem –

Per the wiki I created/modified the following nzbdrone.conf:

==============================================
author "Simon Tallmyr - Nosscire"
description “Upstart Script to run Sonarr as a service on Ubuntu/Debian based systems, as well as others”

#Set username for the process. Should probably be what you use for logging in
setuid yourusername

env DIR=/opt/NzbDrone
#This is the install directory. If you installed using a deb package or the Sonarr Repository you do not need to change this

setgid nogroup
start on runlevel [2345]
stop on runlevel [016]

respawn

exec mono --debug $DIR/NzbDrone.exe

==============================================

Yet in a newly discovered “Install NZBDrone” page I found this one-liner:

“Note if respawn is enabled the automatic updates will fail to install”

Could that be the cause of the issue I encountered?

I’m a little too chicken-shit to go playing with it, now that I have it running. :wink:


Though actually I could, now that I think about it. I haven’t invested much into the install and now that I’m familiar with the process I wouldn’t mind blowing everything away and installing again from scratch for testing porpoises. :slight_smile:

If all the fix needs to be is to comment out the Respawn line on the wiki, that could forestall a lot of future heartache.

There have been some improvements to deal with respawn being enabled, so that shouldn’t be it. The update log file from the failed update would be the most telling what the issue is.

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