dylandoamaral / trakt-integration

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

502 status Bad Gateway #64

Closed giloser closed 1 year ago

giloser commented 1 year ago

Hi,

first thanks for you hard work, I had the issue #63 and you fix it in no time ! but since I got the following error and in the log it say if we see the error to raise an issue so here I am.

I tried searching in the closed issues and on the net but didn't found a solution yet. here is the log hope it can help you fix it or explaining what I did wrong.

thanks

Unexpected error fetching trakt data: Can't request users/hidden/calendar?type=show with get because it returns a 502 status code with reason Bad Gateway. If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues. Unexpected error fetching trakt data: Can't request shows/195503/progress/watched with get because it returns a 502 status code with reason Bad Gateway. If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues. Unexpected error fetching trakt data: Can't request shows/119137/progress/watched with get because it returns a 502 status code with reason Bad Gateway. If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues. 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 236, in fetch_next_to_watch data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 191, in fetch_upcoming raw_medias = await self.fetch_watched(excluded_shows) File "/config/custom_components/trakt_tv/apis/trakt.py", line 94, in fetch_watched hidden_items = await self.request( File "/config/custom_components/trakt_tv/apis/trakt.py", line 75, in request raise TraktException(f"{error}\n{guidance}") custom_components.trakt_tv.exception.TraktException: Can't request users/hidden/calendar?type=show with get because it returns a 502 status code with reason Bad Gateway. If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues.

dylandoamaral commented 1 year ago

According to the API, it means that the trakt server had a problem. Do you still have the issue ?

giloser commented 1 year ago

yes I still have the issue. I waited to see if it was temporary, I tried to reinstall once again from scratch but still the same.

hindsight2021 commented 1 year ago

I have the same exact error string.

dylandoamaral commented 1 year ago

I tried something in 0.7.4. I don't think it will fix the bug... Nevermind I also update the error to have better information, don't hesitate to tell me what is the new error message.

giloser commented 1 year ago

Thanks for the fast update !

I put the trace in a file as there is html tag in it. trace_trakt.log

NederWeb commented 1 year ago

Having the same issue, comparable to the others.

From the log: https://www.cloudflare.com/5xx-error-landing?utm_source=errorcode_502&utm_campaign=api.trakt.tv

dylandoamaral commented 1 year ago

0.7.5 should fix the error as described in https://trakt.docs.apiary.io/#introduction/status-codes. If the issue persist, I don't know how to fix it. It seems to be a trakt issue not an intgegration one.

giloser commented 1 year ago

Hi thanks,

I update last night and today I tried to restart from scratch.

and sorry I still got an error. if you say the issue is on the trakt side, could we create a call on their side then? could you explain what we should ask? What I don't understand is that it works from some so what is different from me that from the others?

Thanks a lot here is the log:

Logger: custom_components.trakt_tv Source: custom_components/trakt_tv/apis/trakt.py:80 Integration: Trakt (documentation, issues) First occurred: 14:50:27 (2 occurrences) Last logged: 14:51:48

Unexpected error fetching trakt data: Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 401 status code with content . If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues. Unexpected error fetching trakt data: Can't request users/hidden/calendar?type=show with get because it returns a 401 status code with content . If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues. 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 294, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 268, in fetch_recommendations data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 261, in fetch_recommendation return await self.request( File "/config/custom_components/trakt_tv/apis/trakt.py", line 80, in request raise TraktException(f"{error}\n{guidance}") custom_components.trakt_tv.exception.TraktException: Can't request recommendations/shows?limit=3&ignore_collected=false with get because it returns a 401 status code with content . If you find this error, please raise an issue at https://github.com/dylandoamaral/trakt-integration/issues.

dylandoamaral commented 1 year ago

You should create another issue, it is not a 502 error but a 401 (unauthorized) one.

giloser commented 1 year ago

ok thanks I'll do that

dylandoamaral commented 1 year ago

Seems to be ok now