Jump to content

MovieDb timeouts


IrfanR

Recommended Posts

IrfanR

I'm having same issue with TMDB fetch.

I've tried to downgrade server to emby-server-deb_4.6.3.0 and then emby-server-deb_4.6.2.0, still no luck.

I noticed this happening probably 2 updates before. 

See logs that all is working fine except metadata lookup, say I select a newly added movie and it's now showing any metadata or images, so I manually try to IDENTIFY and it fails to get any result.

See attached log for details.

This is where it fails to get from TMDB:

2021-07-27 11:52:53.329 Error HttpClient: Connection to https://api.themoviedb.org/3/configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669 timed out
2021-07-27 11:52:53.338 Error App: Error in TheMovieDb
	*** Error Report ***
	Version: 4.6.4.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Linux version 5.4.0-80-generic (buildd@lcy01-amd64-030) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021
	Framework: .NET Core 3.1.13
	OS/Process: x64/x64
	Runtime: opt/emby-server/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /var/lib/emby
	Application path: /opt/emby-server/system
	MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: Connection to https://api.themoviedb.org/3/configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669 timed out
	 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
	   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
	   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	   --- 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.GenericMovieDbInfo`1.GetMetadata(ItemLookupInfo itemId, CancellationToken cancellationToken)
	   at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(BaseItem originalItem, MetadataResult`1 temp, LibraryOptions libraryOptions, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)
	Source: Emby.Server.Implementations
	TargetSite: Void MoveNext()
	InnerException: System.Threading.Tasks.TaskCanceledException: The operation was canceled.
	Source: System.Private.CoreLib
	TargetSite: Void Throw()
	   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
	   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
	   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
	

 

When I run same curl from server, I see;

iServer:~$ curl -i https://api.themoviedb.org/3/configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669
HTTP/2 200 
content-type: application/json;charset=utf-8
content-length: 1073
server: openresty
access-control-allow-origin: *
access-control-allow-methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
access-control-expose-headers: ETag, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After, Content-Length, Content-Range
date: Tue, 27 Jul 2021 09:50:02 GMT
cache-control: public, max-age=43200
etag: W/"8ee6fd095d2be6e301251d766501a916"
vary: Accept-Encoding,Accept-Encoding,Accept-Encoding
x-cache: Hit from cloudfront
via: 1.1 2720a0d0aa030a9768963f8c7fc98676.cloudfront.net (CloudFront)
x-amz-cf-pop: ORD52-C2
x-amz-cf-id: Nm227KmJmd6HqGeG2WFTvUpuBEWSeGSOmrysvo83J1ayOZujokMf7w==
age: 23429

{"images":{"base_url":"http://image.tmdb.org/t/p/","secure_base_url":"https://image.tmdb.org/t/p/","backdrop_sizes":["w300","w780","w1280","original"],"logo_sizes":["w45","w92","w154","w185","w300","w500","original"],"poster_sizes":["w92","w154","w185","w342","w500","w780","original"],"profile_sizes":["w45","w185","h632","original"],"still_sizes":["w92","w185","w300","original"]},"change_keys":["adult","air_date","also_known_as","alternative_titles","biography","birthday","budget","cast","certifications","character_names","created_by","crew","deathday","episode","episode_number","episode_run_time","freebase_id","freebase_mid","general","genres","guest_stars","homepage","images","imdb_id","languages","name","network","origin_country","original_name","original_title","overview","parts","place_of_birth","plot_keywords","production_code","production_companies","production_countries","releases","revenue","runtime","season","season_number","season_regular","spoken_languages","status","tagline","title","translations","tvdb_id","tvrage_id","type","video","videos"]}

Is the API key correct? is the API call URL correct? Seems to me TMDB plugin error.

 

embyserver.txt

Link to comment
Share on other sites

Hi, most likely you have something blocking the emby server process from making these communications. Typical causes are firewall, security software, or VPN. Can you look into this? 

Link to comment
Share on other sites

IrfanR

I have no Firewall on server (internal network), no AppArmor installed, I have same Bell Modem for over 3 years without any modification to it.

In any way, I saw some thread mention about MTU, so I started fiddling with DNS and MTU and then it was woking, as I reverted back all changes, it's not working again. Not a definite answer, Why?!!

So, the TMDB plugin is working, but i wonder how does that plugin make the call. It seems some issue with resolved and how it's used by the any app.

But that plugin is working as expected, but something with resolved, a networking issue.

Last comment from Q-Droid confirms that. Trying first IPv6, then IPv4. But that also shows that at last it works after trying IPv6 then falling back to IPv4, does that mean plugin needs longer wait time?

iServer:~$ wget -dv https://api.themoviedb.org/3/configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669
Setting --verbose (verbose) to 1
Setting --verbose (verbose) to 1
DEBUG output created by Wget 1.20.3 on linux-gnu.

Reading HSTS entries from /home/irfan/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669' (UTF-8) -> 'configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669' (UTF-8)
--2021-07-27 15:26:14--  https://api.themoviedb.org/3/configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669
Resolving api.themoviedb.org (api.themoviedb.org)... 2600:9000:20e9:2400:c:174a:c400:93a1, 2600:9000:20e9:b400:c:174a:c400:93a1, 2600:9000:20e9:4000:c:174a:c400:93a1, ...
Caching api.themoviedb.org => 2600:9000:20e9:2400:c:174a:c400:93a1 2600:9000:20e9:b400:c:174a:c400:93a1 2600:9000:20e9:4000:c:174a:c400:93a1 2600:9000:20e9:b600:c:174a:c400:93a1 2600:9000:20e9:1400:c:174a:c400:93a1 2600:9000:20e9:fe00:c:174a:c400:93a1 2600:9000:20e9:5600:c:174a:c400:93a1 2600:9000:20e9:5400:c:174a:c400:93a1 99.84.174.49 99.84.174.127 99.84.174.112 99.84.174.115
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:2400:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:b400:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:4000:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:b600:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:1400:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:fe00:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:5600:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|2600:9000:20e9:5400:c:174a:c400:93a1|:443... Closed fd 3
failed: No route to host.
Connecting to api.themoviedb.org (api.themoviedb.org)|99.84.174.49|:443... connected.
Created socket 3.
Releasing 0x000055ff0f1340a0 (new refcount 1).
Initiating SSL handshake.
Handshake successful; connected socket 3 to SSL handle 0x000055ff0f134500
certificate:
  subject: CN=*.themoviedb.org
  issuer:  CN=Amazon,OU=Server CA 1B,O=Amazon,C=US
X509 certificate successfully verified and matches host api.themoviedb.org

---request begin---
GET /3/configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669 HTTP/1.1
User-Agent: Wget/1.20.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: api.themoviedb.org
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 1073
Connection: keep-alive
Server: openresty
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: ETag, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After, Content-Length, Content-Range
Date: Tue, 27 Jul 2021 09:50:02 GMT
Cache-Control: public, max-age=43200
ETag: W/"8ee6fd095d2be6e301251d766501a916"
Vary: Accept-Encoding,Accept-Encoding,Accept-Encoding
X-Cache: Hit from cloudfront
Via: 1.1 8356c9c8ab28073f0e8c2a1f82938c22.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: ORD52-C2
X-Amz-Cf-Id: St2UKA6m7hmFlUoTKz1CkPNESCC2armZ2hQ6qFV2ajN9Ih3HmdLlZA==
Age: 35141

---response end---
200 OK
Registered socket 3 for persistent reuse.
URI content encoding = ‘utf-8’
Length: 1073 (1.0K) [application/json]
Saving to: ‘configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669’

configuration?api_key=f6bd687ffa63cd282b6ff2c 100%[=================================================================================================>]   1.05K  --.-KB/s    in 0.004s  

2021-07-27 15:26:50 (238 KB/s) - ‘configuration?api_key=f6bd687ffa63cd282b6ff2c6877f2669’ saved [1073/1073]

 

Link to comment
Share on other sites

IrfanR

yes, by disabling IPv6, it works. that means Plugin needs longer wait time or a better way to (enforce) request over IPv4.

BTW, other plugins, i..e AudioDB and TVDB worked fine.

Edited by IrfanR
Link to comment
Share on other sites

Q-Droid

Is your internet service IPv6 enabled? If so then something isn't working.  If it's not IPv6 and you don't have a need for it on your LAN you can then remove the routable V6 address you have assigned on the server interface. You don't have to disable IPv6 and can remain dual stacked keeping the loopback and link local addresses. 

I think the problem is a routable IPv6 address is detected on your system so by default applications and network services will try to use it not knowing that it can't go anywhere. You saw that with the wget calls.

DNS responded with multiple IPv6 addresses along with v4. Question is how many times should the plug-in be expected to retry after the timeout? The wget test failed 8 times before using the IPv4 address.

Link to comment
Share on other sites

On 7/27/2021 at 3:49 PM, IrfanR said:

yes, by disabling IPv6, it works. that means Plugin needs longer wait time or a better way to (enforce) request over IPv4.

 

Unfortunately this is all happening in the .net core runtime. We'll be updating that to a new major version soon so we're hoping it will help with this issue. Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...