dylandoamaral / trakt-integration

A Trakt integration for Home Assistant compatible with upcoming media card
MIT License
30 stars 12 forks source link

API_RATE_LIMIT and 'NoneType' Errors #71

Closed dr0ops closed 7 months ago

dr0ops commented 1 year ago

Home Assistant OS (Raspberry Pi 4), Home Assistant 2023.4.2 Supervisor 2023.04.0 Operating System 10.0.rc3

config

trakt_tv: language: en timezone: Europe/Stockholm sensors: next_to_watch: only_upcoming: max_medias: 10

end

Just can't seem to get it to work, failing to fetch data from trakt.tv

2023-04-13 02:14:25.480 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 28 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:14:25.676 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 36 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:14:25.712 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/movies?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 26 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:14:25.714 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 36 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:14:25.775 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 36 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:14:52.181 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/movies?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 9 seconds then retry your request.. Retrying at least 3 times. 2023-04-13 02:14:53.954 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 5 seconds then retry your request.. Retrying at least 3 times. 2023-04-13 02:14:59.383 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 2 seconds then retry your request.. Retrying at least 2 times. 2023-04-13 02:15:01.833 ERROR (MainThread) [custom_components.trakt_tv] Unexpected error fetching trakt data: 'NoneType' object is not iterable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 206, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 304, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 251, in fetch_next_to_watch data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 206, in fetch_upcoming raw_medias = await self.fetch_watched(excluded_shows) File "/config/custom_components/trakt_tv/apis/trakt.py", line 112, in fetch_watched for hidden_item in hidden_items: TypeError: 'NoneType' object is not iterable 2023-04-13 02:16:08.999 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/175877/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 231 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:09.083 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/172787/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 232 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:09.113 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/157783/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 227 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:32.591 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 209 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:32.599 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 208 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:32.604 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 200 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:32.920 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/movies?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 208 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:16:32.926 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 207 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:17:17.641 ERROR (MainThread) [frontend.js.latest.202304061] :0:0 Script error. 2023-04-13 02:18:01.213 ERROR (MainThread) [frontend.js.latest.202304061] http://homeassistant.local:8123/frontend_latest/app-lrTETcwVatA.js:2:215408 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "mushroom-select" has already been used with this registry 2023-04-13 02:18:01.221 ERROR (MainThread) [frontend.js.latest.202304061] http://homeassistant.local:8123/hacsfiles/lovelace-media-art-background/media-art-background.js?hacstag=20287427051370:81:147 TypeError: null is not an object (near '...ha-panel-lovelace").shadowRoot.querySel...') 2023-04-13 02:18:12.741 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 109 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:18:13.031 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 108 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:18:13.041 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/movies?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 105 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:18:13.052 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 105 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:18:13.056 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 109 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:19:12.580 DEBUG (MainThread) [custom_components.trakt_tv] Finished fetching trakt data in 60.003 seconds (success: False) 2023-04-13 02:21:27.459 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/175652/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 214 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:21:27.531 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/154945/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 212 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:21:27.609 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/105214/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 204 seconds then retry your request.. Retrying at least 4 times. 2023-04-13 02:21:32.808 DEBUG (MainThread) [custom_components.trakt_tv] Finished fetching trakt data in 60.002 seconds (success: False)

robloh commented 1 year ago

I also sometimes see NoneType errors. I don't have any rate limit ones though.

This error originated from a custom integration.

Logger: custom_components.trakt_tv Source: custom_components/trakt_tv/apis/trakt.py:218 Integration: Trakt (documentation, issues) First occurred: 9:03:40 AM (1 occurrences) Last logged: 9:03:40 AM

Unexpected error fetching trakt data: 'NoneType' object is not iterable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 195, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 304, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 261, in fetch_upcomings data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 218, in fetch_upcoming raw_medias = [media for medias in data for media in medias] File "/config/custom_components/trakt_tv/apis/trakt.py", line 218, in raw_medias = [media for medias in data for media in medias] TypeError: 'NoneType' object is not iterable

dr0ops commented 1 year ago

still an issue, impossible to get it working :(

dylandoamaral commented 1 year ago

I think the main issue is the rate limit from trakt. Sadly we can't fix this "issue", you may want to reduce the number of sensor from this API. However I am creating a new version to increase retries hope it will help.

dr0ops commented 1 year ago

it's all of the 'next_to_watch:' sensors that don't work even if i only 'max_medias: 1' too... ('days_to_fetch:' work okey..)

the other sensors work that are in 'upcoming:' .. dunno really what to try atm, but looking forward to the new version =)

bryan-stewart commented 1 year ago

I seem to have a different error whenever I add the next_to_watch sensor.

Config entry 'Trakt' for trakt_tv integration not ready yet: Cannot connect to host api.tmdb.org:80 ssl:default [Try again]; Retrying in background

dylandoamaral commented 1 year ago

This is not the integration fault @bryan-stewart.

@dr0ops next to watch sensors was done by @Anrolosia maybe he has an idea. My guess is that this kind of sensor have to make many request and we hit the trakt limit.

Anrolosia commented 1 year ago

Hey there! It has been a long time since I didn't touch this project, but on my side too, with release 0.8.2 and the increase of retry times, I had the error, so I rolled back to previous version and it's working as previously. The issue with the next to watch sensor is that we have to call the user watch history, and then, for each tv show, we have to also make 1 call to each to fetch the current progress, sadly Trakt doesn't offer (yet) a way to do it all at once. I'll check the API to see if they changed that, and if there is a solution, but for the time being, I suggest you to rollback to 0.8.1

Anrolosia commented 1 year ago

Hey @dr0ops , feel free to check latest release from @dylandoamaral , it should solve a big part of your issues.

@dylandoamaral my last pr should fix the NoneType error, sorry, I forgot to include that in the cache strategy enhancement

dr0ops commented 1 year ago

Hi!

'next_watch' is the nr.1 feature i would like to have working from an trakt integration (think it's on everyone's nr.1 feature list even) but can't for the life of me figure out why it won't work, the other 'upcoming' sensors work without any problems...

*hope this helps to get some ideas of whats buggin' :)

Version : 0.8.3 - ( Home Assistant 2023.5.4, Supervisor 2023.04.1, Operating System 10.2, Frontend 20230503.3 - latest )

-- config --

trakt_tv: language: en timezone: Europe/Stockholm sensors: next_to_watch: all: max_medias: 10

-- end --

It's just 'initializing' for ages, and giving these errors for me atm..

-- errors --

2023-05-26 01:22:26.647 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 154 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:22:26.674 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/movies?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 163 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:22:26.680 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 162 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:22:26.687 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 162 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:22:26.693 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 143 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:22:31.732 WARNING (MainThread) [custom_components.trakt] Error retrving information from api.themoviedb.org 2023-05-26 01:22:42.439 WARNING (MainThread) [custom_components.trakt] Error retrving information from api.themoviedb.org 2023-05-26 01:22:50.154 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform trakt is taking over 10 seconds. 2023-05-26 01:22:59.443 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: trakt_tv 2023-05-26 01:23:59.549 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: trakt_tv 2023-05-26 01:24:59.657 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: trakt_tv 2023-05-26 01:25:59.755 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: trakt_tv 2023-05-26 01:26:15.957 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/181803/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 220 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:26:16.035 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/156001/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 225 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:26:16.054 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/161603/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 223 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:27:00.217 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: trakt_tv 2023-05-26 01:27:13.834 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Trakt for trakt_tv Traceback (most recent call last): File "/config/custom_components/trakt_tv/apis/trakt.py", line 164, in fetch_watched raw_episode = await self.fetch_show_progress(ids["trakt"]) File "/config/custom_components/trakt_tv/apis/trakt.py", line 188, in fetch_show_progress response = await self.request("get", f"shows/{id}/progress/watched") File "/config/custom_components/trakt_tv/apis/trakt.py", line 93, in request await self.retry_request( File "/config/custom_components/trakt_tv/apis/trakt.py", line 60, in retry_request await sleep(wait_time) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep return await future asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/trakt_tv/init.py", line 63, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 226, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 217, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 345, in retrieve_data data = await gather( asyncio.exceptions.CancelledError 2023-05-26 01:28:03.135 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/movies?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 118 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:28:03.143 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 118 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:28:03.147 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 118 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:28:03.151 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request users/hidden/calendar?type=show with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 115 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:28:03.154 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 118 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:31:13.876 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/158681/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 226 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:31:13.911 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/142065/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 227 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:31:13.961 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/112112/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 227 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:35:20.071 ERROR (MainThread) [custom_components.trakt_tv] Unexpected error fetching trakt data: 'NoneType' object has no attribute 'get' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 217, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 345, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 287, in fetch_next_to_watch data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 242, in fetch_upcoming raw_medias = await self.fetch_watched(excluded_shows) File "/config/custom_components/trakt_tv/apis/trakt.py", line 165, in fetch_watched if raw_episode.get("next_episode") is not None: AttributeError: 'NoneType' object has no attribute 'get' 2023-05-26 01:35:20.076 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Trakt' for trakt_tv integration not ready yet: 'NoneType' object has no attribute 'get'; Retrying in background 2023-05-26 01:36:19.490 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/66546/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 221 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:36:19.526 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/66546/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 222 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:36:19.582 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/138172/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 221 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:40:20.662 ERROR (MainThread) [custom_components.trakt_tv] Unexpected error fetching trakt data: 'NoneType' object has no attribute 'get' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 217, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 345, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 287, in fetch_next_to_watch data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 242, in fetch_upcoming raw_medias = await self.fetch_watched(excluded_shows) File "/config/custom_components/trakt_tv/apis/trakt.py", line 165, in fetch_watched if raw_episode.get("next_episode") is not None: AttributeError: 'NoneType' object has no attribute 'get' 2023-05-26 01:40:20.668 DEBUG (MainThread) [custom_components.trakt_tv] Finished fetching trakt data in 295.055 seconds (success: False) 2023-05-26 01:41:23.792 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/182955/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 215 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:41:23.832 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/112112/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 208 seconds then retry your request.. Retrying at least 9 time(s). 2023-05-26 01:41:23.845 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/110877/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 212 seconds then retry your request.. Retrying at least 9 time(s).

-- end --

Anrolosia commented 1 year ago

With my last PR, a part of those errors should be gone ( AttributeError: 'NoneType' object has no attribute 'get' ) and it might clarify a bit. Let see when it will be merged, shall we? Also, what you could try during that time is to play a bit with config and don't fetch all? This is an example of my config if you'd like to test:

trakt_tv:
  language: fr # Prefered language for movie/show title
  timezone: America/Montreal
  sensors:
    next_to_watch:
      only_aired:
        max_medias: 40
      only_upcoming:
        max_medias: 40
dr0ops commented 1 year ago

No luck, everything fails when trying 'next_to_watch' sensors.. only ones working are all 'upcoming' sensors...

really annoying and frustrating when can't figure out the problem... it's like it can't get my watched info without hitting rate_limiting or something...

-- errors --

This error originated from a custom integration.

Logger: custom_components.trakt_tv.apis.trakt Source: custom_components/trakt_tv/apis/trakt.py:242 Integration: Trakt (documentation, issues) First occurred: 03:38:24 (12 occurrences) Last logged: 03:40:52

Can't request shows/170227/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 227 seconds then retry your request.. Retrying at least 9 time(s). Can't request shows/138748/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 249 seconds then retry your request.. Retrying at least 9 time(s). Can't request shows/138748/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 248 seconds then retry your request.. Retrying at least 9 time(s). Can't request shows/141569/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 248 seconds then retry your request.. Retrying at least 9 time(s). Can't request shows/197798/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 248 seconds then retry your request.. Retrying at least 9 time(s).

-- end --

dr0ops commented 1 year ago

Is it just me or anyone else having issues with 'next_to_watch' sensors? ..

Version: 0.8.4

-- errors --

Logger: custom_components.trakt_tv.apis.trakt Source: custom_components/trakt_tv/apis/trakt.py:243 Integration: Trakt (documentation, issues) First occurred: 17:20:23 (3 occurrences) Last logged: 17:22:01

Can't request users/hidden/calendar?type=show with get because it returns a 502 status code with content <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]--> <head> <title>api.trakt.tv | 502: Bad gateway</title> <meta charset="UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta name="robots" content="noindex, nofollow" /> <meta name="viewport" content="width=device-width,initial-scale=1" /> <link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" /> </head> <body> <div id="cf-wrapper"> <div id="cf-error-details" class="p-0"> <header class="mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-8"> <h1 class="inline-block sm:block sm:mb-2 font-light text-60 lg:text-4xl text-black-dark leading-tight mr-2"> <span class="inline-block">Bad gateway</span> <span class="code-label">Error code 502</span> </h1> <div> Visit <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_502&utm_campaign=api.trakt.tv" target="_blank" rel="noopener noreferrer">cloudflare.com</a> for more information. </div> <div class="mt-3">2023-05-26 15:20:21 UTC</div> </header> <div class="my-8 bg-gradient-gray"> <div class="w-240 lg:w-full mx-auto"> <div class="clearfix md:px-8"> <div id="cf-browser-status" class=" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center"> <div class="relative mb-10 md:m-0"> <span class="cf-icon-browser block md:hidden h-20 bg-center bg-no-repeat"></span> <span class="cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span> </div> <span class="md:block w-full truncate">You</span> <h3 class="md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3"> Browser </h3> <span class="leading-1.3 text-2xl text-green-success">Working</span> </div> <div id="cf-cloudflare-status" class=" relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center"> <div class="relative mb-10 md:m-0"> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_502&utm_campaign=api.trakt.tv" target="_blank" rel="noopener noreferrer"> <span class="cf-icon-cloud block md:hidden h-20 bg-center bg-no-repeat"></span> <span class="cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span> </a> </div> <span class="md:block w-full truncate">Stockholm</span> <h3 class="md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3"> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_502&utm_campaign=api.trakt.tv" target="_blank" rel="noopener noreferrer"> Cloudflare </a> </h3> <span class="leading-1.3 text-2xl text-green-success">Working</span> </div> <div id="cf-host-status" class="cf-error-source relative w-1/3 md:w-full py-15 md:p-0 md:py-8 md:text-left md:border-solid md:border-0 md:border-b md:border-gray-400 overflow-hidden float-left md:float-none text-center"> <div class="relative mb-10 md:m-0"> <span class="cf-icon-server block md:hidden h-20 bg-center bg-no-repeat"></span> <span class="cf-icon-error w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span> </div> <span class="md:block w-full truncate">api.trakt.tv</span> <h3 class="md:inline-block mt-3 md:mt-0 text-2xl text-gray-600 font-light leading-1.3"> Host </h3> <span class="leading-1.3 text-2xl text-red-error">Error</span> </div> </div> </div> </div> <div class="w-240 lg:w-full mx-auto mb-8 lg:px-8"> <div class="clearfix"> <div class="w-1/2 md:w-full float-left pr-6 md:pb-10 md:pr-0 leading-relaxed"> <h2 class="text-3xl font-normal leading-1.3 mb-4">What happened?</h2> <p>The web server reported a bad gateway error.</p> </div> <div class="w-1/2 md:w-full float-left leading-relaxed"> <h2 class="text-3xl font-normal leading-1.3 mb-4">What can I do?</h2> <p class="mb-6">Please try again in a few minutes.</p> </div> </div> </div> <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300"> <p class="text-13"> <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">7cd700700a3498f4</strong></span> <span class="cf-footer-separator sm:hidden">&bull;</span> <span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1"> Your IP: <button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button> <span class="hidden" id="cf-footer-ip">85.228.45.120</span> <span class="cf-footer-separator sm:hidden">&bull;</span> </span> <span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_502&utm_campaign=api.trakt.tv" id="brand_link" target="_blank">Cloudflare</a></span> </p> <script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script> </div><!-- /.error-footer --> </div> </div> </body> </html> . Retrying at least 9 time(s).
Can't request shows/1414/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 180 seconds then retry your request.. Retrying at least 9 time(s).
Can't request shows/151661/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 179 seconds then retry your request.. Retrying at least 9 time(s).

Logger: homeassistant.config_entries Source: custom_components/trakt_tv/apis/trakt.py:346 Integration: Trakt (documentation, issues) First occurred: 17:25:14 (1 occurrences) Last logged: 17:25:14 Error setting up entry Trakt for trakt_tv

Traceback (most recent call last): File "/config/custom_components/trakt_tv/apis/trakt.py", line 97, in request await self.retry_request(300, response, method, url, retry, **kwargs) File "/config/custom_components/trakt_tv/apis/trakt.py", line 60, in retry_request await sleep(wait_time) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 605, in sleep return await future asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/trakt_tv/init.py", line 63, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 226, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 217, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 346, in retrieve_data data = await gather( asyncio.exceptions.CancelledError

-- end --

TNTPro commented 11 months ago

Is it just me or anyone else having issues with 'next_to_watch' sensors? ..

Version: 0.8.4

I also have rate limit errors.

dylandoamaral commented 10 months ago

I tried many fixes but my knowledge in asyncio are limitfull, if anybody want to try figure out what's wrong, don't hesitate.

S74NK commented 9 months ago

After around 1.5yrs of having this same issue, It just populated sometime overnight, but has unfortunately quit again.

engeld commented 7 months ago

I'm also affected - I added the integration without any problems but now those error's keep popping up:

2023-11-19 13:10:20.912 ERROR (MainThread) [custom_components.trakt_tv] Unexpected error fetching trakt data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 346, in retrieve_data
    data = await gather(
           ^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 288, in fetch_next_to_watch
    data = await gather(
           ^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 243, in fetch_upcoming
    raw_medias = await self.fetch_watched(excluded_shows)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 174, in fetch_watched
    show["first_aired"] = raw_episode_full["first_aired"]
                          ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
2023-11-19 13:10:56.323 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/160495/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.385 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/168309/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.391 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/180675/seasons/1/episodes/3?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 245 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.395 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/145567/seasons/1/episodes/1?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.405 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/133322/seasons/2/episodes/7?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.410 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/174427/seasons/1/episodes/5?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.414 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/39617/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.419 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/168309/seasons/1/episodes/7?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.454 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/180675/seasons/1/episodes/3?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-19 13:10:56.462 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/39617/seasons/7/episodes/7?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
dylandoamaral commented 7 months ago

Thanks for the logs, the next to watch sensors seems to be the cause of many issues. I made a little fix that may help you with your issue: https://github.com/dylandoamaral/trakt-integration/pull/86.

Don't hesitate to comment if everything is better after the release or not and thanks for the logs it helped a lot.

engeld commented 7 months ago

I installed the new version (thanks!) and while the "NoneType object is not scriptable"-Errors seemed to be fixed there is now another one popping up. The 429 API_GET_LIMIT exceeded is still there but I guess that is to be expected. Plus now the now the setup eventually fails with an exception - Here's a snipped of the log containing all three errors - hope this helps.

2023-11-23 17:25:13.512 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show aj-and-the-queen can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:18.505 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show medical-police can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:20.480 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show schitt-s-creek can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:20.510 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show awkwafina-is-nora-from-queens can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:21.356 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show harmonquest can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:21.455 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show awkwafina-is-nora-from-queens can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:22.256 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show bomb-girls can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:22.390 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show fleabag can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:22.486 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show fleabag can't be extracted due to 'NoneType' object is not subscriptable
2023-11-23 17:25:49.757 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/60354/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 244 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.758 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/1969/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 246 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.813 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/14916/progress/watched with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 252 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.867 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/123834/seasons/1/episodes/4?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 251 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.875 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/14916/seasons/11/episodes/72?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 248 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.889 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/1394/seasons/4/episodes/12?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 251 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.912 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/77938/seasons/1/episodes/8?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 251 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:49.934 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/99046/seasons/2/episodes/12?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 251 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:25:50.154 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Can't request shows/123112/seasons/1/episodes/4?extended=full with get because it returns a 429 status code with content AUTHED_API_GET_LIMIT rate limit exceeded. Please wait 251 seconds then retry your request.. Retrying at least 9 time(s).
2023-11-23 17:28:42.726 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Trakt for trakt_tv
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/__init__.py", line 63, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in async_config_entry_first_refresh
    await self._async_refresh(
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 368, in retrieve_data
    data = await gather(
           ^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 310, in fetch_next_to_watch
    data = await gather(
           ^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 265, in fetch_upcoming
    raw_medias = await self.fetch_watched(excluded_shows)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 182, in fetch_watched
    raw_next_episode = await self.fetch_show_informations(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 220, in fetch_show_informations
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 93, in request
    await self.retry_request(
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 60, in retry_request
    await sleep(wait_time)
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 649, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost
dylandoamaral commented 7 months ago

It seems not related to the release, but a connection issue. About the 429, indeed it is "expected" even if I think that we make too much request to the trakt API when using next_to_watch sensors.

dylandoamaral commented 7 months ago

I will close it for the moment, feel free to reopen if issue still exists.