Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onvif/camera set up error #26825

Merged
merged 1 commit into from Sep 23, 2019

Conversation

@sanyatuning
Copy link
Contributor

commented Sep 22, 2019

Description:

If the device is slow or temporary not available, the entity won't be accessible in HA.
In that case, the aiohttp rises "ServerDisconnectedError" but this is not extends "ClientConnectorError".

Error while setting up platform onvif
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 110, in async_setup_platform
    await hass_camera.async_initialize()
  File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 168, in async_initialize
    await self.async_obtain_input_uri()
  File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 242, in async_obtain_input_uri
    profiles = await media_service.GetProfiles()
  File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/bindings.py", line 13, in send
    options["address"], envelope, http_headers
  File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 107, in post_xml
    response = await self.post(address, message, headers)
  File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 95, in post
    proxy=self.proxy,
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None

Related issue (if applicable): fixes #23978

config.xml

camera:
- name: Garden
  platform: onvif
  host: 192.168.0.92

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
@project-bot project-bot bot added this to Needs review in Dev Sep 22, 2019
@MartinHjelmare MartinHjelmare changed the title fix onvif/camera setting up error Fix onvif/camera set up error Sep 23, 2019
Dev automation moved this from Needs review to Reviewer approved Sep 23, 2019
@Adminiuga Adminiuga merged commit 5e6840d into home-assistant:dev Sep 23, 2019
12 checks passed
12 checks passed
CI Build #20190922.50 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 5624e3e...d35d75c
Details
codecov/project 94.05% (target 90%)
Details
docs-missing Documentation ok.
Dev automation moved this from Reviewer approved to Done Sep 23, 2019
@lock lock bot locked and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.