Skip to content

Fix aria2 path handling for local (non-Docker) installations#2999

Open
ViolinKaine wants to merge 2 commits into
Comfy-Org:mainfrom
ViolinKaine:fix/aria2-local-paths
Open

Fix aria2 path handling for local (non-Docker) installations#2999
ViolinKaine wants to merge 2 commits into
Comfy-Org:mainfrom
ViolinKaine:fix/aria2-local-paths

Conversation

@ViolinKaine

@ViolinKaine ViolinKaine commented Jun 15, 2026

Copy link
Copy Markdown

The previous logic stripped the ComfyUI base path prefix and sent a root-relative path (e.g. /custom_nodes) to aria2 via RPC, causing a permission error when aria2 tried to create that directory at the filesystem root.

Use the full absolute path when model_dir is absolute; fall back to /models/"directory" only for relative paths (Docker-style setups).

Aria2 RPC was receiving /custom_nodes instead of the full path, causing permission denied on non-Docker (local venv's) installs.

The previous logic stripped the ComfyUI base path prefix and sent a
root-relative path (e.g. /custom_nodes) to aria2 via RPC, causing a
permission error when aria2 tried to create that directory at the
filesystem root.

Use the full absolute path when model_dir is absolute; fall back to
/models/<dir> only for relative paths (Docker-style setups).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0aa023a5-d960-4560-8506-a3f09c31086c

📥 Commits

Reviewing files that changed from the base of the PR and between 857b453 and 0681955.

📒 Files selected for processing (1)
  • glob/manager_downloader.py

📝 Walkthrough

Walkthrough

In aria2_download_url, the download_dir computation is updated with Docker-aware detection: when running in a container, model paths derived from core.comfy_path are converted to container-relative paths; outside Docker (or when model_dir doesn't start with core.comfy_path), absolute paths are used directly while relative paths are prefixed with '/models'. The previous logic that unconditionally stripped core.comfy_path is replaced—you might say the old approach was feeling container-dious about path handling!

Changes

Docker-Aware aria2 Download Path Resolution

Layer / File(s) Summary
Docker-aware download_dir path resolution
glob/manager_downloader.py
download_dir computation now detects Docker execution: in-container, model_dir is converted from core.comfy_path-prefixed host paths to container-relative paths; outside Docker, absolute model_dir is used as-is or relative model_dir is prefixed with '/models'.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@glob/manager_downloader.py`:
- Around line 83-86: The conditional logic checking os.path.isabs(model_dir)
does not account for Docker environments where aria2 containers have restricted
path visibility. Add Docker environment detection (via environment variable or
config flag) before the isabs check. When running in Docker, remap absolute
paths from get_model_dir() back to container-relative paths (like /models/... or
/custom_nodes/...) so aria2 can access them properly. When not in Docker, keep
the current absolute path handling. This ensures download_dir is set to the
correct accessible path for both local and containerized installations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2ccfba9c-316d-422a-a6b0-d4845317652c

📥 Commits

Reviewing files that changed from the base of the PR and between e4c5401 and 857b453.

📒 Files selected for processing (1)
  • glob/manager_downloader.py

Comment thread glob/manager_downloader.py Outdated
…ping

In Docker, aria2 runs in a separate container with only mounted paths
visible (e.g. /models, /custom_nodes), not host absolute paths. Detect
Docker via /.dockerenv or COMFYUI_ARIA2_CONTAINER_PATHS=true env var and
remap to container-relative paths in that case. On bare-metal, use the
full absolute path so aria2 can locate the directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant