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

Detected blocking call to open inside the event loop by integration 'jvc_projector' #119979

Closed
jgus opened this issue Jun 19, 2024 · 5 comments
Closed

Comments

@jgus
Copy link
Contributor

jgus commented Jun 19, 2024

The problem

WARNINGs in HA logs on startup, requesting me to file a bug (see log details below)

What version of Home Assistant Core has the issue?

core-2024.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

jvc_projector

Link to integration documentation on our website

https://www.home-assistant.io/integrations/jvc_projector/

Diagnostics information

The integration doesn't appear to give me the option to download diagnostic data; sorry. Here's the debug log:

home-assistant_jvc_projector_2024-06-19T17-01-17.061Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Jun 19 10:25:49 d1 docker-home-assistant-start[627711]: 2024-06-19 10:25:49.329 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by integration 'jvc_projector' at homeassistant/components/jvc_projector/__init__.py, line 33: await device.connect(True) (offender: /usr/local/lib/python3.12/site-packages/dns/resolver.py, line 992: cm: contextlib.AbstractContextManager = open(f)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+jvc_projector%22
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]: Traceback (most recent call last):
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "<frozen runpy>", line 198, in _run_module_as_main
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "<frozen runpy>", line 88, in _run_code
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     sys.exit(main())
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     exit_code = runner.run(runtime_conf)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     return loop.run_until_complete(setup_and_run_hass(runtime_config))
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     self.run_forever()
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     self._run_once()
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     handle._run()
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     self._context.run(self._callback, *self._args)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     result = await _async_setup_component(hass, domain, config)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/setup.py", line 447, in _async_setup_component
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     await asyncio.gather(
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/setup.py", line 449, in <genexpr>
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     create_eager_task(
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     return Task(coro, loop=loop, name=name, eager_start=True)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     await self.async_setup(hass, integration=integration)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     result = await component.async_setup_entry(hass, self)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/components/jvc_projector/__init__.py", line 33, in async_setup_entry
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     await device.connect(True)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]: 
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]: 2024-06-19 10:25:49.357 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by integration 'jvc_projector' at homeassistant/components/jvc_projector/__init__.py, line 33: await device.connect(True) (offender: /usr/local/lib/python3.12/site-packages/dns/rdata.py, line 660: mod = import_module(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+jvc_projector%22
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]: Traceback (most recent call last):
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "<frozen runpy>", line 198, in _run_module_as_main
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "<frozen runpy>", line 88, in _run_code
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     sys.exit(main())
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     exit_code = runner.run(runtime_conf)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     return loop.run_until_complete(setup_and_run_hass(runtime_config))
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     self.run_forever()
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     self._run_once()
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     handle._run()
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     self._context.run(self._callback, *self._args)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     await self.async_setup(hass, integration=integration)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     result = await component.async_setup_entry(hass, self)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:   File "/usr/src/homeassistant/homeassistant/components/jvc_projector/__init__.py", line 33, in async_setup_entry
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:     await device.connect(True)
Jun 19 10:25:49 d1 docker-home-assistant-start[627711]:

Additional information

No response

@home-assistant
Copy link

Hey there @SteveEasley, @msavazzi, mind taking a look at this issue as it has been labeled with an integration (jvc_projector) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of jvc_projector can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign jvc_projector Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


jvc_projector documentation
jvc_projector source
(message by IssueLinks)

@SteveEasley
Copy link
Contributor

Thanks jgus. PR for fix was submitted.

SteveEasley added a commit to SteveEasley/pyjvcprojector that referenced this issue Aug 9, 2024
@AnalogThinker
Copy link

Not sure if this is the same issue, sharing and interested in feedback if I should open a new Issue.

I am seeing the JVC integration going greyed out after using it a few times.

Logs give me a warning:
Logger: jvcprojector.command
Source: components/jvc_projector/coordinator.py:46
response '' not int for cmd 'SC'

and I also have a long Error:
_Logger: homeassistant.components.jvc_projector.coordinator
Source: helpers/update_coordinator.py:354
integration: JVC Projector (documentation, issues)
First occurred: August 18, 2024 at 5:57:27 PM (2 occurrences)
Last logged: August 18, 2024 at 8:44:07 PM

Unexpected error fetching JVC Projector data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/jvc_projector/coordinator.py", line 46, in _async_update_data
state = await self.device.get_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/jvcprojector/projector.py", line 126, in get_state
res = await self._send([pwr, inp, src])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/jvcprojector/projector.py", line 180, in _send
await self._device.send(cmds)
File "/usr/local/lib/python3.12/site-packages/jvcprojector/device.py", line 78, in send
await self._send(cmd)
File "/usr/local/lib/python3.12/site-packages/jvcprojector/device.py", line 172, in _send
data = await self._conn.readline()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/jvcprojector/connection.py", line 52, in readline
return await asyncio.wait_for(self._reader.readline(), timeout=self._timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/streams.py", line 568, in readline
line = await self.readuntil(sep)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/streams.py", line 660, in readuntil
await self._wait_for_data('readuntil')
File "/usr/local/lib/python3.12/asyncio/streams.py", line 545, in _wait_for_data
await self._waiter
File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1003, in _read_ready__data_received
data = self.sock.recv(self.max_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer

Note that the Projector itself is still having proper LAN connectivity, so is the rest of the HA server.

@SteveEasley
Copy link
Contributor

This looks like a new issue. Would you mind creating a new one, including the projector model you are using?

@SteveEasley
Copy link
Contributor

@home-assistant close

@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants