Fail to update sonarr every time

Sonarr version (exact version):
Version
2.0.0.4374

Mono version (if Sonarr is not running on Windows):
Mono Version
4.2.1 (Stable 4.2.1.102/6dd2d0d Thu 3 Nov 02:49:18 UTC 2016)

OS: Unix

((Debug logs)):
https://pastebin.com/4tUJMFU9

(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)

Description of issue:
Sonarr is trying to update but fails every time. It says it can not find a file in a specified location; however, I see NbzDrone is where it’s supposed to be. I guess I don’t understand the error or why it will not update to the latest version.

Here is the SMALL snippet of the error that’s also included in pastebin above:

17-3-30 13:40:47.6|Info|InstallUpdateService|Deleting old update files
17-3-30 13:40:47.6|Info|InstallUpdateService|Downloading update 2.0.0.4645
17-3-30 13:40:47.8|Info|InstallUpdateService|Verifying update package
17-3-30 13:40:48.0|Info|InstallUpdateService|Update package verified successfully
17-3-30 13:40:48.0|Info|InstallUpdateService|Extracting Update package
17-3-30 13:40:49.0|Info|InstallUpdateService|Update package extracted successfully
17-3-30 13:40:49.0|Info|BackupService|Starting Backup
17-3-30 13:40:50.2|Info|InstallUpdateService|Preparing client
17-3-30 13:40:50.2|Info|InstallUpdateService|Starting update client /media/zdq/user7682/tmp/nzbdrone_update/NzbDrone.Update.exe
17-3-30 13:40:50.2|Info|InstallUpdateService|Sonarr will restart shortly.
17-3-30 13:40:51.4|Error|CommandExecutor|Error occurred while executing task ApplicationUpdate

[v2.0.0.4374] System.ComponentModel.Win32Exception: ApplicationName='mono', CommandLine='--debug /media/zdq/user7682/tmp/nzbdrone_update/NzbDrone.Update.exe 25200 /media/zdq/user7682/tmp/nzbdrone_update /media/zdq/user7682/NzbDrone/NzbDrone.exe ', CurrentDirectory='', Native error= Cannot find the specified file
  at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00352] in /media/zdq/user7682/mono-4.2.1/mcs/class/System/System.Diagnostics/Process.cs:1126 
  at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x0008b] in /media/zdq/user7682/mono-4.2.1/mcs/class/System/System.Diagnostics/Process.cs:1190 
  at System.Diagnostics.Process.Start () [0x0002c] in /media/zdq/user7682/mono-4.2.1/mcs/class/System/System.Diagnostics/Process.cs:1200 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
  at NzbDrone.Common.Processes.ProcessProvider.Start (System.String path, System.String args, System.Collections.Specialized.StringDictionary environmentVariables, System.Action`1 onOutputDataReceived, System.Action`1 onErrorDataReceived) [0x00118] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:167 
  at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) [0x0022d] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Update\InstallUpdateService.cs:134 
  at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) [0x00071] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Update\InstallUpdateService.cs:214 
  at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (NzbDrone.Core.Messaging.Commands.TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x00081] in M:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:77 

Sonarr can’t find mono, you’ll need to make sure it is on the path (the user running Sonarr will need to be able to run mono --version and get the version.

Ok. I tried mono --version and got a response;

mono --version
Mono JIT compiler version 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu  3 Nov 02:49:18 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

Do I need to edit a file somewhere so it finds mono?

That’s from the same user that is running mono? Check ps to see which user Sonarr (via mono) is running as.

I’m not sure what you mean by that.

ps - l did this:

[cs ~] ps l
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
0  1325  1410  1377  20   0 211300 21940 -      Ssl+ pts/1     21:20 irssi
0  1325  6987  6986  20   0 207072 36592 -      Ssl+ pts/153    4:51 irssi
0  1325 22739 22727  20   0  24132  5524 wait   Ss   pts/148    0:00 -bash
0  1325 25005 22739  20   0  11176  2132 -      R+   pts/148    0:00 ps l
0  1325 25197 25196  20   0  13724  2780 wait   Ss+  pts/145    0:00 /bin/bash -
0  1325 25200 25197  20   0 1653304 170800 -    Sl+  pts/145   34:12 /media/zdq/
0  1325 27727 27725  20   0  13728  2952 wait   Ss+  pts/133    0:00 /bin/bash -
0  1325 27738 27727  20   0 2489108 115064 -    Sl+  pts/133   34:09 /opt/rtorre
0  1325 28556 28553  20   0 2144788 166396 -    Ssl+ pts/154   16:13 mono --debu

Looks like it’s the same user (same UID), if it’s failing when Sonarr tries to run it, possible an issue with how Sonarr is being started.

How are you starting Sonarr?

First of all thanks for taking the time to help me. I really appreciate it. I’m starting Sonarr like this:

@reboot screen -dmS sonarr /bin/bash -c export TMPDIR=~/tmp; ~/bin/mono --debug NzbDrone/NzbDrone.exe

or manually by

screen -dmS sonarr mono --debug ~/NzbDrone/NzbDrone.exe

Is there a reason why the first command uses ~/bin/mono, but the second doesn’t?

Does the update fail regardless of the method used to start it?
What if you run mono --debug ~/NzbDrone/NzbDrone.exe without screen under the sonarr user?

I ran mono --debug ~/NzbDrone/NzbDrone.exe and when it started I logged into my web UI to find that it is finally updated automatically to the latest version. I’m not sure what happened here. Did my killing the process again fix it? Did running NzbDrone that way fix it? No idea but I’ll write my box support and update them on their documentation if you have any idea. Thank you for the help.

Screen may be changing how the PATH environment variable works, though that’s just a guess, with the knowledge that it works outside of screen perhaps they can determine why.

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