linuxserver / docker-jackett

GNU General Public License v3.0
395 stars 95 forks source link

Unraid Custom network type docker image issue #86

Closed HDebeuf closed 5 years ago

HDebeuf commented 5 years ago

Dear support team,

The Jackett Docker image in an Unraid environment doesn't seem to resolve any source if a custom network type is chosen.

Host OS: Unraid

Settings: image

Jackett logs

06-14 21:14:27 Debug Connection id "0HLNGV5C7OPG7" started.
06-14 21:14:27 Info Request starting HTTP/1.1 POST http://192.168.0.100:9117/api/v2.0/indexers/thepiratebay/test 0
06-14 21:14:27 Debug Request is continuing in applying rules. Current url is http://192.168.0.100:9117/api/v2.0/indexers/thepiratebay/test
06-14 21:14:27 Debug Request is continuing in applying rules. Current url is http://192.168.0.100:9117/api/v2.0/indexers/thepiratebay/test
06-14 21:14:27 Debug Request is continuing in applying rules. Current url is http://192.168.0.100:9117/api/v2.0/indexers/thepiratebay/test
06-14 21:14:27 Debug POST requests are not supported
06-14 21:14:27 Debug AuthenticationScheme: Cookies was successfully authenticated.
06-14 21:14:27 Debug Request successfully matched the route with name '(null)' and template 'api/v2.0/indexers/{indexerid}/Test'
06-14 21:14:27 Info Route matched with {action = "Test", controller = "IndexerApi"}. Executing action Jackett.Server.Controllers.IndexerApiController.Test (jackett)

06-14 21:14:27 Debug Execution plan of authorization filters (in the following order): Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter
06-14 21:14:27 Debug Execution plan of resource filters (in the following order): Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.SaveTempDataFilter
06-14 21:14:27 Debug Execution plan of action filters (in the following order): Microsoft.AspNetCore.Mvc.Internal.ControllerActionFilter (Order: -2147483648), Microsoft.AspNetCore.Mvc.ModelBinding.UnsupportedContentTypeFilter (Order: -3000), Microsoft.AspNetCore.Mvc.Internal.ResponseCacheFilter, Jackett.Server.Controllers.RequiresIndexer
06-14 21:14:27 Debug Execution plan of exception filters (in the following order): None
06-14 21:14:27 Debug Execution plan of result filters (in the following order): Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.SaveTempDataFilter
06-14 21:14:27 Info Authorization was successful.
06-14 21:14:27 Info Executing action method Jackett.Server.Controllers.IndexerApiController.Test (jackett) - Validation state: Valid
06-14 21:14:27 Debug WebClient(HttpWebClient2NetCore).GetString(Url:https://thepiratebay.org/recent)
06-14 21:14:37 Info Executed action Jackett.Server.Controllers.IndexerApiController.Test (jackett) in 10011.8673ms
06-14 21:14:37 Error Jackett.Common.IndexerException: Exception (thepiratebay): Resource temporarily unavailable ---> System.Net.Http.HttpRequestException: Resource temporarily unavailable ---> System.Net.Sockets.SocketException: Resource temporarily unavailable

at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at CloudFlareUtilities.ClearanceHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Jackett.Common.Utils.Clients.HttpWebClient2NetCore.Run(WebRequest webRequest) in /home/appveyor/projects/jackett/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs:line 241
at Jackett.Common.Utils.Clients.WebClient.GetString(WebRequest request) in /home/appveyor/projects/jackett/src/Jackett.Common/Utils/Clients/WebClient.cs:line 114
at Jackett.Common.Indexers.BaseWebIndexer.RequestStringWithCookies(String url, String cookieOverride, String referer, Dictionary`2 headers) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 445
at Jackett.Common.Indexers.CardigannIndexer.PerformQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/CardigannIndexer.cs:line 1230
at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 331
--- End of inner exception stack trace ---
at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 351
at Jackett.Common.Indexers.BaseWebIndexer.ResultsForQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 815
at Jackett.Common.Services.IndexerManagerService.TestIndexer(String name) in /home/appveyor/projects/jackett/src/Jackett.Common/Services/IndexerManagerService.cs:line 222
at Jackett.Server.Controllers.IndexerApiController.Test() in /home/appveyor/projects/jackett/src/Jackett.Server/Controllers/IndexerApiController.cs:line 128
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)

at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Jackett.Server.Middleware.CustomExceptionHandler.Invoke(HttpContext httpContext) in /home/appveyor/projects/jackett/src/Jackett.Server/Middleware/CustomExceptionHandler.cs:line 29 Jackett.Common.IndexerException: Exception (thepiratebay): Resource temporarily unavailable ---> System.Net.Http.HttpRequestException: Resource temporarily unavailable ---> System.Net.Sockets.SocketException: Resource temporarily unavailable
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at CloudFlareUtilities.ClearanceHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Jackett.Common.Utils.Clients.HttpWebClient2NetCore.Run(WebRequest webRequest) in /home/appveyor/projects/jackett/src/Jackett.Common/Utils/Clients/HttpWebClient2NetCore.cs:line 241
at Jackett.Common.Utils.Clients.WebClient.GetString(WebRequest request) in /home/appveyor/projects/jackett/src/Jackett.Common/Utils/Clients/WebClient.cs:line 114
at Jackett.Common.Indexers.BaseWebIndexer.RequestStringWithCookies(String url, String cookieOverride, String referer, Dictionary`2 headers) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 445
at Jackett.Common.Indexers.CardigannIndexer.PerformQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/CardigannIndexer.cs:line 1230
at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 331
--- End of inner exception stack trace ---
at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 351
at Jackett.Common.Indexers.BaseWebIndexer.ResultsForQuery(TorznabQuery query) in /home/appveyor/projects/jackett/src/Jackett.Common/Indexers/BaseIndexer.cs:line 815
at Jackett.Common.Services.IndexerManagerService.TestIndexer(String name) in /home/appveyor/projects/jackett/src/Jackett.Common/Services/IndexerManagerService.cs:line 222
at Jackett.Server.Controllers.IndexerApiController.Test() in /home/appveyor/projects/jackett/src/Jackett.Server/Controllers/IndexerApiController.cs:line 128
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)

at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Jackett.Server.Middleware.CustomExceptionHandler.Invoke(HttpContext httpContext) in /home/appveyor/projects/jackett/src/Jackett.Server/Middleware/CustomExceptionHandler.cs:line 29
06-14 21:14:37 Debug The response will be compressed with 'gzip'.
06-14 21:14:37 Debug Connection id "0HLNGV5C7OPG7" completed keep alive response.
06-14 21:14:37 Info Request finished in 10024.2189ms 500 application/json

Suggestion to fix: According to the different network interfaces users can grant through Unraid, including VLANS, the generated docker container seems not having access to the network gateway. By choosing Host as Network type, the container is working fine.

I've had a trial by correcting the nameserver ip with the right one on the network, but unfortunately, this didn't seem to resolve the issue.

Working host network choice /etc/resolv.conf :

# Generated DNSv4 entries:
nameserver 192.168.0.254

Not working custom network choice /etc/resolv.conf :

nameserver 127.0.0.11
options ndots:0

I haven't been able to find the network setup in the custom Debian image in order to try to edit other network changes, but maybe you'll be able to guide me to the right config file.

Thank you,

HDebeuf commented 5 years ago

For anyone encountering the same issue, I found a way to resolve the issue: Mount the /etc/resolv.conf with a custom DNS resolvers.

For example:

nameserver 1.1.1.1

You may also mount your internal nameserver if you use separate VLANS.

May you update the docker image designed for Unraid where this use case may happen? For example, requesting through DHCP the nameserver to fill in the /etc/resolv.conf.

Thank you.

CHBMB commented 5 years ago

I've tried running Jackett on a custom docker network in Unraid and I'm not able to reproduce your issue. Using the standard /etc/resolv.conf

root@77fa8d9f0689:/# cat /etc/resolv.conf 
nameserver 127.0.0.11
options ndots:0
HDebeuf commented 5 years ago

Thank you for the attempt. For information, I'm talking here about a second physical interface connected to a different router and ISP. The default network of my Unraid server is on another physical interface connected to a different ISP. So I might presume that having localhost in the resolv.conf results in trying to reach the nameserver through the wrong router. When the packets are coming back to my router, this one doesn't find the ip address of the container.

aptalca commented 5 years ago

127.0.0.11 is not localhost. It's the ip for the docker network dns.

This is not an image issue. It has to do with docker and networking on a host system level. Please post the issue on the unraid forum.