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

Can't run movie quality definitions script - Debian 11 #20

Closed
gyCfjSnO opened this issue Dec 31, 2021 · 11 comments
Closed

Can't run movie quality definitions script - Debian 11 #20

gyCfjSnO opened this issue Dec 31, 2021 · 11 comments

Comments

@gyCfjSnO
Copy link

I am trying to run the script for the movie quality definitions but I am getting the below error message, .NET is installed and I am running Debian 11. When I throw the URL into web browser it can be accessed no problems.

[ERR] HTTP error while communicating with Radarr
Flurl.Http.FlurlHttpException: Call failed. The SSL connection could not be established, see inner exception: GET https://127.0.0.1/radarr/api/v3/qualitydefinition?apikey=REDACTED
 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch
   at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   --- End of inner exception stack trace ---
   at Flurl.Http.FlurlRequest.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)
   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   at Flurl.Http.ResponseExtensions.ReceiveJson[T](Task`1 response)
   at TrashLib.Radarr.QualityDefinition.Api.QualityDefinitionService.GetQualityDefinition()
   at TrashLib.Radarr.QualityDefinition.RadarrQualityDefinitionUpdater.ProcessQualityDefinition(IEnumerable`1 guideQuality)
   at TrashLib.Radarr.QualityDefinition.RadarrQualityDefinitionUpdater.Process(Boolean isPreview, RadarrConfiguration config)
   at Trash.Command.RadarrCommand.Process()
Exiting due to previous exception```
@rcdailey
Copy link
Member

Looks like the issue is that you're using a self-signed certificate. That is not a scenario I have tested. I would recommend you use http if you're going to use localhost. https will work but it requires an actual certificate, like one from letsencrypt.

@PlzDontScrobbleMe
Copy link

any chance to add insecure option to config (and skip the ssl verification on the api calls)?
ive got the same problem, all my setup is via https only with private ca signed certs...

@gyCfjSnO
Copy link
Author

gyCfjSnO commented Jan 3, 2022

Looks like the issue is that you're using a self-signed certificate. That is not a scenario I have tested. I would recommend you use http if you're going to use localhost. https will work but it requires an actual certificate, like one from letsencrypt.

I have tried using http in the .yaml but still get same error message

@rcdailey
Copy link
Member

rcdailey commented Jan 3, 2022

I have tried using http in the .yaml but still get same error message

Most likely, Radarr is redirecting http to https. If you are getting the same error message, it's due to SSL.

I'm working on adding settings support. I'll make sure that I add an option to disable certificate validation as well.

@Fienjouricen
Copy link

It worked for me after adding my self signed certificate into trust store of my linux. I'm using ubuntu 20.04 and done following steps:

  1. Copy the .crt file to /usr/local/share/ca-certificates/
  2. Run sudo update-ca-certificates

@rcdailey
Copy link
Member

rcdailey commented Feb 7, 2022

Check out release v1.7.0 which has a new settings file and option inside of it to disable SSL verification. There's a Settings Reference page in the wiki with more details.

@gyCfjSnO
Copy link
Author

gyCfjSnO commented Feb 18, 2022

Check out release v1.7.0 which has a new settings file and option inside of it to disable SSL verification. There's a Settings Reference page in the wiki with more details.

Still getting same error message.

htpc@HTPC:~$ ./trash sonarr && ./trash radarr
[INF] Processing Release Profile: Series
[ERR] HTTP error while communicating with Sonarr
Flurl.Http.FlurlHttpException: Call failed. The SSL connection could not be established, see inner exception: GET https://127.0.0.1/8989/api/v3/system/status?apikey=REDACTED
 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

My YAML

enable_ssl_certificate_validation: false

sonarr:
  - base_url: http://127.0.0.1/8989
    api_key: REDACTED
    quality_definition: series
    release_profiles:
      - type: series
        strict_negative_scores: false

radarr:
  - base_url: http://127.0.0.1/radarr
    api_key: REDACTED
    quality_definition:
      type: movie
      preferred_ratio: 0.5

@rcdailey
Copy link
Member

The ssl verification setting goes into the settings file not the trash.yml

@gyCfjSnO
Copy link
Author

./trash sonarr && ./trash radarr

I now get this error when trying to run it...

htpc@HTPC:~$ ./trash sonarr && ./trash radarr
[WRN] Security Risk: Certificate validation is being DISABLED because setting `enable_ssl_certificate_validation` is set to `false`
[INF] Processing Release Profile: Series
[ERR] HTTP error while communicating with Sonarr
Flurl.Http.FlurlHttpException: Call failed with status code 401 (Unauthorized): GET https://127.0.0.1/sonarr/api/v3/system/status?apikey=REDACTED
   at Flurl.Http.FlurlRequest.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token)
   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   at Flurl.Http.ResponseExtensions.ReceiveJson(Task`1 response)
   at TrashLib.Sonarr.SonarrCompatibility.<>c__DisplayClass0_0.<<-ctor>b__0>d.MoveNext() in D:\a\trash-updater\trash-updater\src\TrashLib\Sonarr\SonarrCompatibility.cs:line 14
--- End of stack trace from previous location ---
   at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception) in /_/Rx.NET/Source/src/System.Reactive/Internal/ExceptionServicesImpl.cs:line 19
   at System.Reactive.ExceptionHelpers.Throw(Exception exception) in /_/Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.cs:line 16
   at System.Reactive.Subjects.AsyncSubject`1.GetResult() in /_/Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs:line 430
   at TrashLib.Sonarr.ReleaseProfile.ReleaseProfileUpdater.DoVersionEnforcement() in D:\a\trash-updater\trash-updater\src\TrashLib\Sonarr\ReleaseProfile\ReleaseProfileUpdater.cs:line 65
   at TrashLib.Sonarr.ReleaseProfile.ReleaseProfileUpdater.ProcessReleaseProfiles(IDictionary`2 profiles, ReleaseProfileConfig config) in D:\a\trash-updater\trash-updater\src\TrashLib\Sonarr\ReleaseProfile\ReleaseProfileUpdater.cs:line 139
   at TrashLib.Sonarr.ReleaseProfile.ReleaseProfileUpdater.Process(Boolean isPreview, SonarrConfiguration config) in D:\a\trash-updater\trash-updater\src\TrashLib\Sonarr\ReleaseProfile\ReleaseProfileUpdater.cs:line 53
   at Trash.Command.SonarrCommand.Process() in D:\a\trash-updater\trash-updater\src\Trash\Command\SonarrCommand.cs:line 54
Exiting due to previous exception

@rcdailey
Copy link
Member

Your hint is here:

401 (Unauthorized)

This means you are not authorized to connect to Sonarr. Check your API key.

@rcdailey
Copy link
Member

I'm going to lock this issue. @gyCfjSnO please start a new discussion for further support if you still encounter issues.

@recyclarr recyclarr locked as off-topic and limited conversation to collaborators Feb 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants