Comfy-Org / Comfy-Org/ComfyUI

`No route to host` exception when accessing UI remotely

Open
#1,442 1 comment 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

**Git Version**: 5f101f4da14e0b4a360ca1d0c380fab174d301bf (31st Aug)

**Steps to reproduce**:
1. Start ComfyUI with `--listen` so that connections can be made from other machines
2. Connect from a laptop
3. Setup and queue jobs which will take a long time to complete
4. Sleep the laptop so it is no longer accessible over the network

**Expected behaviour**:

ComfyUI would continue with the flow without issue.

**Observed behaviour**:

ComfyUI will crash with the following traceback (I think it's when it wants to update preview images in the UI)

```
Traceback (most recent call last):
File "/home/pauls/StableDiffusion/ComfyUI/./main.py", line 187, in
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/pauls/StableDiffusion/ComfyUI/./main.py", line 102, in run
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
File "/home/pauls/StableDiffusion/ComfyUI/server.py", line 603, in publish_loop
await self.send(*msg)
File "/home/pauls/StableDiffusion/ComfyUI/server.py", line 536, in send
await self.send_image(data, sid=sid)
File "/home/pauls/StableDiffusion/ComfyUI/server.py", line 573, in send_image
await self.send_bytes(BinaryEventTypes.PREVIEW_IMAGE, preview_bytes, sid=sid)
File "/home/pauls/StableDiffusion/ComfyUI/server.py", line 582, in send_bytes
await send_socket_catch_exception(self.sockets[sid].send_bytes, message)
File "/home/pauls/StableDiffusion/ComfyUI/server.py", line 40, in send_socket_catch_exception
await function(message)
File "/home/pauls/StableDiffusion/ComfyUI/venv/lib/python3.11/site-packages/aiohttp/web_ws.py", line 315, in send_bytes
await self._writer.send(data, binary=True, compress=compress)
File "/home/pauls/StableDiffusion/ComfyUI/venv/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 688, in send
await self._send_frame(message, WSMsgType.BINARY, compress)
File "/home/pauls/StableDiffusion/ComfyUI/venv/lib/python3.11/site-packages/aiohttp/http_websocket.py", line 659, in _send_frame
await self.protocol._drain_helper()
File "/home/pauls/StableDiffusion/ComfyUI/venv/lib/python3.11/site-packages/aiohttp/base_protocol.py", line 90, in _drain_helper
await asyncio.shield(waiter)
File "/usr/lib/python3.11/asyncio/selector_events.py", line 995, in _read_ready__data_received
data = self._sock.recv(self.max_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 113] No route to host
terminate called without an active exception
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.