Skip to content

v3: Detected blocking call to open ... #48

Description

@schlomo

@jonasniesner while using https://github.com/jonasniesner/Home_Assistant_Integration/tree/Designer_test I encountered this

Logger: homeassistant.util.loop
Source: util/loop.py:135
First occurred: 23:47:35 (1 occurrence)
Last logged: 23:47:35

Detected blocking call to open with args ('/media/pohl89-480h.png', 'rb') inside the event loop by custom integration 'opendisplay' at custom_components/opendisplay/services.py, line 582: 
  img = await generate_image( 
  (offender: /usr/local/lib/python3.14/site-packages/PIL/Image.py, line 3635: fp = builtins.open(filename, "rb")), 

please create a bug report at https://github.com/OpenDisplay/Home_Assistant_Integration/issues 
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 

Traceback (most recent call last): 
  File "<frozen runpy>", line 203, in _run_module_as_main 
  File "<frozen runpy>", line 88, in _run_code 
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 227, in <module> sys.exit(main()) 
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) 
  File "/usr/src/homeassistant/homeassistant/runner.py", line 289, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) 
  File "/usr/local/lib/python3.14/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() 
  File "/usr/local/lib/python3.14/asyncio/base_events.py", line 677, in run_forever self._run_once() 
  File "/usr/local/lib/python3.14/asyncio/base_events.py", line 2057, in _run_once handle._run() 
  File "/usr/local/lib/python3.14/asyncio/events.py", line 94, in _run self._context.run(self._callback, *self._args) 
  File "/usr/local/lib/python3.14/site-packages/aiohttp/web_protocol.py", line 517, in _handle_request resp = await request_handler(request) 
  File "/usr/local/lib/python3.14/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) 
  File "/usr/local/lib/python3.14/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) 
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 90, in security_filter_middleware return await handler(request) 
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 86, in forwarded_middleware return await handler(request) 
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware return await handler(request) 
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware return await handler(request) 
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 261, in auth_middleware return await handler(request) 
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 39, in headers_middleware response = await handler(request) 
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 91, in handle result = await handler(request, **request.match_info) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 57, in get return await WebSocketHandler(request.app[KEY_HASS], request).async_handle() 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 354, in async_handle await self._async_websocket_command_phase(connection) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 528, in _async_websocket_command_phase async_handle_str(command_msg_data) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 249, in async_handle handler(self.hass, self, schema(msg)) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 67, in with_admin func(hass, connection, msg) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 45, in schedule_handler hass.async_create_background_task( 
  File "/usr/src/homeassistant/homeassistant/core.py", line 835, in async_create_background_task task = create_eager_task(target, name=name, loop=self.loop) 
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 42, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response await func(hass, connection, msg) 
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 1182, in handle_execute_script script_result = await script_obj.async_run( 
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1892, in async_run return await asyncio.shield(create_eager_task(run.async_run())) 
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 42, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) 
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 465, in async_run await self._async_step(log_exceptions=False) 
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 530, in _async_step await getattr(self, handler)() 
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1028, in _async_step_call_service self._hass.async_create_task_internal( 
  File "/usr/src/homeassistant/homeassistant/core.py", line 803, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) 
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 42, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) 
  File "/usr/src/homeassistant/homeassistant/core.py", line 2827, in async_call response_data = await coro 
  File "/usr/src/homeassistant/homeassistant/core.py", line 2870, in _execute_service return await target(service_call) 
  File "/config/custom_components/opendisplay/services.py", line 539, in _async_drawcustom await _drawcustom_for_device(hass, device_id, call) 
  File "/config/custom_components/opendisplay/services.py", line 582, in _drawcustom_for_device img = await generate_image(

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions