Update fails when started from Crontab without PATH including /usr/local/bin

Continuing the discussion from Not able to update:

This specific situation wasn’t spelled out in that thread, so I wanted to address it. That thread is closed.

I had Sonarr setup to start in Crontab of user sonarr:

@reboot /usr/local/bin/mono /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe --nobrowser

When attempting to update Sonarr, I got the following error.

Message:

Error occurred while executing task ApplicationUpdate: ApplicationName=‘mono’, CommandLine=‘–debug /tmp/nzbdrone_update/NzbDrone.Update.exe 70635 /tmp/nzbdrone_update /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe /nobrowser’, CurrentDirectory=‘’, Native error= Cannot find the specified file

Exception:

System.ComponentModel.Win32Exception: ApplicationName=‘mono’, CommandLine=‘–debug /tmp/nzbdrone_update/NzbDrone.Update.exe 70635 /tmp/nzbdrone_update /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe /nobrowser’, CurrentDirectory=‘’, Native error= Cannot find the specified file
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0xad9b20 + 0x01198> in :0
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0xad98f0 + 0x000f0> in :0
at System.Diagnostics.Process.Start () <0xad9870 + 0x0005a> in :0
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.Action1 onOutputDataReceived, System.Action1 onErrorDataReceived) <0xad87f0 + 0x006f7> in :0
at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) <0xace120 + 0x004ac> in :0
at NzbDrone.Core.Update.InstallUpdateService.Execute (NzbDrone.Core.Update.Commands.ApplicationUpdateCommand message) <0x9eebe0 + 0x00190> in :0
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (NzbDrone.Core.Messaging.Commands.TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) <0x327590 + 0x001f1> in :0

Solved by adding PATH=/usr/local/bin:$PATH in Crontab.

@reboot PATH=/usr/local/bin:$PATH /usr/local/bin/mono /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe --nobrowser

Nope! Not sure this error has any relation to the previous problem, though.

16-1-17 09:50:38.7|Info|UpdateApp|Starting Sonarr Update Client
16-1-17 09:50:39.0|Info|UpdateApp|Updating Sonarr to version 2.0.0.3732
16-1-17 09:50:39.3|Debug|UpdateApp|NzbDrone process ID: 41405
16-1-17 09:50:39.3|Debug|UpdateApp|Arguments:
16-1-17 09:50:39.3|Debug|UpdateApp|  41405
16-1-17 09:50:39.3|Debug|UpdateApp|  /tmp/nzbdrone_update
16-1-17 09:50:39.3|Debug|UpdateApp|  /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe
16-1-17 09:50:39.3|Debug|UpdateApp|  /nobrowser
16-1-17 09:50:39.3|Debug|UpdateApp|Using executing application: /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe
16-1-17 09:50:39.3|Debug|UpdateApp|Executable location: /Volumes/Hipdata/Services/Sonarr/NzbDrone/NzbDrone.exe
16-1-17 09:50:39.3|Info|UpdateApp|Starting update process. Target Path:/Volumes/Hipdata/Services/Sonarr/NzbDrone
16-1-17 09:50:39.3|Info|InstallUpdateService|Verifying requirements before update...
16-1-17 09:50:39.3|Debug|ProcessProvider|Finding process with Id:41405
16-1-17 09:50:39.3|Fatal|UpdateApp|An error has occurred while applying update package.

System.NotSupportedException: This system does not support EnumProcesses
  at (wrapper managed-to-native) System.Diagnostics.Process:GetProcesses_internal ()
  at System.Diagnostics.Process.GetProcesses () [0x00000] in /wrkdirs/usr/ports/lang/mono/work/mono-4.2.1/mcs/class/System/System.Diagnostics/Process.cs:861 
  at NzbDrone.Common.Processes.ProcessProvider.GetProcessById (Int32 id) [0x00023] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:75 
  at NzbDrone.Common.Processes.ProcessProvider.Exists (Int32 processId) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:58 
  at NzbDrone.Update.UpdateEngine.InstallUpdateService.Verify (System.String targetFolder, Int32 processId) [0x0005c] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateEngine\InstallUpdateService.cs:67 
  at NzbDrone.Update.UpdateEngine.InstallUpdateService.Start (System.String installationFolder, Int32 processId) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Update\UpdateEngine\InstallUpdateService.cs:79 
  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 
1 Like

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

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