[GH-ISSUE #14033] Detected blocking call to read_bytes with args #71232

Closed
opened 2026-05-05 00:47:54 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ijustlikeit on GitHub (Feb 2, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14033

What is the issue?

Warning blocking call:

Relevant log output

Detected blocking call to read_bytes with args (PosixPath('/config/www/capture/driveway/xxxxx.jpg'),) inside the event loop by integration 'ollama' at homeassistant/components/ollama/entity.py, line 239: response_generator = await client.chat( (offender: /usr/local/lib/python3.13/site-packages/ollama/_types.py, line 167: return b64encode(self.value.read_bytes() if isinstance(self.value, Path) else self.value).decode()), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+ollama%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#read_bytes Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 229, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 215, 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.13/asyncio/base_events.py", line 712, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 683, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2050, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1012, in _async_step_call_service self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 794, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2819, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2862, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/components/ai_task/__init__.py", line 144, in async_service_generate_data result = await async_generate_data(hass=call.hass, **call.data) File "/usr/src/homeassistant/homeassistant/components/ai_task/task.py", line 152, in async_generate_data return await entity.internal_async_generate_data( File "/usr/src/homeassistant/homeassistant/components/ai_task/entity.py", line 103, in internal_async_generate_data return await self._async_generate_data(task, chat_log) File "/usr/src/homeassistant/homeassistant/components/ollama/ai_task.py", line 53, in _async_generate_data await self._async_handle_chat_log(chat_log, task.structure) File "/usr/src/homeassistant/homeassistant/components/ollama/entity.py", line 239, in _async_handle_chat_log response_generator = await client.chat(

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

No response

Originally created by @ijustlikeit on GitHub (Feb 2, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14033 ### What is the issue? Warning blocking call: ### Relevant log output ```shell Detected blocking call to read_bytes with args (PosixPath('/config/www/capture/driveway/xxxxx.jpg'),) inside the event loop by integration 'ollama' at homeassistant/components/ollama/entity.py, line 239: response_generator = await client.chat( (offender: /usr/local/lib/python3.13/site-packages/ollama/_types.py, line 167: return b64encode(self.value.read_bytes() if isinstance(self.value, Path) else self.value).decode()), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+ollama%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#read_bytes Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 229, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 215, 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.13/asyncio/base_events.py", line 712, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 683, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2050, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1012, in _async_step_call_service self._hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 794, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 44, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/core.py", line 2819, in async_call response_data = await coro File "/usr/src/homeassistant/homeassistant/core.py", line 2862, in _execute_service return await target(service_call) File "/usr/src/homeassistant/homeassistant/components/ai_task/__init__.py", line 144, in async_service_generate_data result = await async_generate_data(hass=call.hass, **call.data) File "/usr/src/homeassistant/homeassistant/components/ai_task/task.py", line 152, in async_generate_data return await entity.internal_async_generate_data( File "/usr/src/homeassistant/homeassistant/components/ai_task/entity.py", line 103, in internal_async_generate_data return await self._async_generate_data(task, chat_log) File "/usr/src/homeassistant/homeassistant/components/ollama/ai_task.py", line 53, in _async_generate_data await self._async_handle_chat_log(chat_log, task.structure) File "/usr/src/homeassistant/homeassistant/components/ollama/entity.py", line 239, in _async_handle_chat_log response_generator = await client.chat( ``` ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-05 00:47:54 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 2, 2026):

Wrong GitHub repo.

<!-- gh-comment-id:3837235055 --> @rick-github commented on GitHub (Feb 2, 2026): Wrong GitHub repo.
Author
Owner

@ijustlikeit commented on GitHub (Feb 3, 2026):

moved to: Detected blocking call to read_bytes with args #162115

<!-- gh-comment-id:3839029648 --> @ijustlikeit commented on GitHub (Feb 3, 2026): moved to: [Detected blocking call to read_bytes with args #162115 ](https://github.com/home-assistant/core/issues/162115)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71232