Not able to update

Hi,

I’m trying to update sonarr from master build 2.0.0.2500 to 2.0.0.2549 on my qnap 459 pro II using mono 3.10 but I keep getting an error.

Message
Update process failed: ApplicationName='mono', CommandLine='/tmp/nzbdrone_update/NzbDrone.Update.exe 16850 /tmp/nzbdrone_update /share/MD0_DATA/.qpkg/NzbDrone/NzbDrone/NzbDrone.exe', CurrentDirectory='', Native error= Cannot find the specified file

Exception
System.ComponentModel.Win32Exception: ApplicationName='mono', CommandLine='/tmp/nzbdrone_update/NzbDrone.Update.exe 16850 /tmp/nzbdrone_update /share/MD0_DATA/.qpkg/NzbDrone/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 

I had this problem before: Update of sonarr not working and ends with error in log and thougth I fixed it but now it comes up again and the fix from that topic is still applied. Any help on getting this fixed is appreciated.

Are you able to run mono --version from a terminal session running as the user that runs mono?

It does sound like an issue with the PATH (maybe it was reset on reboot or something)? Besides that I’m not sure what to suggest looking at.

yes mono --version works fine. I also checked the path and if the symbolic link to mono is still on the path. Are you sure the problem with the cannot find file is mono or can it be sonarr?

Your last comment made me thinking, I think I fixed the issue now. I adjusted the init script to use the fullpath instead of just relying on the directory where the startup script is.

Using the fullpath seems to give sonarr some awareness of his own location when updating/restarting(the restart button was also broken for me). After using the full path it updated fine.

Thank you for your help anyway:)

Not sure I fully understand the solution with the full path as Sonarr wouldn’t know about the path mono was started with, but hopefully that fixes the issues for good.

I hope so. The fix I meant was using the full path like /share/MD0_Data/.qpkg/NzbDrone/NzbDrone/nzbdrone.exe to initially start sonarr. Instead of just using NzbDrone/nzbdrone.exe from the initi script which is located in /share/MD0_Data/.qpkg/NzbDrone. By using the full path sonarr knows the location or something somehow and is able to restart from the started instance which isn’t possible without using the full path to the executable initially.

Another update and the same problem again.

Message
Update process failed: ApplicationName='mono', CommandLine='/tmp/nzbdrone_update/NzbDrone.Update.exe 18415 /tmp/nzbdrone_update /share/MD0_DATA/.qpkg/NzbDrone/NzbDrone/NzbDrone.exe', CurrentDirectory='', Native error= Cannot find the specified file

Exception
System.ComponentModel.Win32Exception: ApplicationName='mono', CommandLine='/tmp/nzbdrone_update/NzbDrone.Update.exe 18415 /tmp/nzbdrone_update /share/MD0_DATA/.qpkg/NzbDrone/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 

Help is appreciated

create a symbolic link for mono to your bin directory. Should be fine after that

eg:
ln -s /opt/mono/bin/mono /bin

hey @clijedi

Thank you but I already did that and it seemed to fix the issue initially but for the next update it was broken again even when mono was on the path. Maybe the path is exported after mono is started or something.

I’ve added this symbolic link to mono in the optware directory which is exported to the path after startup. This is because all modifications to the path and some parts of the file system will be removed on a reboot of my qnap(this is default behaviour of qnap firmware, it sucks I know).

I think the update problem is the same probelm as the restart button in sonarr which isn’t working. When the qnap starts sonarr automatically on startup the restart button doesn’t work, sonarr just doesn’t come back after it shutdowns. When I restart it manually afterwards the restart button works, I guess the same is with the update where everything went fine except the restart. First start of sonarr(automatically with qnap) makes the update fail but after a manual restart it works.

Can it be that in the session where sonarr/mono is running the mono variable isn’t known yet since it’s added to the path later? This would explain why the update and restart button works after a manual restart.

@markus101 what command is exactly used to restart sonarr with the restart button in the system tab? Incase it’s just using “mono” instead of the path to mono(like “/usr/local/bin/mono”) which was used initially, would it be possible to change this to use the mono path which is used to run mono at the moment the restart button is pressed? This way it wouldn’t be a problem if mono is on the path or not. Same for the restart after an update.

Its calls mono /path/to/NzbDrone.exe.

What may work for you is to explicitly add mono to the path via the script that starts Sonarr. This concept is used in a lot of applications to set environment variables that are required for the application to function (Hubot comes to mind, as you set passwords and such via that mechanism).

On Ubuntu you can use: export PATH=/path/to/dir:$PATH I’d expect it to be something similar on QNAP.

1 Like

Great! That did the trick, it took me some time to figure out exactly what I had to export since it seems some directories are added later to the path after boot.

For anyone else who want to fix their qnap:

export PATH=/usr/local/bin:$PATH

did the trick for me

1 Like

I am seeing the same behavior as noted by killer8. In that updates and restarts do not work when Sonarr is started with the QNAP on start-up, but then starts working after manually turning the app off and on again in the QNAP App Center.

Killer8 where did you add the export command?

Thanks! Jeff

I added this in the start method of the init script in /share/MD0_DATA/NzbDrone/Nzbdrone.sh. Just before where it is really started.