From 8fd463b8cd4a2d24001e19461728b22fdf7f629d Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 21 Mar 2026 16:49:00 +0900 Subject: [PATCH] debug(git_helper): retry clone without progress to capture git stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When git clone with progress=GitProgress() fails on Windows, the tqdm progress callback consumes stderr, hiding git's actual fatal message. This adds a diagnostic retry: on clone failure, if e.stderr is empty, clean up the partial clone and retry without progress callback. The retry either succeeds (proving progress was the issue) or fails with git's actual stderr visible. Also captures stderr in run_script() via subprocess.run(capture_output=True). NOTE: This is a diagnostic commit — revert after root cause is identified. --- comfyui_manager/common/git_helper.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/comfyui_manager/common/git_helper.py b/comfyui_manager/common/git_helper.py index 1897ee20..2f80f557 100644 --- a/comfyui_manager/common/git_helper.py +++ b/comfyui_manager/common/git_helper.py @@ -101,13 +101,30 @@ def gitclone(custom_nodes_path, url, target_hash=None, repo_path=None): repo_path = os.path.join(custom_nodes_path, repo_name) # Clone the repository from the remote URL + # First attempt with progress display; on failure retry without progress + # so git's stderr (fatal message) is not consumed by the progress callback. try: repo = git.Repo.clone_from(url, repo_path, recursive=True, progress=GitProgress()) except git.GitCommandError as e: + stderr_msg = e.stderr or '' print(f"git clone failed for '{url}': {e}", file=sys.stderr) - if e.stderr: - print(e.stderr, file=sys.stderr) - raise + if stderr_msg: + print(f"git stderr: {stderr_msg}", file=sys.stderr) + else: + # Retry without progress to capture git's actual stderr + import shutil + if os.path.exists(repo_path): + shutil.rmtree(repo_path, ignore_errors=True) + try: + repo = git.Repo.clone_from(url, repo_path, recursive=True) + except git.GitCommandError as e2: + print(f"git clone retry failed: {e2}", file=sys.stderr) + if e2.stderr: + print(f"git stderr: {e2.stderr}", file=sys.stderr) + raise e2 + # If retry succeeds, the first failure was progress-related + print("git clone succeeded without progress callback", file=sys.stderr) + return if target_hash is not None: print(f"CHECKOUT: {repo_name} [{target_hash}]")