-
-
Notifications
You must be signed in to change notification settings - Fork 171
Description
Environment
- Harbor version: Latest (as of November 2025)
- Host OS: Arch Linux
- Service: ComfyUI
- GPU: Tesla P40 (24GB VRAM)
Problem Summary
The ComfyUI container enters a crash loop on startup with ModuleNotFoundError: No module named 'av'. The issue is NOT that the dependency is missing from requirements.txt, but that pip is not available in the Python virtual environment at /opt/environments/python/comfyui, preventing automatic installation of requirements during container startup.
Error Logs
harbor.comfyui | [ComfyUI-Manager] Neither python -m pip nor uv are available. Cannot proceed with package operations.
harbor.comfyui | Failed to execute startup-script: /workspace/ComfyUI/custom_nodes/ComfyUI-Manager/prestartup_script.py / Neither pip nor uv are available for package management
harbor.comfyui |
harbor.comfyui | Traceback (most recent call last):
harbor.comfyui | File "/workspace/ComfyUI/comfy_api/latest/_input/video_types.py", line 5, in <module>
harbor.comfyui | import av
harbor.comfyui | ModuleNotFoundError: No module named 'av'
Reproduction Steps
harbor up comfyui- Container crashes immediately
harbor logs comfyuishows the above errors- Container enters FATAL state after multiple restart attempts
Investigation & Findings
Verified the requirements.txt includes av
av>=14.1.0
is present in /workspace/ComfyUI/requirements.txt (confirmed by inspecting the file inside the container).
Manual installation works
When I manually fix the issue inside the container:
harbor exec comfyui bash
/opt/environments/python/comfyui/bin/python -m ensurepip --upgrade
/opt/environments/python/comfyui/bin/pip install -r /workspace/ComfyUI/requirements.txt
cd /workspace/ComfyUI
/opt/environments/python/comfyui/bin/python main.pyComfyUI starts successfully without errors.
The issue does NOT persist
After exiting and running harbor restart comfyui, the container crashes again with the same error. This confirms that pip installations are not persisting because pip itself is missing from the venv during container initialization.
Root Cause
The virtual environment at /opt/environments/python/comfyui was created without pip installed (likely using python -m venv --without-pip or a minimal venv tool like uv). This causes:
- ComfyUI's requirements.txt installation to fail silently or not run at all
- ComfyUI-Manager's prestartup script to fail with the "Neither python -m pip nor uv are available" error
- The
avmodule (and potentially other dependencies) to never get installed
Proposed Solution
The Harbor ComfyUI container image needs to ensure pip is installed in the venv during image build or container initialization. Add to the container's entrypoint or Dockerfile:
/opt/environments/python/comfyui/bin/python -m ensurepip --upgradeThis should run before ComfyUI's main.py is executed, ensuring that:
- pip is available for requirements.txt installation
- ComfyUI-Manager's prestartup scripts can function properly
- All dependencies (including the recently-added
av>=14.1.0for video support) are installed automatically
Workaround
Users can temporarily fix this by execing into the container and running:
/opt/environments/python/comfyui/bin/python -m ensurepip --upgrade
/opt/environments/python/comfyui/bin/pip install -r /workspace/ComfyUI/requirements.txtHowever, this must be repeated after every container restart.
Additional Context
This issue likely affects recent ComfyUI updates that added av>=14.1.0 as a core dependency for video processing functionality (see Comfy-Org/ComfyUI#9999 and #7869). Older ComfyUI versions may not have triggered this issue if they had fewer dependencies.