dylandoamaral / trakt-integration

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

Persistent error on HA update 2023.1.5: Retrying setup: 'HassClientResponse' object has no attribute 'status_code' #61

Closed hindsight2021 closed 1 year ago

hindsight2021 commented 1 year ago

Error seen in 'integrations' I see others have encountered this recently in other closed issues, deleting/removing from HACS and re-installing did not resolve for me:

Retrying setup: 'HassClientResponse' object has no attribute 'status_code'

image

HA Log - error repeats about every 2 mins on startup

2023-01-17 11:11:59.980 ERROR (MainThread) [custom_components.trakt_tv] Unexpected error fetching trakt data: 'HassClientResponse' object has no attribute 'status_code' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 289, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 263, in fetch_recommendations data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 256, in fetch_recommendation return await self.request( File "/config/custom_components/trakt_tv/apis/trakt.py", line 68, in request elif response.status_code == 429: AttributeError: 'HassClientResponse' object has no attribute 'status_code'

Tried:

It was working fine prior to today, the only thing I did was update my config YAML to add premieres which I omitted before.

Reverted to your default YAML from install instructions today, no changes.

The only change in my environment was an update to HA: 2023.1.5 done today.

dnestico commented 1 year ago

Same

manticore1991 commented 1 year ago

Yep, same for me. Originally I thought this was due to Trakt's downtime early in December last year, but it appears something else is broken here :(.

dylandoamaral commented 1 year ago

I will certainly try to fix this tomorrow night guys !

manticore1991 commented 1 year ago

Thank you very much, I appreciate it! Thanks also for developing this integration in the first place, it's really awesome! =)

hindsight2021 commented 1 year ago

@dylandoamaral not sure if it's just me, but I've upgraded to 0.7.3 and it's stopped that specific error, but now it fails to initialize entirely for me. I've tried a full removal from HA/HACS and reinstall, rebooted a few times, same behavior/error in log with debugging enabled:

image

Logger: homeassistant.config_entries Source: config_entries.py:825 First occurred: 9:54:46 AM (1 occurrences) Last logged: 9:54:46 AM Config entry 'Trakt' for trakt_tv integration not ready yet; Retrying in background

It just seems to be in a startup loop. It took my Trakt API ID/secret and URL Oauth without issue, it's after this time it bootloops consistently.

It does not seem to stop rebooting itself, nor write any additional info in any logs - so I have no idea what it's doing/excepting on.

any ideas?

dylandoamaral commented 1 year ago

It should not be related, you should create a new issue. Did you still have the issue ?