ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Updated to latest Nightly and now it can't startup - RuntimeError: Added route will never be executed, method HEAD is already registered

Open adamreading opened this issue 8 months ago • 7 comments

Expected Behavior

Running on a 5090/WSL2 - been using comfy on it 2 months without any issues. I didn't change anything, just ran 'Update All'

Running startup, it loads through everything exactly as normal - all custom nodes good - and then shuts down immediately.

Actual Behavior

**** Updated All - restarted - immediate shutdown - every time I retry

Steps to Reproduce

Update All - restart

Debug Logs

[2025-04-14 05:44:00.409] Traceback (most recent call last):
[2025-04-14 05:44:00.409]   File "/home/ajo6268/comfyui/ComfyUI/main.py", line 308, in <module>
[2025-04-14 05:44:00.409]     event_loop, _, start_all_func = start_comfyui()
[2025-04-14 05:44:00.409]                                     ^^^^^^^^^^^^^^^
[2025-04-14 05:44:00.413]   File "/home/ajo6268/comfyui/ComfyUI/main.py", line 275, in start_comfyui
[2025-04-14 05:44:00.413]     prompt_server.add_routes()
[2025-04-14 05:44:00.414]   File "/home/ajo6268/comfyui/ComfyUI/server.py", line 732, in add_routes
[2025-04-14 05:44:00.414]     self.app.add_routes(api_routes)
[2025-04-14 05:44:00.414]   File "/home/ajo6268/envs/comfyui/lib/python3.12/site-packages/aiohttp/web_app.py", line 389, in add_routes
[2025-04-14 05:44:00.415]     return self.router.add_routes(routes)
[2025-04-14 05:44:00.415]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-04-14 05:44:00.418]   File "/home/ajo6268/envs/comfyui/lib/python3.12/site-packages/aiohttp/web_urldispatcher.py", line 1279, in add_routes
[2025-04-14 05:44:00.419]     registered_routes.extend(route_def.register(self))
[2025-04-14 05:44:00.419]                              ^^^^^^^^^^^^^^^^^^^^^^^^
[2025-04-14 05:44:00.423]   File "/home/ajo6268/envs/comfyui/lib/python3.12/site-packages/aiohttp/web_routedef.py", line 76, in register
[2025-04-14 05:44:00.423]     return [reg(self.path, self.handler, **self.kwargs)]
[2025-04-14 05:44:00.423]             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-04-14 05:44:00.427]   File "/home/ajo6268/envs/comfyui/lib/python3.12/site-packages/aiohttp/web_urldispatcher.py", line 1240, in add_get
[2025-04-14 05:44:00.428]     resource.add_route(hdrs.METH_HEAD, handler, **kwargs)
[2025-04-14 05:44:00.428]   File "/home/ajo6268/envs/comfyui/lib/python3.12/site-packages/aiohttp/web_urldispatcher.py", line 365, in add_route
[2025-04-14 05:44:00.428]     raise RuntimeError(
[2025-04-14 05:44:00.428] RuntimeError: Added route will never be executed, method HEAD is already registered
[2025-04-14 05:44:00.458] Cannot connect to comfyregistry.
[2025-04-14 05:44:00.480] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json[ComfyUI-Manager] Due to a network error, switching to local mode.
=> custom-node-list.json
=> cannot schedule new futures after shutdown
[2025-04-14 05:44:00.482] FETCH DATA from: /home/ajo6268/comfyui/ComfyUI/custom_nodes/comfyui-manager/custom-node-list.json [DONE]
[2025-04-14 05:44:00.494] [ComfyUI-Manager] All startup tasks have been completed.

[comfyui_8188.log](https://github.com/user-attachments/files/19729759/comfyui_8188.log)

Other

chatGPT says:

What's Going On? Automatic HEAD Registration in aiohttp In aiohttp, whenever you register a GET route, it automatically adds a matching HEAD route. This is a convenience feature so that you don’t have to do it manually. However, if your code (or one of the modules you’re using) tries to register a HEAD route explicitly for a path that already has a GET route, aiohttp complains—and that’s exactly what’s happening.

Route Conflict The traceback points to the function where routes are added. The error message indicates that the server is trying to add a HEAD route for a path that already has an implicit HEAD (from the GET route). This results in the runtime error:

"Added route will never be executed, method HEAD is already registered"

Cascading Issues Following this, you see messages like

"cannot schedule new futures after shutdown" These likely occur because the route conflict is causing the application to shut down abruptly, which then leads to tasks being scheduled after the event loop has closed.

Network/Registry Connection Issues There’s also a separate log message about:

"Cannot connect to comfyregistry" …and a fallback to a local mode for fetching the custom node list. This isn’t directly related to the routing error; it simply indicates that the UI manager couldn’t reach its online registry, so it switched to local resources.

I also tried updating aiohttp to the latest version but that made no difference

adamreading avatar Apr 14 '25 04:04 adamreading

same problem - after morning update!

Aljnk avatar Apr 14 '25 06:04 Aljnk

same problem - after morning update!

I renamed the custom_nodes dir - and created a new one - just added comfyui_manager so far - and it loads fine - so now I need to work out which node kills it - gonna load 50% of them and try it - then if that works the other 50% lol

adamreading avatar Apr 14 '25 07:04 adamreading

I found Jovimetrix - my problem inside it :)

Aljnk avatar Apr 14 '25 07:04 Aljnk

https://github.com/Amorano/Jovimetrix/issues/93

Aljnk avatar Apr 14 '25 07:04 Aljnk

I found Jovimetrix - my problem inside it :)

I have this node too!!! I have been halving my nodes and down to last 20 and jovimetrix is in there!!! Good detective work!!!

adamreading avatar Apr 14 '25 07:04 adamreading

this "should" be resolved (for my repository) in this commit

Let me know if not!

Amorano avatar Apr 14 '25 18:04 Amorano

For me, it occurs when some custom nodes are duplicated. problem disappear after deleting issue custom node package

uihp avatar Nov 10 '25 22:11 uihp