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

IPv6 outgoing connections not working #7637

Open
1 task done
lrsksr opened this issue Sep 25, 2022 · 14 comments
Open
1 task done

IPv6 outgoing connections not working #7637

lrsksr opened this issue Sep 25, 2022 · 14 comments
Labels
sonarr upstream Issue can / could be fixed by using Sonarr's code Status: Needs Triage New Issue needing triage Type: Bug Issue is a bug

Comments

@lrsksr
Copy link

lrsksr commented Sep 25, 2022

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Current Behavior

My download client is IPv6 only. When I try to set it up, I get the following HTTP 400 reply:

[
  {
    "isWarning": false,
    "detailedDescription": "No data available (aaaa-record-only.example.com:443)",
    "propertyName": "Host",
    "errorMessage": "Unable to connect to qBittorrent",
    "severity": "error"
  }
]

trace log at the end of the issue.

More so, when I disable IPv4 on the machine running radarr, when searching for movies I get a HTTP 503 with the stack trace in the response, also attached below.
I can see DNS requests for api.radarr.video and responses for both A and AAAA records using wireshark. When both IPv4 and IPv6 are enabled, the connection is established using the IPv4 adress from the A record. With only IPv6 enabled, no connection is established with the error Network is unreachable

On the same machine, Sonarr is able to connect to the IPv6-only download client. curl also works as expected, even preferring IPv6 over IPv4 addresses.

Expected Behavior

When dual stack is available, outgoing connections should be preferred via IPv6 instead of IPv4.

When only IPv6 is available and the remote host has an IPv6 address, a connection should be established.

Steps To Reproduce

  1. Set up radarr on an IPv6 only Ubuntu machine with global IPv6 addresses
  2. Try to search for a movie

or

  1. Try to set up a download client that only has AAAA records set

Environment

- OS: Ubuntu 22.04
- Radarr: 4.1.0.6175
- Docker Install: No
- Using Reverse Proxy: No
- Browser: not applicable

What branch are you running?

Master

Trace Logs?

The "No data available" for remote IPv6-only hosts:

[v4.1.0.6175] System.Net.Http.HttpRequestException: No data available (aaaa-record-only.example.com:443)
 ---> System.Net.Sockets.SocketException (61): No data available
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 296
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 271
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, 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.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellation(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse(HttpRequest request, CookieContainer cookies) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 101
   at NzbDrone.Common.Http.HttpClient.ExecuteRequest(HttpRequest request, CookieContainer cookieContainer) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 124
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 59
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxyV2.IsApiSupported(QBittorrentSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxyV2.cs:line 35
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.FetchProxy(QBittorrentSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 87
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.<>c__DisplayClass7_0.<GetProxyCache>b__0() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 82
   at NzbDrone.Common.Cache.Cached`1.Get(String key, Func`1 function, Nullable`1 lifeTime) in D:\a\1\s\src\NzbDrone.Common\Cache\Cached.cs:line 104
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.GetProxyCache(QBittorrentSettings settings, Boolean force) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 82
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.GetProxy(QBittorrentSettings settings, Boolean force) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 65
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrent.TestConnection() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrent.cs:line 410

The "Network is unreachable" when trying to connect to dual stack remote hosts but from IPv6-only machine:

2022-09-25 13:00:49.8|Warn|SkyHookProxy|System.Net.Http.HttpRequestException: Network is unreachable (api.radarr.video:443)
 ---> System.Net.Sockets.SocketException (101): Network is unreachable
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 296
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 272
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, 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.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellation(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse(HttpRequest request, CookieContainer cookies) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 101
   at NzbDrone.Common.Http.HttpClient.ExecuteRequest(HttpRequest request, CookieContainer cookieContainer) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 124
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 59
   at NzbDrone.Common.Http.HttpClient.Get(HttpRequest request) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 282
   at NzbDrone.Common.Http.HttpClient.Get[T](HttpRequest request) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 288
   at NzbDrone.Core.MetadataSource.SkyHook.SkyHookProxy.SearchForNewMovie(String title) in D:\a\1\s\src\NzbDrone.Core\MetadataSource\SkyHook\SkyHookProxy.cs:line 431

I suspect the relevant line is NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 272

The mentioned issue in the source code is still open, but when you investigate further, there are PRs merged that claim to fix the issue?

AB#3824

@lrsksr lrsksr added Status: Needs Triage New Issue needing triage Type: Bug Issue is a bug labels Sep 25, 2022
@vosdev
Copy link

vosdev commented Oct 15, 2022

Can reproduce. Have had this issue for months :/

@Qstick
Copy link
Member

Qstick commented Oct 18, 2022

I can spin a test build to remove the custom fallback handler if you fancy a go?

@lrsksr
Copy link
Author

lrsksr commented Oct 29, 2022

That would be great! Will the installation procedure be the same as described here? https://wiki.servarr.com/radarr/installation

@ntrp
Copy link

ntrp commented Nov 9, 2022

I am using the Helm chart from truecharts (hence docker) and have the same issues, this is the chart https://truecharts.org/docs/charts/stable/radarr.
The app cannot connect to a publicly available transmission instance unless ipv4 is enabled on that instance. If I ssh into the Radarr pod I can connect via IPv6. Looks more like a software issue also because Sonarr was working fine.

@bakerboy448
Copy link
Contributor

bakerboy448 commented Jan 11, 2023

c11f72c

should have this at least partly fixed / working combined with the ipv6 fallback logic

@bakerboy448 bakerboy448 added Status: Info Needed Issue does not follow the template or is missing information from the template such as logs Status: Waiting for OP Action Required from OP labels Jan 11, 2023
@lrsksr
Copy link
Author

lrsksr commented Jan 11, 2023

I upgraded to v4.3.2.6857 which includes this commit.

Unfortunately the problem remains with the same stack trace.
It's the same when I put in the IPv6 address instead of a domain name.

Do you need further information? Thanks!

@lrsksr
Copy link
Author

lrsksr commented Feb 25, 2023

Issue remains in v4.4.2.6956

@bakerboy448 could you please remove the tags you added so this gets attention again?

@bakerboy448 bakerboy448 removed Status: Info Needed Issue does not follow the template or is missing information from the template such as logs Status: Waiting for OP Action Required from OP labels Feb 25, 2023
@bakerboy448
Copy link
Contributor

Fresh round of trace logs anyone?

@lrsksr
Copy link
Author

lrsksr commented Feb 25, 2023

I don't think anything except line numbers has changed since I opened this issue:

2023-02-25 17:02:36.4|Trace|Http|Res: 467 [GET] /api/v3/config/downloadclient: 200.OK (7 ms)
2023-02-25 17:02:36.4|Trace|Http|Res: 468 [GET] /api/v3/downloadclient: 200.OK (7 ms)
2023-02-25 17:02:36.4|Debug|Api|[GET] /api/v3/config/downloadclient: 200.OK (7 ms)
2023-02-25 17:02:36.4|Trace|Http|Res: 469 [GET] /api/v3/remotepathmapping: 200.OK (5 ms)
2023-02-25 17:02:36.4|Debug|Api|[GET] /api/v3/downloadclient: 200.OK (7 ms)
2023-02-25 17:02:36.4|Debug|Api|[GET] /api/v3/remotepathmapping: 200.OK (5 ms)
2023-02-25 17:02:39.5|Trace|Http|Req: 470 [POST] /api/v3/downloadclient/test (from 192.168.0.218 User-Agent omitted)
2023-02-25 17:02:39.5|Debug|Radarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-02-25 17:02:39.5|Trace|HttpClient|Req: [GET] https://ipv6-only-download-client.org:443/api/v2/app/webapiVersion
2023-02-25 17:02:39.5|Trace|ConfigService|Using default config value for 'proxyenabled' defaultValue:'False'
2023-02-25 17:02:39.5|Error|QBittorrent|Unable to test qBittorrent

[v4.4.2.6956] System.Net.Http.HttpRequestException: No data available (ipv6-only-download-client.org:443)
 ---> System.Net.Sockets.SocketException (61): No data available
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 296
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 272
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, 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.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellation(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse(HttpRequest request, CookieContainer cookies) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 101
   at NzbDrone.Common.Http.HttpClient.ExecuteRequest(HttpRequest request, CookieContainer cookieContainer) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 124
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 59
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxyV2.IsApiSupported(QBittorrentSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxyV2.cs:line 35
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.FetchProxy(QBittorrentSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 87
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.<>c__DisplayClass7_0.<GetProxyCache>b__0() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 82
   at NzbDrone.Common.Cache.Cached`1.Get(String key, Func`1 function, Nullable`1 lifeTime) in D:\a\1\s\src\NzbDrone.Common\Cache\Cached.cs:line 104
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.GetProxyCache(QBittorrentSettings settings, Boolean force) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 75
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrentProxySelector.GetProxy(QBittorrentSettings settings, Boolean force) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrentProxySelector.cs:line 65
   at NzbDrone.Core.Download.Clients.QBittorrent.QBittorrent.TestConnection() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\QBittorrent\QBittorrent.cs:line 411


2023-02-25 17:02:39.6|Error|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|An unhandled exception has occurred while executing the request.

[v4.4.2.6956] FluentValidation.ValidationException: Validation failed: 
 -- Host: Unable to connect to qBittorrent
   at Radarr.Api.V3.ProviderControllerBase`3.VerifyValidationResult(ValidationResult validationResult, Boolean includeWarnings) in D:\a\1\s\src\Radarr.Api.V3\ProviderControllerBase.cs:line 200
   at Radarr.Api.V3.ProviderControllerBase`3.Test(TProviderDefinition definition, Boolean includeWarnings) in D:\a\1\s\src\Radarr.Api.V3\ProviderControllerBase.cs:line 191
   at Radarr.Api.V3.ProviderControllerBase`3.Test(TProviderResource providerResource) in D:\a\1\s\src\Radarr.Api.V3\ProviderControllerBase.cs:line 140
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Radarr.Http.Middleware.BufferingMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\BufferingMiddleware.cs:line 28
   at Radarr.Http.Middleware.IfModifiedMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\IfModifiedMiddleware.cs:line 41
   at Radarr.Http.Middleware.CacheHeaderMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\CacheHeaderMiddleware.cs:line 33
   at Radarr.Http.Middleware.UrlBaseMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\UrlBaseMiddleware.cs:line 27
   at Radarr.Http.Middleware.VersionMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\VersionMiddleware.cs:line 28
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)


2023-02-25 17:02:39.6|Trace|RadarrErrorPipeline|Handling Exception
2023-02-25 17:02:39.6|Warn|RadarrErrorPipeline|Invalid request Validation failed: 
 -- Host: Unable to connect to qBittorrent
2023-02-25 17:02:39.6|Trace|Http|Res: 470 [POST] /api/v3/downloadclient/test: 400.BadRequest (71 ms)
2023-02-25 17:02:39.6|Debug|Api|[POST] /api/v3/downloadclient/test: 400.BadRequest (71 ms)

@tungstenostrich
Copy link

Just ran into the same issue while migrating my home lab to IPv6 only. It doesn't only affect connections towards my download client but indexers as well. The Radarr version used 4.3.2.6857.

2023-04-13 20:46:00.9|Debug|Radarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-04-13 20:46:00.9|Error|Transmission|Failed to test

[v4.3.2.6857] System.Net.Http.HttpRequestException: No data available (bittorrent.DOMAIN:443)
 ---> System.Net.Sockets.SocketException (61): No data available
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 285
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 271
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, 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.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellation(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponse(HttpRequest request, CookieContainer cookies) in D:\a\1\s\src\NzbDrone.Common\Http\Dispatchers\ManagedHttpDispatcher.cs:line 101
   at NzbDrone.Common.Http.HttpClient.ExecuteRequest(HttpRequest request, CookieContainer cookieContainer) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 124
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in D:\a\1\s\src\NzbDrone.Common\Http\HttpClient.cs:line 59
   at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.AuthenticateClient(HttpRequestBuilder requestBuilder, TransmissionSettings settings, Boolean reauthenticate) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:line 222
   at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.ProcessRequest(String action, Object arguments, TransmissionSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:line 259
   at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.GetSessionVariables(TransmissionSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:line 145
   at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.GetConfig(TransmissionSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:line 120
   at NzbDrone.Core.Download.Clients.Transmission.TransmissionProxy.GetClientVersion(TransmissionSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionProxy.cs:line 112
   at NzbDrone.Core.Download.Clients.Transmission.Transmission.ValidateVersion() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\Transmission.cs:line 30
   at NzbDrone.Core.Download.Clients.Transmission.TransmissionBase.TestConnection() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\Transmission\TransmissionBase.cs:line 262


2023-04-13 20:46:00.9|Error|Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|An unhandled exception has occurred while executing the request.

[v4.3.2.6857] FluentValidation.ValidationException: Validation failed: 
 -- : Unknown exception: No data available (bittorrent.DOMAIN:443)
   at Radarr.Api.V3.ProviderControllerBase`3.VerifyValidationResult(ValidationResult validationResult, Boolean includeWarnings) in D:\a\1\s\src\Radarr.Api.V3\ProviderControllerBase.cs:line 200
   at Radarr.Api.V3.ProviderControllerBase`3.Test(TProviderDefinition definition, Boolean includeWarnings) in D:\a\1\s\src\Radarr.Api.V3\ProviderControllerBase.cs:line 191
   at Radarr.Api.V3.ProviderControllerBase`3.Test(TProviderResource providerResource) in D:\a\1\s\src\Radarr.Api.V3\ProviderControllerBase.cs:line 140
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Radarr.Http.Middleware.BufferingMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\BufferingMiddleware.cs:line 28
   at Radarr.Http.Middleware.IfModifiedMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\IfModifiedMiddleware.cs:line 41
   at Radarr.Http.Middleware.CacheHeaderMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\CacheHeaderMiddleware.cs:line 33
   at Radarr.Http.Middleware.UrlBaseMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\UrlBaseMiddleware.cs:line 27
   at Radarr.Http.Middleware.VersionMiddleware.InvokeAsync(HttpContext context) in D:\a\1\s\src\Radarr.Http\Middleware\VersionMiddleware.cs:line 28
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)


2023-04-13 20:46:00.9|Warn|RadarrErrorPipeline|Invalid request Validation failed: 
 -- : Unknown exception: No data available (bittorrent.DOMAIN:443)
2023-04-13 20:46:00.9|Debug|Api|[POST] /api/v3/downloadclient/test: 400.BadRequest (32 ms)

@heliochronix
Copy link

I just ran into this myself on an IPv6-only system. Is there a workaround some people have found until this is fixed?

@h1ght
Copy link

h1ght commented Nov 5, 2023

got pretty much the same error. i can curl the prowlarr/sonarr api's on all hosts/docker instances. e.g. when entering https ipv6 e.g. https://[ipv6:test:0123] it says it is invalid. same as https://[ipv6]:9696

edit//
after figuring out why its not working, looks like the arrs wont connect each other with ipv6. im running this in docker but switched to network_mode: host so no docker-nat inbetween. if i want to sync prowlarr and radarr(or sonarr e.g.) i get http.400 bad request. if i want to add the tornab rss url out of prowlarr of the specific indexer e.g. its the same "no data available" im using global routeable address that my provider gives me. i can curl it outside of my network, within each container. i tried it before via ipv6 bridge network via ip6-prefix delegation (/62 subnet out my /56 net) with global routable addresses. looks the same. i tried http reverse proxy e.g. traefik, same. i'll add some logs
radarr log trying to connect to prowlarr

2023-11-16 17:40:31.0|Trace|Http|Req: 115 [GET] /api/v3/config/host (from ::9939:fda0:25af:240c Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0)
2023-11-16 17:40:31.1|Debug|Radarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxyenabled' defaultValue:'False'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxytype' defaultValue:'Http'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxyhostname' defaultValue:''
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxyport' defaultValue:'8080'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxyusername' defaultValue:''
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxypassword' defaultValue:''
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxybypassfilter' defaultValue:''
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'proxybypasslocaladdresses' defaultValue:'True'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'backupfolder' defaultValue:'Backups'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'backupinterval' defaultValue:'7'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'backupretention' defaultValue:'28'
2023-11-16 17:40:31.1|Trace|ConfigService|Using default config value for 'applicationurl' defaultValue:''
2023-11-16 17:40:31.1|Trace|Http|Res: 115 [GET] /api/v3/config/host: 200.OK (37 ms)
2023-11-16 17:40:31.1|Debug|Api|[GET] /api/v3/config/host: 200.OK (37 ms)
2023-11-16 17:40:31.1|Trace|Http|Req: 116 [GET] /Content/Fonts/text-security-disc.woff?v=1.3.0 (from ::9939:fda0:25af:240c Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0)
2023-11-16 17:40:31.1|Trace|Http|Res: 116 [GET] /Content/Fonts/text-security-disc.woff?v=1.3.0: 200.OK (1 ms)
2023-11-16 17:40:51.2|Trace|Scheduler|Pending Tasks: 0
2023-11-16 17:41:00.0|Trace|Http|Req: 117 [GET] /api/v3/queue?apikey=(removed)&includeEpisode=true (from 192.168.178.42 axios/1.3.4)
2023-11-16 17:41:00.0|Debug|Radarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-11-16 17:41:00.0|Trace|Http|Res: 117 [GET] /api/v3/queue?apikey=(removed)&includeEpisode=true: 200.OK (2 ms)
2023-11-16 17:41:00.0|Debug|Api|[GET] /api/v3/queue?apikey=(removed)&includeEpisode=true: 200.OK (2 ms)
2023-11-16 17:41:11.0|Trace|Http|Req: 118 [GET] /api/v3/indexer/schema (from ::9e6b:ff:fe05:17a Prowlarr/1.10.4.4078 (alpine 3.18.4))
2023-11-16 17:41:11.0|Debug|Radarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-11-16 17:41:11.1|Trace|Http|Res: 118 [GET] /api/v3/indexer/schema: 200.OK (45 ms)
2023-11-16 17:41:11.1|Debug|Api|[GET] /api/v3/indexer/schema: 200.OK (45 ms)
2023-11-16 17:41:11.1|Trace|Http|Req: 119 [POST] /api/v3/indexer/test (from ::9e6b:ff:fe05:17a Prowlarr/1.10.4.4078 (alpine 3.18.4))
2023-11-16 17:41:11.1|Debug|Radarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-11-16 17:41:11.2|Trace|HttpClient|Req: [GET] http://[::9e6b:ff:fe05:17a]:9696/0/api?t=caps&apikey=(removed)
2023-11-16 17:41:11.2|Trace|ConfigService|Using default config value for 'proxyenabled' defaultValue:'False'
2023-11-16 17:41:11.2|Debug|NewznabCapabilitiesProvider|Failed to get Newznab API capabilities from http://[::9e6b:ff:fe05:17a]:9696/0/

[v5.1.3.8246] System.Net.Http.HttpRequestException: No data available ([::9e6b:ff:fe05:17a]:9696)
 ---> System.Net.Sockets.SocketException (61): No data available
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ConnectAsync(Socket socket)
   at System.Net.Sockets.Socket.ConnectAsync(EndPoint remoteEP, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in ./Radarr.Common/Http/Dispatchers/ManagedHttpDispatcher.cs:line 291
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in ./Radarr.Common/Http/Dispatchers/ManagedHttpDispatcher.cs:line 277
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   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.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Net.Http.HttpConnectionPool.<>c__DisplayClass75_0.<CheckForHttp11ConnectionInjection>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread)
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
--- End of stack trace from previous location ---
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.attemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in ./Radarr.Common/Http/Dispatchers/ManagedHttpDispatcher.cs:line 291
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.onConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in ./Radarr.Common/Http/Dispatchers/ManagedHttpDispatcher.cs:line 277
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, 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.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at NzbDrone.Common.Http.Dispatchers.ManagedHttpDispatcher.GetResponseAsync(HttpRequest request, CookieContainer cookies) in ./Radarr.Common/Http/Dispatchers/ManagedHttpDispatcher.cs:line 105
   at NzbDrone.Common.Http.HttpClient.ExecuteRequestAsync(HttpRequest request, CookieContainer cookieContainer) in ./Radarr.Common/Http/HttpClient.cs:line 157
   at NzbDrone.Common.Http.HttpClient.ExecuteAsync(HttpRequest request) in ./Radarr.Common/Http/HttpClient.cs:line 70
   at NzbDrone.Common.Http.HttpClient.Get(HttpRequest request) in ./Radarr.Common/Http/HttpClient.cs:line 327
   at NzbDrone.Core.Indexers.Newznab.NewznabCapabilitiesProvider.FetchCapabilities(NewznabSettings indexerSettings) in ./Radarr.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs:line 58

prowlarr log.

2023-11-16 17:41:11.0|Trace|Http|Req: 33 [POST] /api/v1/applications/test (from ::9939:fda0:25af:240c Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0)
2023-11-16 17:41:11.0|Debug|Prowlarr.Http.Authentication.ApiKeyAuthenticationHandler|AuthenticationScheme: API was successfully authenticated.
2023-11-16 17:41:11.0|Trace|HttpClient|Req: [GET] http://[::9e6b:ff:fe05:17a]:7878/api/v3/indexer/schema
2023-11-16 17:41:11.0|Trace|ConfigService|Using default config value for 'proxyenabled' defaultValue:'False'
2023-11-16 17:41:11.1|Trace|HttpClient|Res: HTTP/1.1 [GET] http://[::9e6b:ff:fe05:17a]:7878/api/v3/indexer/schema: 200.OK (242044 bytes) (53 ms)
2023-11-16 17:41:11.1|Trace|HttpClient|Req: [POST] http://[::9e6b:ff:fe05:17a]:7878/api/v3/indexer/test: {"id":0,"enableRss":false,"enableAutomaticSearch":false,"enableInteractiveSearch":false,"priority":25,"name":"Test (Prowlarr)","implementation":"Newznab","configContract":"NewznabSettings","tags":[],"fields":[{"name":"baseUrl","value":"http://[::9e6b:ff:fe05:17a]:9696/0/","type":"textbox","advanced":false},{"name":"apiPath","value":"/api","type":"textbox","advanced":true},{"name":"multiLanguages","value":[],"type":"select","advanced":true},{"name":"apiKey","value":"(removed)","type":"textbox","advanced":false},{"name":"categories","value":[2000,2010,2020,2030,2040,2045,2050,2060,2070,2080,2090],"type":"select","advanced":false},{"name":"additionalParameters","type":"textbox","advanced":true},{"name":"removeYear","value":false,"type":"checkbox","advanced":true}]}
2023-11-16 17:41:11.1|Trace|ConfigService|Using default config value for 'proxyenabled' defaultValue:'False'
2023-11-16 17:41:11.2|Trace|HttpClient|Res: HTTP/1.1 [POST] http://[::9e6b:ff:fe05:17a]:7878/api/v3/indexer/test: 400.BadRequest (271 bytes)
[
  {
    "isWarning": false,
    "propertyName": "",
    "errorMessage": "Unable to connect to indexer, please check your DNS settings and ensure IPv6 is working or disabled. No data available ([::9e6b:ff:fe05:17a]:9696)",
    "severity": "error"
  }
] (61 ms)
2023-11-16 17:41:11.2|Warn|HttpClient|HTTP Error - Res: HTTP/1.1 [POST] http://[::9e6b:ff:fe05:17a]:7878/api/v3/indexer/test: 400.BadRequest (271 bytes)
[
  {
    "isWarning": false,
    "propertyName": "",
    "errorMessage": "Unable to connect to indexer, please check your DNS settings and ensure IPv6 is working or disabled. No data available ([::9e6b:ff:fe05:17a]:9696)",
    "severity": "error"
  }
]
2023-11-16 17:41:11.2|Warn|Radarr|Prowlarr URL is invalid

[v1.10.4.4078] NzbDrone.Common.Http.HttpException: HTTP request failed: [400:BadRequest] [POST] at [http://[::9e6b:ff:fe05:17a]:7878/api/v3/indexer/test]
   at NzbDrone.Common.Http.HttpClient.ExecuteAsync(HttpRequest request) in ./Prowlarr.Common/Http/HttpClient.cs:line 128
   at NzbDrone.Common.Http.HttpClient.Post(HttpRequest request) in ./Prowlarr.Common/Http/HttpClient.cs:line 423
   at NzbDrone.Core.Applications.Radarr.RadarrV3Proxy.TestConnection(RadarrIndexer indexer, RadarrSettings settings) in ./Prowlarr.Core/Applications/Radarr/RadarrV3Proxy.cs:line 132
   at NzbDrone.Core.Applications.Radarr.Radarr.Test() in ./Prowlarr.Core/Applications/Radarr/Radarr.cs:line 52
[
  {
    "isWarning": false,
    "propertyName": "",
    "errorMessage": "Unable to connect to indexer, please check your DNS settings and ensure IPv6 is working or disabled. No data available ([::9e6b:ff:fe05:17a]:9696)",
    "severity": "error"
  }
]


2023-11-16 17:41:11.2|Trace|ProwlarrErrorPipeline|Handling Exception
2023-11-16 17:41:11.2|Warn|ProwlarrErrorPipeline|Invalid request Validation failed: 
 -- ProwlarrUrl: Prowlarr URL is invalid, Radarr cannot connect to Prowlarr
2023-11-16 17:41:11.2|Trace|Http|Res: 33 [POST] /api/v1/applications/test: 400.BadRequest (255 ms)
2023-11-16 17:41:11.2|Debug|Api|[POST] /api/v1/applications/test: 400.BadRequest (255 ms)
2023-11-16 17:41:21.1|Trace|Scheduler|Pending Tasks: 0
2023-11-16 17:41:51.1|Trace|Scheduler|Pending Tasks: 0
2023-11-16 17:41:56.5|Trace|Http|Req: 34 [GET] / (from ::9939:fda0:25af:240c Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0)
2023-11-16 17:41:56.5|Debug|Prowlarr.Http.Authentication.BasicAuthenticationHandler|AuthenticationScheme: Basic was successfully authenticated.

i removed my ipv6 prefix because its routeable. it looks like the can authenticate, but then shit hits the fan. somehow the http requets are not 200 but 400.

edit//
didnt wanted to create new issue, because my problem looks similiar to this.

regards

@covert8
Copy link
Contributor

covert8 commented Dec 13, 2023

I spent some time looking at this a few months back and came to the realisation that the happy eyeballs algorithm has not been implemented. Meaning that if for one reason or another ipv6 connectivity is lost it will never be retried until radarr is restarted.

In a k8s environment that happens often as pods are moved between hosts

The above line is the offending one.
The most simple patch would be to add a setting forcing ipv6 attempts always.

if (useIPv6) -> if (useIPv6 || forceIPv6) on line

https://github.com/Radarr/Radarr/blob/fcda6faf3d33b506ca6c953c25b96f0a07b767b2/src/NzbDrone.Common/Http/Dispatchers/ManagedHttpDispatcher.cs#L246C13-L247C1

The suggested patch for an override is simple, but i don't known the codebase enough to add such a setting to config.xml

Happy eyeballs will supposedly be added in 9.0 of dotnet
dotnet/runtime#87932

@covert8
Copy link
Contributor

covert8 commented Dec 13, 2023

I Wanted to add the forceIPv6 flag to the constructor of the ManagedHttpDispatcher but I can't seem to find it's factory or where it's being constructed. Any pointers would be much appreciated

@bakerboy448 bakerboy448 added the sonarr upstream Issue can / could be fixed by using Sonarr's code label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sonarr upstream Issue can / could be fixed by using Sonarr's code Status: Needs Triage New Issue needing triage Type: Bug Issue is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants