Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
[How-To] Manually upgrade mono from 5.10 to 5.20 in a FreeNAS Jail

[How-To] Manually upgrade mono from 5.10 to 5.20 in a FreeNAS Jail

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE

minituff

Neophyte
Joined
Feb 13, 2020
Messages
10
Update:

It looks like Sonarr doesn't like Mono 6.8:
Code:
[v3.0.3.780] System.UnauthorizedAccessException: Permission denied ---> Mono.Unix.UnixIOException: Permission denied [EACCES].
   --- End of inner exception stack trace ---
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00000] in /usr/ports/lang/mono/work/mono-6.8.0.105/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs:478
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (System.Int32 retval) [0x00004] in /usr/ports/lang/mono/work/mono-6.8.0.105/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs:491
  at Mono.Unix.UnixFileSystemInfo.CreateLink (System.String path) [0x0000c] in /usr/ports/lang/mono/work/mono-6.8.0.105/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs:278
  at NzbDrone.Mono.Disk.DiskProvider.TryCreateHardLink (System.String source, System.String destination) [0x00013] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Mono\Disk\DiskProvider.cs:354 


Looks like others are having issues with mono 6.8 with Sonarr

Does anyone have an updated guide on how to get mono 5.20.x working? I tried the original guide, but I was running into errors.

Thanks
 

zamana

Member
Joined
Jun 4, 2017
Messages
115
Update:

It looks like Sonarr doesn't like Mono 6.8:
Code:
[v3.0.3.780] System.UnauthorizedAccessException: Permission denied ---> Mono.Unix.UnixIOException: Permission denied [EACCES].
   --- End of inner exception stack trace ---
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00000] in /usr/ports/lang/mono/work/mono-6.8.0.105/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs:478
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (System.Int32 retval) [0x00004] in /usr/ports/lang/mono/work/mono-6.8.0.105/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs:491
  at Mono.Unix.UnixFileSystemInfo.CreateLink (System.String path) [0x0000c] in /usr/ports/lang/mono/work/mono-6.8.0.105/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs:278
  at NzbDrone.Mono.Disk.DiskProvider.TryCreateHardLink (System.String source, System.String destination) [0x00013] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Mono\Disk\DiskProvider.cs:354 


Looks like others are having issues with mono 6.8 with Sonarr

Does anyone have an updated guide on how to get mono 5.20.x working? I tried the original guide, but I was running into errors.

Thanks
I'm running Sonarr 2.0.0.5344 and Mono 6.8.0.105 (grabbed from comment #75) with no issues.

NOTE: I'm not running Sonarr "plugin"; I created the jail and installed everything manually, that's the way I like it.
 

minituff

Neophyte
Joined
Feb 13, 2020
Messages
10
I'm running Sonarr 2.0.0.5344 and Mono 6.8.0.105 (grabbed from comment #75) with no issues.

NOTE: I'm not running Sonarr "plugin"; I created the jail and installed everything manually, that's the way I like it.
Turns out the permission error was on the TV show season file and not from within mono itself. I installed mono 5.20 and still ran into the issue, which lead me to the real solution. I'll create an updated post with how I installed mono 5.20.
 

minituff

Neophyte
Joined
Feb 13, 2020
Messages
10
How to install mono 5.20.1.34 on FreeNAS

Setup packages to be installed on jail creation (using a temp file)
echo '{"pkgs":["mono","nano","perl5","llvm90","libepoxy-1.5.4"]}' > /tmp/pkg.json

Create jail
iocage create -n "mono_patch" -p /tmp/pkg.json -r 11.3-RELEASE ip4_addr="vnet0|192.168.1.65/24" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" boot="on" resolver="none"

Remove temporary file
rm /tmp/pkg.json

Console into the newly created jail (if the jail is down you can start it with iocage start mono_patch)
iocage console mono_patch

Verify existing perl and mono version. Mono should be (or was at the time of making this) 5.10.1.57 and Perl should be v5.30.2
perl --version
mono --version


Update and extract packages
pkg update && pkg upgrade
portsnap fetch extract
pkg update && pkg upgrade
pkg delete -y '*proto'


Grab the patch file and send it to a file
fetch 'https://bz-attachments.freebsd.org/attachment.cgi?id=205999' -o /tmp/mono-patch-5.20.1.34

Go into the mono directory
cd /usr/ports/lang/mono

Patch the file
patch -E < /tmp/mono-patch-5.20.1.34

Edit the Makefile and change the 'PORTVERSION=' from 5.10.1.57 to 5.20.1.34 then save and exit. It is right at the top few lines of the file.
nano Makefile

Run the following command and remove the "%%HEAPVIZ%%" text from any files that have this text. Remove the text only, not the entire line
Common files that contain this text are /usr/ports/lang/mono/pkg-plist and /usr/ports/lang/mono/work/.PLIST.mktmp
For example: %%HEAPVIZ%%/bin/foo/bar would become "%%HEAPVIZ%%"/foo/bar

grep -r %%HEAPVIZ%% /usr/ports/lang/mono/*

Ensure all instances of "%%HEAPVIZ%%" have been removed before running the final command

This will build mono 5.20. This will take time--probably hours. Be patient.
make -DBATCH install clean
make -DBATCH deinstall reinstall


Verify the version of mono
mono --version


If the build completes successfully you can turn this build into a package and simply install it where ever you'd like
make package
The package will be in the following location: usr/ports/lang/mono/work/pkg
To use the new package, move it into the jail of your choice and run: pkg install <filenanme>.txz

CONGRATS


I also uploaded the package to Mediafire if anyone is interested in skipping these steps:
<https://www.mediafire.com/file/qhmph9utdkvyfj3/mono-5.20.1.34_3.txz/file>
 

mistermanko

Member
Joined
Jan 27, 2020
Messages
240
To understand that correctly, this is to make a jail just for the creation of one version of mono pkg? Or does this jail serves its purpose later on, if to say a newer version is released?
 

minituff

Neophyte
Joined
Feb 13, 2020
Messages
10
To understand that correctly, this is to make a jail just for the creation of one version of mono pkg? Or does this jail serves its purpose later on, if to say a newer version is released?
That will create a jail named mono_patch and update mono to 5.20.1.34 inside that jail only. The entire process takes a few hours and maxes out the CPU of your FreeNAS box. But, the very last command (make package) will create a tarball file that can be easily installed in any jail to upgrade mono.

You could also try downloading the tarball that I uploaded to Mediafire in post #104 for mono to 5.20.1.34 or version 6.8 that was uploaded in post #75. Once you have the tarball file saved outside the jail you could probably delete the mono_patch jail (iocage stop mono_patch and then iocage destroy mono_patch). Installing the tarball file is as simple as pkg install <filenanme>.txz and it only takes a few seconds--so you can repeat that on any jail that needs to update mono.

The reason I created a new jail was just to remove variables. You could probably upgrade an existing jail, but that is not something I tested. It worked really well for me to follow these steps and export the tarball and just install that pkg on my other jails.

For future upgrades, I haven't tested the guide on upgrade mono twice. I only know it works going from mono 5.10.1.57 to 5.20.1.34. So if you wanted to go through this process to patch to another version starting from anything other than 5.10.1.57 I would destroy the jail and start the process over.
 

RobTheRed

Member
Joined
Feb 8, 2016
Messages
25
@minituff I followed your directions in post #104, but during the make I end up getting something like this:
Code:
Move: bin/sphinx-quickstart --> bin/sphinx-quickstart-3.7
Link: @bin/sphinx-quickstart --> bin/sphinx-quickstart-3.7
====> Compressing man pages (compress-man)
===>  Installing for py37-sphinx18-1.8.5_1,1
===>  Checking if py37-sphinx18 is already installed
===>   Registering installation for py37-sphinx18-1.8.5_1,1 as automatic
[mono-patch] Installing py37-sphinx18-1.8.5_1,1...
pkg-static: py37-sphinx18-1.8.5_1,1 conflicts with py37-sphinx-3.0.2,1 (installs files into the same place).  Problematic file: /usr/local/bin/sphinx-apidoc-3.7
*** Error code 70

Stop.
make[5]: stopped in /usr/ports/textproc/py-sphinx18
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/devel/llvm80
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/graphics/libepoxy
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11-servers/xorg-vfbserver
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/mono



Any tips on resolving this? I'll try to use your tarball in #104 for the time-being, but I would like to figure out what this issue is.
 

minituff

Neophyte
Joined
Feb 13, 2020
Messages
10
@minituff I followed your directions in post #104, but during the make I end up getting something like this:
Code:
Move: bin/sphinx-quickstart --> bin/sphinx-quickstart-3.7
Link: @bin/sphinx-quickstart --> bin/sphinx-quickstart-3.7
====> Compressing man pages (compress-man)
===>  Installing for py37-sphinx18-1.8.5_1,1
===>  Checking if py37-sphinx18 is already installed
===>   Registering installation for py37-sphinx18-1.8.5_1,1 as automatic
[mono-patch] Installing py37-sphinx18-1.8.5_1,1...
pkg-static: py37-sphinx18-1.8.5_1,1 conflicts with py37-sphinx-3.0.2,1 (installs files into the same place).  Problematic file: /usr/local/bin/sphinx-apidoc-3.7
*** Error code 70

Stop.
make[5]: stopped in /usr/ports/textproc/py-sphinx18
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/devel/llvm80
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/graphics/libepoxy
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11-servers/xorg-vfbserver
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/mono



Any tips on resolving this? I'll try to use your tarball in #104 for the time-being, but I would like to figure out what this issue is.

@RobTheRed which step is giving you this error?
 

ChaosBlades

Member
Joined
Jul 4, 2015
Messages
99
Cross post from https://www.ixsystems.com/community/threads/trying-to-get-mono-5-20-into-a-jail.83124/

Here is a mono-6.8.0.96.txz package. You should be able to place it in your jailyou want to install mono on. Navigate to that folder then run 'pkg install mono-6.8.0.96.txz'. You should be good to go then. I have been using this version for months with no issues on sonarr, radarr, lidarr, and jackett.


The port has been updated since the last patch was created so it doesn't work anymore from my understanding. The code review thread to actually get a version bump has not had any updates for 2 months and .net core on FreeBSD has not made much progress. So we are basically stuck on 5.10 except for the 5.20 package on my original thread and the one I have linked above.
 

jasonsansone

Member
Joined
Jul 18, 2019
Messages
79
Cross post from https://www.ixsystems.com/community/threads/trying-to-get-mono-5-20-into-a-jail.83124/

Here is a mono-6.8.0.96.txz package. You should be able to place it in your jailyou want to install mono on. Navigate to that folder then run 'pkg install mono-6.8.0.96.txz'. You should be good to go then. I have been using this version for months with no issues on sonarr, radarr, lidarr, and jackett.


The port has been updated since the last patch was created so it doesn't work anymore from my understanding. The code review thread to actually get a version bump has not had any updates for 2 months and .net core on FreeBSD has not made much progress. So we are basically stuck on 5.10 except for the 5.20 package on my original thread and the one I have linked above.
Here is a repository of txz packages. At present there is 6.4.0.198, 6.8.0.96, and 6.8.0.105.

https://sansonehowell-my.sharepoint...pLhYraiy74XuUBzWXb6l_XwkzUVoc8BzOf1g?e=l702tr

Password is "Mono".
 

ChaosBlades

Member
Joined
Jul 4, 2015
Messages
99

bollar

Senior Member
Joined
Oct 28, 2012
Messages
353
Run the following command and remove the "%%HEAPVIZ%%" text from any files that have this text. Remove the text only, not the entire line
Common files that contain this text are /usr/ports/lang/mono/pkg-plist and /usr/ports/lang/mono/work/.PLIST.mktmp
For example: %%HEAPVIZ%%/bin/foo/bar would become "%%HEAPVIZ%%"/foo/bar
I assume you meant:

%%HEAPVIZ%%/bin/foo/bar would become /bin/foo/bar ?
 

rknaub

Member
Joined
Jan 31, 2017
Messages
62
I actually ended up figuring it out thanks to comment #75 by jasonsansone. The install ran perfectly.

---- How I did it ----
  1. Follow the link (comment #75 by jasonsansone) go to the link and download mono-6.8.0.105.txz
    1. https://www.ixsystems.com/community...20-in-a-freenas-jail.78871/page-4#post-573573
  2. Move the file into your Sonarr jail
    1. I used FileZilla to transfer tile to /tmp/mono-6.8.0.105.txz in my Jail
  3. Install the package (from inside the jail)
    1. pkg install /tmp/mono-6.8.0.105.txz


I was trying to figure all this out to upgrade Sonarr to V3 on my Freenas machine. I created a guide in my reddit post if anyone is interested:
Is it safe to update mono using this method, for my Radarr jail? It worked great for Sonarr and Lidarr, thank you!!!
 

Mstrofshadows

Newbie
Joined
Mar 9, 2016
Messages
3
I actually ended up figuring it out thanks to comment #75 by jasonsansone. The install ran perfectly.

---- How I did it ----
  1. Follow the link (comment #75 by jasonsansone) go to the link and download mono-6.8.0.105.txz
    1. https://www.ixsystems.com/community...20-in-a-freenas-jail.78871/page-4#post-573573
  2. Move the file into your Sonarr jail
    1. I used FileZilla to transfer tile to /tmp/mono-6.8.0.105.txz in my Jail
  3. Install the package (from inside the jail)
    1. pkg install /tmp/mono-6.8.0.105.txz


I was trying to figure all this out to upgrade Sonarr to V3 on my Freenas machine. I created a guide in my reddit post if anyone is interested:

I tried this and got the following while installing package:

Code:
New packages to be INSTALLED:
        mono: 6.8.0.96

Number of packages to be installed: 1

The process will require 267 MiB more space.

Proceed with this action? [y/N]: y
[sonarr_1] [1/1] Installing mono-6.8.0.96...
[sonarr_1] [1/1] Extracting mono-6.8.0.96: 100%
Shared object "libinotify.so.0" not found, required by "mono"
pkg: POST-INSTALL script failed


I couldn't find anything detailing libinotify, any advice?
 

jasonsansone

Member
Joined
Jul 18, 2019
Messages
79
I tried this and got the following while installing package:

Code:
New packages to be INSTALLED:
        mono: 6.8.0.96

Number of packages to be installed: 1

The process will require 267 MiB more space.

Proceed with this action? [y/N]: y
[sonarr_1] [1/1] Installing mono-6.8.0.96...
[sonarr_1] [1/1] Extracting mono-6.8.0.96: 100%
Shared object "libinotify.so.0" not found, required by "mono"
pkg: POST-INSTALL script failed


I couldn't find anything detailing libinotify, any advice?
Try running:

pkg-static install -f pkg
pkg update && pkg upgrade
pkg install /tmp/mono-6.8.0.105.txz
 

jasonsansone

Member
Joined
Jul 18, 2019
Messages
79
Strange, I just installed all of these the other day after upgrading to the 12 Beta. Wha version of FreeNAS? Are you installing to a plug-in jail or custom jail? Have you created a new jail just to try test installing mono in to?
 

Mstrofshadows

Newbie
Joined
Mar 9, 2016
Messages
3
Strange, I just installed all of these the other day after upgrading to the 12 Beta. Wha version of FreeNAS? Are you installing to a plug-in jail or custom jail? Have you created a new jail just to try test installing mono in to?
Well I'm surprised it has worked up until now I'm still on 9.3 (I know take it easy on me).
plug-in jail (this all came to my attention because Sonarr stopped working)
I have installed mono of various other jails (maybe a few months ago no) but no idea what version as everything worked without me having to look into it.
 
Top