Update doesn't work on FreeNAS

Hello all,

After re-installing NzbDrone (because it was constantly hanging, I blamed Mono and installed it into a fresh jail) the update aren’t working any more.

NzbDrone is installed in a FreeNas Jail with the latest Mono. The error I’m getting is:

14-11-29 12:05:11.6|Debug|mono|Starting mono /tmp/nzbdrone_update/NzbDrone.Update.exe 41971 /tmp/nzbdrone_update /opt/NzbDrone/NzbDrone.exe
14-11-29 12:05:11.6|Error|InstallUpdateService|Update process failed

System.ComponentModel.Win32Exception: ApplicationName='mono', CommandLine='/tmp/nzbdrone_update/NzbDrone.Update.exe 41971 /tmp/nzbdrone_update /opt/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) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
  at NzbDrone.Common.Processes.ProcessProvider.Start (System.String path, System.String args, System.Action`1 onOutputDataReceived, System.Action`1 onErrorDataReceived) [0x00000] in <filename unknown>:0 
  at NzbDrone.Core.Update.InstallUpdateService.InstallUpdate (NzbDrone.Core.Update.UpdatePackage updatePackage) [0x00000] in <filename unknown>:0 

When I ran this command using root in an SSH session it all seems to work and NzbDrone is updated.

The update files at that location exist and the account running NzbDrone has access to those files.

Does anyone might have an idea what’s going on here?

The only thing I can think of is permissions, especially since it works as root, but not as the user running Sonarr. Its a little odd since its able to extract the files, but not execute them and AFAIK execute isn’t needed on the files, since mono is the app being execute.

Could it be possible that the mono executable is the file it cannot find? I assume that if it were permissions the exception would be Permission Denied (or something to that effect).

The exception seems to be originating from the NzbDrone.Core.Update.InstallUpdateService.InstallUpdate method (according to the stack trace), and not from the actual update executable. I’ve checked the ProcessProvider class and if that class logs it should show up in the stack trace as the originating call (which it doesn’t).

Is there are way you could use the full path to the mono executable? Or is there a setting I can do to include the PATH to mono as a default for my NzbDrone user?

PS: Kudos on the clean codebase! Very interesting to read :slight_smile:

Ahh yes, not finding mono is more likely.

Not sure how to add something to the PATH on FreeNAS, but thats what you’d need to do, or symlink it to a directory already on the path.