Skip to content

Run port check at the beginning of the main.py #8935

@yoland68

Description

@yoland68

Feature Idea

Custom nodes tend to take a long time to load, you don't want the user to get the port already taken at the end of it

Total VRAM 32768 MB, total RAM 32768 MB
pytorch version: 2.5.1
Mac Version (15, 5)
Set vram state to: SHARED
Device: mps
Using sub quadratic optimization for attention, if you have memory or speed issues try using: --use-split-cross-attention
Python version: 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 10:07:17) [Clang 14.0.6 ]
ComfyUI version: 0.3.44
[Prompt Server] web root: ./dist
Traceback (most recent call last):
  File "/Users/yoland/Code/ComfyUI/nodes.py", line 2124, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 991, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1128, in get_code
  File "<frozen importlib._bootstrap_external>", line 1186, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/Users/yoland/Code/ComfyUI/custom_nodes/color_picker/__init__.py'

Cannot import /Users/yoland/Code/ComfyUI/custom_nodes/color_picker module for custom nodes: [Errno 2] No such file or directory: '/Users/yoland/Code/ComfyUI/custom_nodes/color_picker/__init__.py'
  File "<frozen importlib._bootstrap_external>", line 1186, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/Users/yoland/Code/ComfyUI/custom_nodes/color_picker/__init__.py'

Cannot import /Users/yoland/Code/ComfyUI/custom_nodes/color_picker module for custom nodes: [Errno 2] No such file or directory: '/Users/yoland/Code/ComfyUI/custom_nodes/color_picker/__init__.py'

Import times for custom nodes:
   0.0 seconds: /Users/yoland/Code/ComfyUI/custom_nodes/websocket_image_save.py
   0.0 seconds (IMPORT FAILED): /Users/yoland/Code/ComfyUI/custom_nodes/color_picker

Context impl SQLiteImpl.
Will assume non-transactional DDL.
No target revision found.
Starting server

Traceback (most recent call last):
  File "/Users/yoland/Code/ComfyUI/main.py", line 356, in <module>
    event_loop.run_until_complete(x)
  File "/opt/miniconda3/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/yoland/Code/ComfyUI/main.py", line 338, in start_all
    await run(prompt_server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start)
  File "/Users/yoland/Code/ComfyUI/main.py", line 232, in run
    await asyncio.gather(
  File "/Users/yoland/Code/ComfyUI/server.py", line 935, in start_multi_address
    await site.start()
  File "/opt/miniconda3/lib/python3.12/site-packages/aiohttp/web_runner.py", line 121, in start
    self._server = await loop.create_server(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/lib/python3.12/asyncio/base_events.py", line 1572, in create_server
    raise OSError(err.errno, msg) from None
OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1', 8188): address already in use

Existing Solutions

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BountyFeatureA new feature to add to ComfyUI.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions