Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updater fails to enumerate processes on FreeBSD #705

Closed
Taloth opened this issue Jul 21, 2015 · 16 comments
Closed

Updater fails to enumerate processes on FreeBSD #705

Taloth opened this issue Jul 21, 2015 · 16 comments

Comments

@Taloth
Copy link
Member

Taloth commented Jul 21, 2015

15-7-21 10:48:38.7|Debug|ProcessProvider|Finding process with Id:60550
15-7-21 10:48:38.7|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 /usr/ports/lang/mono/work/mono-4.0.1/mcs/class/System/System.Diagnostics/Process.cs:834 
  at NzbDrone.Common.Processes.ProcessProvider.GetProcessById (Int32 id) [0x00023] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:73 
  at NzbDrone.Common.Processes.ProcessProvider.Exists (Int32 processId) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Processes\ProcessProvider.cs:56 
  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 
@markus101
Copy link
Member

Same issue as: #584

@florisrobbemont
Copy link

I can test this if you want. Have a FreeBSD box running here.

@Taloth
Copy link
Member Author

Taloth commented Jul 21, 2015

@markus101 Ah, FreeNas, that's why it didn't pop up in my search.

@markus101
Copy link
Member

This was a mono bug, fixed in 4.0.4.

@AlanValentine
Copy link

still happens even after freebsd gets an update today to

Mono JIT compiler version 4.2.1 (Stable 4.2.1.102/6dd2d0d Tue Nov 24 21:59:25 UTC 2015)

@djmixman
Copy link

Same problem.

15-12-27 10:29:13.7|Info|InstallUpdateService|Verifying requirements before update...
15-12-27 10:29:13.7|Debug|ProcessProvider|Finding process with Id:92371
15-12-27 10:29:13.7|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 

Here is my mono information if it helps any:

Name           : mono
Version        : 4.2.1.124
Installed on   : Sun Dec 27 10:24:53 2015 CST
Origin         : lang/mono
Architecture   : freebsd:10:x86:64
Prefix         : /usr/local
Categories     : lang
Licenses       :
Maintainer     : mono@FreeBSD.org
WWW            : http://www.mono-project.com/
Comment        : Open source implementation of .NET Development Framework
Shared Libs provided:
        libmonosgen-2.0.so.1
        libmonoboehm-2.0.so.1
        libikvm-native.so
        libmono-profiler-iomap.so.0
        libmono-profiler-aot.so.0
        libmono-profiler-log.so.0
        libMonoSupportW.so
        libMonoPosixHelper.so
Annotations    :
        cpe            : cpe:2.3:a:mono:mono:4.2.1.124:::::freebsd10:x64
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 156MiB
Description    :
Mono is an open source implementation of .NET Development Framework. Its
objective is to enable UNIX developers to build and deploy cross-platform
.NET Applications. The project implements various technologies developed by
Microsoft that have now been submitted to the ECMA for standardization.

Mono provides the necessary software to develop and run .NET client and
server applications on BSD, Linux, Solaris, Mac OS X, Windows, and Unix.

@markus101
Copy link
Member

This is a mono issue, it doesn't enumerate the processes, though it used to in a previous version, someone responsible for mono on FreeBSD will need to investigate.

@hevvieevvie
Copy link

While I appreciate your response markus, but since your application uses mono don't you think you should investigate the reason Sonarr isn't fully functional for all users?

@djmixman
Copy link

I think it would be nice for him to do that but I don't think he should have to since it's not his program. However if he knows whats causing it in detail, a detailed bug report to mono would be great!

@kayone
Copy link
Member

kayone commented Jan 17, 2016

@hevvieevvie we would love to be able to investigate all issues, but unfortunately we just don't have the the time and resources, that's why we recommend that you run sonarr on either Windows, Linux or OSX.

@AlanValentine
Copy link

best focus our efforts on chasing the freebsd mono port maintainers for
help on this

On Sun, Jan 17, 2016 at 5:56 PM, Keivan Beigi notifications@github.com
wrote:

@hevvieevvie https://github.com/hevvieevvie we would love to be able to
investigate all issues, but unfortunately we just don't have the the time
and resources, that's why we recommend that you run sonarr on either
Windows, Linux or OSX.


Reply to this email directly or view it on GitHub
#705 (comment).

@Taloth
Copy link
Member Author

Taloth commented Jan 17, 2016

Btw. here's the relevant code in mono.
procfs is deprecated on freebsd, although it can be enabled. Which was the workaround until recently.
That leaves KERN_PROC(2). Dunno if FreeBSD support KERN_PROC2 or just KERN_PROC. Either way mono needs to be compiled with the appropriate option, which should happen automatically.
Biggest thing is the USE_SYSCTL, coz without those the fallback is /proc, which you don't want on FreeBSD.

Please note this preprocessor statement, which clearly enables USE_SYSCTL on FreeBSD.

So question is whether mono is compiled with the appropiate settings, and whether the syscall is working properly on BSD. Obviously also matters what the FreeBSD jails do, but that's way outside my area of knowledge.

This is something that needs to be investigated by someone experienced with FreeBSD, not us.

@iainsmacleod
Copy link

Is there some way I can manually update? Extract zip and deploy files?

@markus101
Copy link
Member

Yes, should be the same way as installing it the first time. If you have any issues, please open a thread on the support forums.

@iainsmacleod
Copy link

OK, so there was a couple of things I had to do, since it isn't the latest package source I am looking at.

I did the following:

nano /etc/pkg/FreeBSD.conf

Changed from quarterly to latest:

url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",

Update the pkg DB:

pkg update

Then installed Sonarr

pkg install sonarr

@hevvieevvie
Copy link

How about we go about this another way. Since it looks like mono will be an issue for FreeBSD users, is there any way Sonarr can detect the OS and if its running BSD change the update commands to:

fetch http://download.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz
tar -xzvf NzbDrone.master.tar.gz
ee /etc/rc.d/run_drone

This is how I'm updating and seems to work fine. Of course a bit hacky and I'm not aware if it could cause other issues but just spit-balling?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants