dylandoamaral / trakt-integration

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

Can't authenticate Trakt integration #101

Open CreepyGiantz opened 1 month ago

CreepyGiantz commented 1 month ago

Whenever attempting to connect Trakt, it loads for a little while saying: "Loading next step for Trakt". Then proceeds to just give me an empty error message. It still appears in my integration list. With the warning "Failed to setup", check logs. The only relevant thing I managed to find in the logs are a whole bunch of these:

2024-05-21 23:31:51.990 WARNING (MainThread) [custom_components.trakt_tv.apis.trakt] Show i-am-groot can't be extracted due to 'NoneType' object is not subscriptable

CreepyGiantz commented 2 weeks ago

I attempted once more with a new Trakt account in an attempt to exclude some possible causes. And I'll add some more relevant logs underneath. The previously described scenario is the same. Empty error message once again.

2024-06-22 18:24:41.014 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'trakt_tv' at custom_components/trakt_tv/apis/trakt.py, line 288: pytz.timezone(configuration.get_timezone()) (offender: /usr/local/lib/python3.12/site-packages/pytz/__init__.py, line 108: return open(filename, 'rb')), please create a bug report at https://github.com/dylandoamaral/trakt-integration/issues
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 316, in fetch_next_to_watch
    data = await self.fetch_upcoming(
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 288, in fetch_upcoming
    pytz.timezone(configuration.get_timezone())

2024-06-22 18:26:09.713 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 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/__init__.py", line 64, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 277, in async_config_entry_first_refresh
    await self._async_refresh(
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 446, in retrieve_data
    sources_data = await gather(*coroutine_sources_data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 369, in fetch_recommendations
    data = await gather(
           ^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 352, in fetch_recommendation
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/trakt_tv/apis/trakt.py", line 78, in request
    response = await self.web_session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^