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

Sonarr v3 + Mono SSL Issues #5798

Closed
1 task done
sthewissen opened this issue Jul 1, 2023 · 20 comments
Closed
1 task done

Sonarr v3 + Mono SSL Issues #5798

sthewissen opened this issue Jul 1, 2023 · 20 comments
Assignees
Labels

Comments

@sthewissen
Copy link

sthewissen commented Jul 1, 2023

Is this a new Bug?

  • I checked that the bug hasn't been reported before

Package Name

Sonarr v3 / Mono

Package Version

Sonarr 20230217-22 / Mono v6.12.0.182-20

Device Model

DS211

Device Architecture

88f628x

Firmware Version

DSM 6.2.4-25556 Update 7

What happened?

I want to install Sonarr v3 on my Synology. Both Mono and Sonarr v3 install just fine. However, when I want to do anything in Sonarr (be it searching for a show, getting something from a crawler etc.) I get the following SSL error in the logs:

image

A common problem, that I find is mostly solved through the workarounds mentioned here #5051 namely:

  1. Running sudo /var/packages/mono/target/bin/cert-sync /etc/ssl/certs/ca-certificates.crt
  2. Running sudo chmod -R a+rX /usr/share/.mono

Running the first one of these on my NAS however crashes immediately:

image

I'm kind of lost on what I could do to get this issue resolved and was hoping someone here could share some insights. These are clean installs of both Sonarr and Mono.

Reproduction steps

  1. Install latest Sonarr v3 and Mono packages mentioned above.
  2. Search for a show in Sonarr.
  3. Check Sonarr logs to find the error mentioned.

Install Log

See attached log.

Service Log

No response

Other Logs

No response

Known workaround

Mono versions newer than 5.10.1.38 have a known compatibility issue with 88f628x architectures. Using version 5.8.0.108 resolved this issue.

@sthewissen sthewissen added the bug label Jul 1, 2023
@sthewissen
Copy link
Author

Please find attached the log;
mono.log

@hgy59
Copy link
Contributor

hgy59 commented Jul 2, 2023

@sthewissen the arch of DSM211 is not x86_64. It is 88f6281 (i.e. ARMv5).

I suppose that mono is not supported on this old device.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

Based on the mono log, it seems that the certificates were imported successfully under version 5.8.0.108-11. @hgy59 perhaps using an older mono may work?

EDIT: @sthewissen, when you were running mono v5.8.0.108 on 2023/06/29 19:46:23, did Sonarr v3 work correctly? If so you can manually downgrade to this version as a workaround.

EDIT: There may have been some previous workarounds noted in mono/mono#12537 with ARMv5 (for v5.10.1.38 and newer based on the releases). @hgy59 are these incorporated already for 88f6281? (it may be there as this came up in #3803 (comment))

@sthewissen
Copy link
Author

sthewissen commented Jul 2, 2023

What you're essentially seeing is me trying to install all the 3 available Mono packages for my machine and seeing if Sonarr works with them @mreid-tt

  • 5.8.0.108-11 => Sonarr doesn't even want to boot
  • 5.20.1.34-19 => SSL issues
  • 6.12.0.182-20 => SSL issues

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

Okay, thanks for the clarification. Can we see the sonarr.log as well to better understand why it wasn't booting?

EDIT: Can confirm from the mono install log you supplied that the postinstall script didn't complete for 5.20.1.34-19 and 6.12.0.182-20 as both reported crashes on population of the certificate store.

@sthewissen
Copy link
Author

Assuming it's the one attached here
nzbdrone.log

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

From what I can see regarding the mono 5.8.0.108-11 and Sonarr v3 combination, you completed the install of mono 5.8.0.108-11 on 2023/06/29 19:46:50 and sonarr v3 on 2023/06/29 19:53:53 with another startup attempt on 2023/06/29 19:57:47. What I'd really like to see is the service log for Sonarr (and mono) during that time.

Service logs are typically stored in /var/packages/{package}/var/{package}.log.

@sthewissen
Copy link
Author

Here we go service.nzbdrone.log

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

Thanks for that. Unfortunately, the log only goes as far back as Jun 30 12:03:02 CEST 2023. In this log it shows mono-6.12.0.182. Ideally you would need to go back to mono 5.8.0.108-11 and get a new log for me to look at. As an alternative (rather than going backward), if you are comfortable with terminal we can try moving forward.

In looking at the current code, @hgy59 already has included a workaround for ARM v5:

# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537)
if [ "$SYNOPKG_DSM_ARCH" = "88f6281" ] || [ "$SYNOPKG_DSM_ARCH" = "88f6282" ]; then
MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO}"
fi

As you can see, there are already the -aot and -float32 environment options configured. What I'd like to try are two other options referenced in the original mono issue as possible workarounds. For the first test, you can open the file /var/packages/nzbdrone/scripts/service-setup. In it you should find a line like this:

MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO}"

You can change it to:

MONO="MONO_ENV_OPTIONS='-O=-aot,-float32,-inline' ${MONO}"

Start Sonarr v3 and see if anything changes. If it does not, you can change the same line to the following and try again:

MONO="MONO_ENV_OPTIONS='-O=-all' ${MONO}"

EDIT: Now that I think on this some more I realise that even if this does work, the certificate store in mono may not be populated. @hgy59 is there a way to use environment variables with cert-sync to get the initial setup correct?

@sthewissen
Copy link
Author

Here's what I did;

  • Stop Sonarr v3 package
  • Add MONO="MONO_ENV_OPTIONS='-O=-aot,-float32,-inline' ${MONO}"
  • Start Sonarr v3 package

Result: SSL issue below

  • Stop Sonarr v3 package
  • Add MONO="MONO_ENV_OPTIONS='-O=-all' ${MONO}"
  • Start Sonarr v3 package

Result: SSL issue below

[v3.0.9.1549] System.Net.WebException: Error: TrustFailure (Authentication failed, see inner exception.): 'https://skyhook.sonarr.tv/v1/tvdb/search/en/?term=bl' ---> System.Net.WebException: Error: TrustFailure (Authentication failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
  at /spksrc/spk/mono/work-88f6281-6.1/mono-6.12.0.182/external/boringssl/ssl/handshake_client.c:1132

I'm happy to try completely uninstall and try the oldest mono one + Sonarr to see if the logs shed any light on it not booting.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

Thanks for the update. As I suspected the CERTIFICATE_VERIFY_FAILED errors are likely happening because the initial setup of mono failed to populate the certificate store. In the log you supplied we observed crashes with the postinstall for mono 5.20.1.34-19 and 6.12.0.182-20.

If you're game a fresh install of mono 5.8.0.108-11 and Sonarr v3 20230217-22 would be a great way to get additional insight from the service logs.

@mreid-tt mreid-tt self-assigned this Jul 2, 2023
@sthewissen
Copy link
Author

Did two clean installs of the versions you mention. Sonarr claims it's running, but it at the very least isn't reachable.

mono.install.log
nzbdrone.install.log
nzbdrone.service.log

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

From the logs you supplied things look good. Remember that when Sonarr is first installed it has to setup the database and install the latest updates. From the service log it seems that it was doing this successfully. During this time however the web interface will not be available and the app may appear down. As in the install screen messages, give it a few minutes before you try to open the web interface.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 2, 2023

@sthewissen, did Sonarr v3 eventually settle down with the web interface becoming available?

@sthewissen
Copy link
Author

Apparently, my patience was the main issue on that oldest version of Mono /w the Sonarrv3 package, it took its time but eventually got there. I probably won't be installing any of the upgrades anytime soon, but it's something! 😅

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 3, 2023

Thank you for providing us with your valuable feedback. We sincerely appreciate the insights gained from your testing, particularly regarding the incompatibility of mono with 88f628x architectures.

@hgy59, considering that the issue has not been adequately addressed for 88f628x, it would be prudent to remove the builds for versions 5.20.1.34-19 and 6.12.0.182-20. This proactive measure will effectively safeguard other users from encountering the same problem in the future.

@sly433
Copy link

sly433 commented Jul 7, 2023

Having the same problem on my 920+ running Mono 6.12.0.182-20 and DSM 7.2-64570 Update 1, sonar & radar cannot connect to my Jackett indexer even though Jackett can successfully test all indexers...

@hgy59
Copy link
Contributor

hgy59 commented Jul 7, 2023

@hgy59, considering that the issue has not been adequately addressed for 88f628x, it would be prudent to remove the builds for versions 5.20.1.34-19 and 6.12.0.182-20. This proactive measure will effectively safeguard other users from encountering the same problem in the future.

=> done.

@hgy59
Copy link
Contributor

hgy59 commented Jul 7, 2023

Having the same problem on my 920+ running Mono 6.12.0.182-20 and DSM 7.2-64570 Update 1, sonar & radar cannot connect to my Jackett indexer even though Jackett can successfully test all indexers...

@sly433 This is a different problem as it is related only to ARMv5 (88f628x) archs and DS-920+ is x64 (apollolake).
Please open a new issue and provide detailed (log) information.

@mreid-tt
Copy link
Contributor

mreid-tt commented Jul 8, 2023

@sthewissen, as we have worked around the problem by removing 88f628x builds (newer than v5.8.0.108-11) from download, we will be closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants