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

[BUG] Suppressing retries for 30 seconds #746

Closed
Hawkedon opened this issue Jun 6, 2022 · 8 comments
Closed

[BUG] Suppressing retries for 30 seconds #746

Hawkedon opened this issue Jun 6, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@Hawkedon
Copy link

Hawkedon commented Jun 6, 2022

Hi @jurialmunkey, I always encounter the "Suppressing retries for 30 seconds" for TMDB and OMDB from TMDB helper. It happens very frequently. At first I thought it's the API usage limitation, but TMDB has no API limit, so I believe it's the add-on issue now.

ConnectionError: HTTPSConnectionPool(host='www.omdbapi.com', port=443): Max retries exceeded with url: //?apikey=&r=xml&i=tt0119174&plot=full&tomatoes=True (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000285B0EB2C10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Suppressing retries for 30 seconds

From the information below, it seems it's due to the connection pool usage limit, can you check this? Thanks!

https://stackoverflow.com/questions/46188295/python-httpconnectionpool-failed-to-establish-a-new-connection-errno-11004-ge

@Hawkedon Hawkedon added the bug Something isn't working label Jun 6, 2022
@jurialmunkey
Copy link
Owner

jurialmunkey commented Jun 6, 2022

OMDb has a 1000 requests per day limit. If you go over that you get a connection time out.

TMDb doesn't have a set limit. However, they do have rate limiting and if you go over the limit within a set period of time (e.g. lots of new requests for uncached items) then they will timeout the connection for a few minutes.

Basically TMDb rate limiting is like a bucket with a hole in it. Every request you make adds water to the bucket. If you make too many requests in a set time it overflows (timeout) and you have to wait for it to drain.

@Hawkedon
Copy link
Author

Hawkedon commented Jun 6, 2022

I'm sure I used ver few times of these API today, I manually tried the OMDB url in browser and could get the correct response each time. Based on the information from above stackoverflow thread, I checked the TMDB helper code, it does use response directly from requests module. Can you try to copy the response result and close the connection as soon as possible after using? I can test it first if you can make a test build.

@jurialmunkey
Copy link
Owner

jurialmunkey commented Jun 6, 2022

I'm sure I used ver few times of these API today, I manually tried the OMDB url in browser and could get the correct response each time. Based on the information from above stackoverflow thread, I checked the TMDB helper code, it does use response directly from requests module. Can you try to copy the response result and close the connection as soon as possible after using? I can test it first if you can make a test build.

Can't see any harm in trying.

Requests module is not meant to need to call response.close() explicitly to release connections to the pool but I can see how threading might complicate that.

Add a test build in this PR: #747
https://github.com/jurialmunkey/plugin.video.themoviedb.helper/tree/requests_testbuild

@Hawkedon
Copy link
Author

Hawkedon commented Jun 7, 2022

Thanks @jurialmunkey, I tried the test build for some time and didn't see any previous errors, but I can see the errors like the following, it's much less frequent though. These errors seems not to be related with TMDB/OMDB, as I'm on Xbox which is a restricted platform, not sure whether this may related with the python functionality on Xbox.

INFO : [plugin.video.themoviedb.helper]
ConnectionError: ('Connection aborted.', timeout('_ssl.c:1111: The handshake operation timed out'))
Suppressing retries for 30 seconds

INFO : [plugin.video.themoviedb.helper]
ConnectionTimeOut: HTTPSConnectionPool(host='www.omdbapi.com', port=443): Read timed out. (read timeout=10)

@jurialmunkey
Copy link
Owner

We could try bumping up the timeout a bit. I just pushed an update to that branch which bumps timeout to 15 seconds

@SubEdict
Copy link

SubEdict commented Jun 12, 2022

Same here (on 3 PC), getting this message every time I start Kodi or after episode ended (When the TV Progress list need to update). "ConnectionError: TraktAPI Timeout. Suppressing retries for 30 seconds."

INFO <general>: [plugin.video.themoviedb.helper] TraktAPI.get_sync.Locked.watched.show.tmdb Timeout!
INFO <general>: [plugin.video.themoviedb.helper] ConnectionTimeOut: HTTPSConnectionPool(host='api.trakt.tv', port=443): Read timed out. (read timeout=20)
INFO <general>: [plugin.video.themoviedb.helper] No response for TraktAPI._get_sync_response./sync/watched/shows&extended=full Attempting fallback... Success!
INFO <general>: initializing python engine.
INFO <general>: CPythonInvoker(46, C:\Users\me\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\plugin.py): script successfully run
INFO <general>: Python interpreter stopped

Deleted everything (All cached), re-install, authorize-re authorize trakt, nothing help.

  • It all started 2-3 weeks ago. :(

We could try bumping up the timeout a bit.

Yes please.

@jurialmunkey
Copy link
Owner

I already did bump the time out. Anything now is the api refusing the connection because their server is busy or due to rate limiting. Trakt in particular has had issues of late with their servers.

@SubEdict
Copy link

SubEdict commented Jun 13, 2022

Thanks @jurialmunkey. Didn't see the update from the regular repo (still show 4.8.9 in kodi), updated from here 4.8.11.
Looks OK, working 2~3 hours, no error message.

Yeah, I know about Trakt API issue. They did say "fixed it, added more servers etc." and other addons doesn't show this message (But they do takes 45-90 seconds to complete) so the message from TMDBHelper was a little confusing. :)

Update: launch Kodi after couple of hours. The message return. Bummer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants