Roon Core - Build 571 - won't boot on NixOS VM (Linux)

Core Machine (Operating system/System info/Roon build number)

Description Of Issue

Since build 571, it seems that the new binary is trying to use a Mono Library that’s not available in Linux. It segfaults when booting. Up until build 555, Roon would boot without any issues on my Linux (NixOS) Virtual Machine.

Here’s the logs from systemd when failing to boot:

Started Roon Server.
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Syscall' threw an exception. ---> System.DllNotFoundException: MonoPosixHelper
  at (wrapper managed-to-native) Mono.Unix.Native.Syscall.get_at_fdcwd()
  at Mono.Unix.Native.Syscall..cctor () [0x0000a] in <61b3b2178cd3413d9a921a61ee10e8cb>:0
   --- End of inner exception stack trace ---
  at Base.Unix.getuid () [0x00000] in <1ce4ef8ec6a14cbf9a278ce947152654>:0
  at Sooloos.App.GetAppLock () [0x00009] in <509f937a4fe442299b26082ae060ec87>:0
  at Sooloos.App.Main (System.String[] argv) [0x0000f] in <509f937a4fe442299b26082ae060ec87>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Syscall' threw an exception. ---> System.DllNotFoundException: MonoPosixHelper
  at (wrapper managed-to-native) Mono.Unix.Native.Syscall.get_at_fdcwd()
  at Mono.Unix.Native.Syscall..cctor () [0x0000a] in <61b3b2178cd3413d9a921a61ee10e8cb>:0
   --- End of inner exception stack trace ---
  at Base.Unix.getuid () [0x00000] in <1ce4ef8ec6a14cbf9a278ce947152654>:0
  at Sooloos.App.GetAppLock () [0x00009] in <509f937a4fe442299b26082ae060ec87>:0
  at Sooloos.App.Main (System.String[] argv) [0x0000f] in <509f937a4fe442299b26082ae060ec87>:0
/nix/store/sj87yiih3hlivqkchxgw3r6gd984zkzq-roon-server/opt/start.sh: line 35: kill: (9554) - No such process

Hi @Jose_Albornoz,

Thanks for reaching out! Can you please also upload a copy of your Roon logs by using these instructions? If you can upload the set to Dropbox / Google Drive that would work best.

Hi @noris, I looked into the logs and they don’t seem to be written to when the process fails.
I rolled back to the 555 release and it writes to logs without problem.

Searching through the forum I found Unable to get Roon to Start on Nix Linux which seems a bit similar, maybe @brian or @edude03 have an idea of what’s going on here.

1 Like

Thanks for letting me know @Jose_Albornoz. Let me run your systemd trace by QA to see if they have further ideas, I will let you know once my feedback request has reached the top of the queue.

Hi @Jose_Albornoz,

I appreciate your patience here until I have had a chance to consult with QA regarding your case.

To start off, I will mention that we do not perform any regular testing on NixOS, so I have moved this thread over to the #tinkering section. While we’re happy to provide high-level suggestions, we cannot troubleshoot this OS specifically.

As for this issue in particular, QA has suggested that you check to see if libmonoposixhelper.so is still installed on your Roon Core. You can try to perform a ldd <libname> but do note that there is something different about your library environment that is specific to NixOS, and since this issue does not occur on other distributions, we would suggest investigating in that direction.

Thanks for your help, I understand that this is not a common installation.

Somehow it can’t seem to load libz.so.1 which is causing it to fail to boot. Seems like a nixos misconfiguration.

Mono: DllImport error loading library ‘/nix/store/bs5jd82aa11ny2dp97aj1xgjp1bqq7c0-roon-server/opt/RoonMono/lib/libMonoPosixHelper.so’: ‘libz.so.1: cannot open shared object file: No such file or directory’.

Ok, after debugging for quite a while I got it running!

It seems that Roon now needs libz.so.1 which is not available by default in the path that NixOS exposes.

NixOS has a method for patching binaries that would allow me to expose libz seamlessly, but it seems that the libz version that NixOS has has a slightly different name: libz.so.1.2.11

The following “patch” allowed me to expose the library with the correct name:

  • ln -s ${zlib}/lib/libz.so.1 $out/opt/RoonMono/lib/libz.so.1

I will submit a Pull Request to NixOS to try and get this fixed.

This makes me wonder, is there a way to configure RoonMono to use a different filename for libz?

Thanks for all your help here

1 Like

Pull request for NixOS with more details: https://github.com/NixOS/nixpkgs/pull/92945

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.