fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 101 forks source link

API returned HTTP status ERROR code 502/Bad Gateway #472

Open galex80 opened 2 years ago

galex80 commented 2 years ago

Describe the bug Since the latest update, i recognized this error in my logs:

Logger: custom_components.reolink_dev Source: custom_components/reolink_dev/base.py:255 Integration: Reolink IP camera (documentation, issues) First occurred: March 16, 2022, 5:35:23 PM (3 occurrences) Last logged: 6:34:09 AM

Unexpected error fetching reolink.Hauseingang data: API returned HTTP status ERROR code 502/Bad Gateway Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/reolink_dev/init.py", line 98, in async_update_data await base.update_states() File "/config/custom_components/reolink_dev/base.py", line 255, in update_states await self._api.get_states() File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 460, in get_states response = await self.send(body) File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1714, in send raise ApiError( reolink.exceptions.ApiError: API returned HTTP status ERROR code 502/Bad Gateway To Reproduce Unclear, how to reproduce this issue

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment: Please provide useful information about your environment, like:

Host Operating System | Home Assistant OS 7.5 Update Channel | stable Supervisor Version | supervisor-2022.03.4

enkama commented 2 years ago

Yea please fix this or at least dont let it appear. Its spamming my log and its coming over homeassistant so I cant even suppress the log. @fwestenberg

stalakerob commented 2 years ago

I also got this error and several others. I did 2 things that made most of those disappear, incl. the 502/bad gateway error:

enkama commented 2 years ago

Removing the camera from the generic camera configuration seems to fix it for me.

arigit commented 2 years ago

@Wibias what generic camera configuration are you referring to? can you elaborate? is this something you had in configuration.yaml, or another integration you had before? I don't seem to have either any reference to this cam in yaml nor any other camera integration I see this error as well. Half a dozen times per hour or so

stalakerob commented 2 years ago

@arigit Generic Camera: https://www.home-assistant.io/integrations/generic/ This worked for me for a while but then the error came back and some others too. So I went away from this component and switched to WebRTC and REST for the alarms. See here https://community.home-assistant.io/t/reolink-nvr-to-home-assistant-issue/430491