Skip to content

fix: Windows git clone failures — URL reinstall + pipe deadlock + file lock#2726

Merged
ltdrdata merged 1 commit into
manager-v4from
fix/windows-git-clone-fixes
Mar 22, 2026
Merged

fix: Windows git clone failures — URL reinstall + pipe deadlock + file lock#2726
ltdrdata merged 1 commit into
manager-v4from
fix/windows-git-clone-fixes

Conversation

@ltdrdata

Copy link
Copy Markdown
Member

Summary

Fixes three bugs causing URL-based node install/reinstall to fail on Windows.

  • reinstall URL key mismatch: reinstall_node() used the full URL as dictionary key, but unknown_active_nodes is keyed by repo basename — uninstall silently missed the node
  • tqdm pipe deadlock: GitProgress(tqdm) saturated the 4KB Windows pipe buffer when stderr was piped, causing git clone to hang and exit 128
  • Windows file lock: try_rmtree() fell back to lazy-delete (restart-only) when shutil.rmtree failed, which is ineffective in cm-cli where there is no restart cycle

Changes

cm_cli/main.py — reinstall_node() URL handling

  • Detect URL input via core.is_valid_url() before calling resolve_node_spec()
  • Use get_cnr_by_repo() to determine if URL maps to a CNR-registered node
  • CNR nodes: uninstall with is_unknown=False (searches active_nodes)
  • Unknown nodes: uninstall by repo basename with is_unknown=True
  • Non-URL path preserved unchanged

comfyui_manager/common/git_helper.py — gitclone()

  • Gate tqdm progress on sys.stderr.isatty(): disable when piped to prevent deadlock
  • Pre-clone cleanup: rename stale directories from previous failed clones into .disabled/.trash/ (handles GitPython memory-mapped handle leak on Windows)

comfyui_manager/legacy/manager_core.py + glob/manager_core.py — try_rmtree()

  • 3-tier deletion strategy: retry 3x with 1s delay → rename into .disabled/.trash/ → lazy-delete via reserve_script as final fallback
  • When rename succeeds but delete fails, lazy-delete targets the trash path (not the original), keeping the original path clear for subsequent operations

Related

  • comfy-cli PR #363: feat: add ComfyUI-Manager v4 support

…e lock

Three fixes for Windows E2E failures:

1. cm_cli reinstall_node(): URL-based node specs used the full URL
   as lookup key, but internal dicts are keyed by repo basename or
   cnr_id. Use get_cnr_by_repo() for CNR-aware lookup with correct
   is_unknown flag.

2. git_helper.py gitclone(): disable tqdm progress when stderr is
   piped (sys.stderr.isatty() gate) to prevent pipe buffer deadlock.
   Also move stale directories from previous failed clones into
   .disabled/.trash/ before cloning (GitPython handle leak on Windows).

3. try_rmtree(): 3-tier deletion strategy for Windows file locks:
   retry 3x with delay, rename into .disabled/.trash/, then lazy-delete
   via reserve_script as final fallback.
@ltdrdata
ltdrdata changed the base branch from main to manager-v4 March 22, 2026 09:52
@ltdrdata
ltdrdata merged commit cd805b3 into manager-v4 Mar 22, 2026
8 checks passed
@ltdrdata
ltdrdata deleted the fix/windows-git-clone-fixes branch March 22, 2026 11:21
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