MediaBrowser / Emby

Emby Server is a personal media server with apps on just about every device.
https://emby.media
GNU General Public License v2.0
4.17k stars 809 forks source link

TrueNas Scale network issue #3750

Closed FoxUSA closed 1 year ago

FoxUSA commented 2 years ago

Hello, I have premium lifetime if that changes anything(Although may not show up in this config since its fresh to troubleshoot this).

Getting errors as follows that prevent me from downloading metadata

2022-11-06 02:24:13.033 Error App: Error getting connection info
        *** Error Report ***
        Version: 4.7.8.0
        Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
        Operating system: Linux version 5.10.142+truenas (root@tnsbuilds01.tn.ixsystems.net) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1
        Framework: .NET 6.0.8
        OS/Process: x64/x64
        Runtime: system/System.Private.CoreLib.dll
        Processor count: 4
        Data path: /config
        Application path: /system
        System.Net.Http.HttpRequestException: System.Net.Http.HttpRequestException: Name or service not known (connect.emby.media:443)
         ---> System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known
           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 System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
           --- End of inner exception stack trace ---
           at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
           at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
           at Emby.Server.Implementations.Networking.RemoteAddressEntryPoint.GetIpAddress(String lookupUrl)
           at Emby.Server.Implementations.Networking.RemoteAddressEntryPoint.TimerCallback(Object state)
        Source: Emby.Server.Implementations
        TargetSite: Void MoveNext()
        InnerException: System.Net.Sockets.SocketException: Name or service not known
        Source: System.Net.Sockets
        TargetSite: Void ThrowException(System.Net.Sockets.SocketError, System.Threading.CancellationToken)
           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 System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)

Before you say networking mis configured bla bla other apps seem to work fine. This is a fresh Emby install(4.7.8.0_1.0.12) using the official TrueNas Scale(TrueNAS-SCALE-22.02.4) chart. I have gone over and over the network config. When I mount that container I can resolve that domains in the errors just fine

/ # ping connect.emby.media
PING connect.emby.media (173.230.139.54): 56 data bytes
64 bytes from 173.230.139.54: seq=0 ttl=51 time=58.792 ms
64 bytes from 173.230.139.54: seq=1 ttl=51 time=58.047 ms
^C
--- connect.emby.media ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 58.047/58.419/58.792 ms

/ # nslookup connect.emby.media
Server:         192.168.1.1 
Address:        192.168.1.1:53

Non-authoritative answer:
Name:   connect.emby.media
Address: 173.230.139.54

*** Can't find connect.emby.media: No answer

embyserver.txt

FoxUSA commented 2 years ago

No change on 4.7.9.0

2022-11-09 16:44:05.851 Error App: Error in TheMovieDb
        *** Error Report ***
        Version: 4.7.9.0
        Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
        Operating system: Linux version 5.10.142+truenas (root@tnsbuilds01.tn.ixsystems.net) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1
        Framework: .NET 6.0.8
        OS/Process: x64/x64
        Runtime: system/System.Private.CoreLib.dll
        Processor count: 4
        Data path: /config
        Application path: /system
        System.Net.Http.HttpRequestException: System.Net.Http.HttpRequestException: Name or service not known (api.themoviedb.org:443)
         ---> System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known
           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 System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
           --- End of inner exception stack trace ---
           at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
           at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
           at MovieDb.MovieDbProvider.GetMovieDbResponse(HttpRequestOptions options)
           at MovieDb.MovieDbProvider.GetTmdbSettings(CancellationToken cancellationToken)
           at MovieDb.MovieDbSearch.GetSearchResults(ItemLookupInfo idInfo, String searchType, CancellationToken cancellationToken)
           at MovieDb.MovieDbSeriesProvider.GetMetadata(SeriesInfo info, CancellationToken cancellationToken)
           at Emby.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, LibraryOptions libraryOptions, String logName, TIdType id, IEnumerable`1 providers, MetadataRefreshOptions options, CancellationToken cancellationToken)
FoxUSA commented 1 year ago

This seems like a thing based on this

/ # busybox | head -1
BusyBox v1.34.1 (2022-06-06 22:12:17 UTC) multi-call binary.

I can still get it to do it even(Give the error IE not work) with launching a container not via that chart and passing in the dns server.

This clued me off to looking into busy box

/ # nslookup google.com
Server:         1.1.1.1
Address:        1.1.1.1:53

Non-authoritative answer:
Name:   google.com
Address: 142.250.72.142

*** Can't find google.com: No answer

/ # nslookup -type=a google.com
Server:         1.1.1.1
Address:        1.1.1.1:53

Non-authoritative answer:
Name:   google.com
Address: 142.250.72.174
FoxUSA commented 1 year ago

It's been a bit with no response. My guess is its some weirdness around how .net code access the network in K8s. Jellyfin worked out of the box........

LukePulverenti commented 1 year ago

Hi, I'm not sure what the issue is but this pretty much always comes down to something blocking the server's outgoing connections. TrueNas Scale is a platform we support and we're not able to reproduce this.

FoxUSA commented 1 year ago

I would agree with you if it wasn't for the fact using essentially the same config Jellyfin had no issues. Also the weirdness with pings and wget working but Emby not.