Update process broken on linux since 2.0.0.2788

Hi,

since the update 2.0.0.2788, the updater is not able to find the running process ID of the parent process anymore. This seems to be a regression in the Nzbdrone_Updater.exe. Manual update (i.e. copying the files) works.

Update log:

15-2-5 09:35:23.5|Info|UpdateApp|Starting NzbDrone Update Client
15-2-5 09:35:24.0|Info|UpdateApp|Updating NzbDrone to version 2.0.0.2804
15-2-5 09:35:24.3|Debug|UpdateApp|NzbDrone process ID: 29483
15-2-5 09:35:24.3|Debug|UpdateApp|Arguments:
15-2-5 09:35:24.3|Debug|UpdateApp|  29483
15-2-5 09:35:24.3|Debug|UpdateApp|  /tmp/nzbdrone_update
15-2-5 09:35:24.3|Debug|UpdateApp|  /usr/share/NzbDrone/NzbDrone.exe
15-2-5 09:35:24.3|Debug|UpdateApp|Using executing application: /usr/share/NzbDrone/NzbDrone.exe
15-2-5 09:35:24.3|Debug|UpdateApp|Executable location: /usr/share/NzbDrone/NzbDrone.exe
15-2-5 09:35:24.3|Info|UpdateApp|Starting update process. Target Path:/usr/share/NzbDrone
15-2-5 09:35:24.3|Info|InstallUpdateService|Verifying requirements before update...
15-2-5 09:35:24.3|Debug|ProcessProvider|Finding process with Id:29483
15-2-5 09:35:24.3|Warn|ProcessProvider|Unable to find process with ID 29483
15-2-5 09:35:24.3|Fatal|UpdateApp|An error has occurred while applying update package.

System.ArgumentException: Process with ID doesn't exist 29483
  at NzbDrone.Update.UpdateEngine.InstallUpdateService.Verify (System.String targetFolder, Int32 processId) [0x00000] in <filename unknown>:0 
  at NzbDrone.Update.UpdateEngine.InstallUpdateService.Start (System.String installationFolder, Int32 processId) [0x00000] in <filename unknown>:0 
  at NzbDrone.Update.UpdateApp.Start (System.String[] args) [0x00000] in <filename unknown>:0 
  at NzbDrone.Update.UpdateApp.Main (System.String[] args) [0x00000] in <filename unknown>:0 

The process 29483 certainly exists before and after the update attempts. It is the right process (i.e. mono /usr/share/Nzbdrone/Nzbdrone.exe). Permissions are ok.

Do I need to report this elsewhere, too? Thanks. Mono version is 3.12, system is ARM Gentoo.

How do you have Sonarr running on that system? (Startup process and user)
If you restart Sonarr do you have the same issue?

I run Sonarr as a normal user in a screen environment (to get it detached from the console). No init system involved. The user is the owner of all Sonarr files. The update files are downloaded into the /tmp folder and are accessible by the user. Actually, when I did the update for 2.0.0.2788 manually, I did it as the user, not as root.

Yes, same issue. I have restarted Sonarr several times before the manual update and after. Today, a new update showed up with the same problems. Beforehand, Sonarr ran happily updating for probably 3 months.

Can it be related to the mono version number? The mono update from 3.10 to 3.12 happened probably a few days/weeks back. I could easily switch back and let you know.

The mono version isn’t an issue in this case, but I wonder if screen is somehow causing issues (why it wouldn’t before and now would is a mystery).

If you run Sonarr via console (not in a screen session) and try to update do you see the same issue?

I started it from a console and the problem remains.

Which version of mono were you running before? Could you try using that version instead? I was just reminded that there were some issues in 3.12, which might actually be the issue here.

Did the update to 2.0.0.2788 happen through the updater?

I ran 3.10.0 beforehand. Sure, I will emerge 3.10.0 and let you know. The 2788 did not happen through the updater. It was the first time the update failed. I installed it manually. But the new update (2.0.0.2804) fails again.

I’ll let you know about the mono version change outcome.

I can confirm that the update process works properly with mono 3.10.0.

15-2-6 11:03:13.1|Info|UpdateApp|Starting NzbDrone Update Client
15-2-6 11:03:20.2|Info|UpdateApp|Updating NzbDrone to version 2.0.0.2804
15-2-6 11:03:20.5|Debug|UpdateApp|NzbDrone process ID: 18408
15-2-6 11:03:20.5|Debug|UpdateApp|Arguments:
15-2-6 11:03:20.5|Debug|UpdateApp|  18408
15-2-6 11:03:20.5|Debug|UpdateApp|  /tmp/nzbdrone_update
15-2-6 11:03:20.5|Debug|UpdateApp|  /usr/share/NzbDrone/NzbDrone.exe
15-2-6 11:03:20.5|Debug|UpdateApp|Using executing application: /usr/share/NzbDrone/NzbDrone.exe
15-2-6 11:03:20.5|Debug|UpdateApp|Executable location: /usr/share/NzbDrone/NzbDrone.exe
15-2-6 11:03:20.5|Info|UpdateApp|Starting update process. Target Path:/usr/share/NzbDrone
15-2-6 11:03:20.5|Info|InstallUpdateService|Verifying requirements before update...
15-2-6 11:03:20.5|Debug|ProcessProvider|Finding process with Id:18408
15-2-6 11:03:21.2|Debug|ProcessProvider|Found process 18408:mono-sgen [/usr/bin/mono-sgen]
15-2-6 11:03:21.2|Info|InstallUpdateService|Verifying Update Folder
15-2-6 11:03:21.2|Info|ProcessProvider|[18408]: Killing process
15-2-6 11:03:21.2|Info|ProcessProvider|[18408]: Waiting for exit
15-2-6 11:03:21.2|Info|ProcessProvider|[18408]: Process terminated successfully
15-2-6 11:03:21.2|Info|TerminateNzbDrone|Killing all running processes
15-2-6 11:03:21.5|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone.Console
15-2-6 11:03:21.5|Debug|ProcessProvider|Found 0 processes to kill
15-2-6 11:03:21.8|Debug|ProcessProvider|Found 0 processes with the name: NzbDrone
15-2-6 11:03:21.8|Debug|ProcessProvider|Found 0 processes to kill
15-2-6 11:03:21.9|Info|BackupAndRestore|Creating backup of existing installation

[movement of files, skipped due to character number limitation of the forum software]

15-2-6 11:03:22.5|Info|StartNzbDrone|Starting NzbDrone
15-2-6 11:03:22.5|Info|StartNzbDrone|Starting NzbDrone.exe
15-2-6 11:03:22.5|Debug|ProcessProvider|Starting mono /usr/share/NzbDrone/NzbDrone.exe /nobrowser
15-2-6 11:03:22.5|Info|UpdateApp|Update compleded successfully

Wow. Thanks for the info. I;ll give 3.12 a shot on another OS and see if it has a similar issue.

Thanks again for the update.