Snapshot restore doesn't clear pending install-scripts.txt; a stuck job then loops on every startup

Open
#17,662 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by locating the snapshot restore flow and the code that queues or clears user/__manager/startup-scripts/install-scripts.txt; the issue does not name source files or tests. Trace how pending upgrade jobs interact with restore jobs, then check existing restore and startup queue tests. Done means restoring a snapshot replaces or warns about pending jobs so stale upgrades do not keep rerunning at startup.

Written by the indexing model from the issue text.

Description

Potential Bug
Custom Node Testing
Expected Behavior

Summary

Restoring a snapshot while upgrades are still queued in startup-scripts/install-scripts.txt leaves the old upgrade jobs in place next to the restore jobs. If any job in that queue never finishes, the file is never cleared, so the whole queue (including re-extracting node packs from zip) runs again on every launch. Under ComfyUI Desktop, this means ComfyUI never starts.

Environment

  • ComfyUI Desktop on Windows
  • ComfyUI 0.45 (updated from 0.44.2 just before the problem started)
  • ComfyUI-Manager:
  • Python 3.12.11, torch 2.10.0+cu130

Expected

The snapshot restore replaces (or at least warns about) any pending jobs in install-scripts.txt, so only the restore runs.

Actual Behavior
  • install-scripts.txt still contained all the previously queued upgrade jobs after the restore.
  • On every launch, the Manager re-extracted rgthree-comfy, comfyui-kjnodes and comfyui-impact-pack from zip and reran pip install -r requirements.txt. This overwrote any manual edit to Impact Pack's requirements.txt.
  • The git+https://.../sam2 requirement triggers a source build with build isolation. sam2 declares torch as a build dependency, so pip downloads a full torch wheel into the isolated build environment. This happens even when sam2 is already installed in the venv.
  • That step never finishes within Desktop's 300 s startup timeout, so the queue is never marked done, and the cycle repeats on the next launch.
Steps to Reproduce
  1. Mark several node packs for update in the Manager, including ComfyUI-Impact-Pack (its requirements.txt contains git+https://github.com/facebookresearch/sam2).
  2. Restart. Startup hangs on the queued installs (see below), and Desktop reports a timeout waiting for port 8000.
  3. Restore a snapshot from before the updates and restart.
Debug Logs
[ComfyUI-Manager] Starting dependency installation/(de)activation for the extension
[INFO] Extracted zip file to K:\ComfyDT\custom_nodes\comfyui-impact-pack
Install: pip packages for 'K:\ComfyDT\custom_nodes\comfyui-impact-pack'
 Collecting git+https://github.com/facebookresearch/sam2
   Resolved https://github.com/facebookresearch/sam2 to commit 2b90b9f5ceec907a1c18123530e92e794ad901a4
   Installing build dependencies: started
Other

Workaround

Manually removing the Impact Pack entry from user/__manager/startup-scripts/install-scripts.txt let the remaining jobs complete. The Manager then deleted the file and ComfyUI started normally.

Suggestions

  • Clear or replace pending entries in install-scripts.txt when a snapshot restore is queued, or warn the user that jobs are still pending.
  • Log which queued job is currently running or stuck, and consider a per-job timeout so one hanging job doesn't block the whole queue forever.
  • Skip reinstalling git+ requirements whose package is already importable, or install them with --no-build-isolation when torch is already present.
Dominant language
Python
Stars
146k
Forks
17.4k
Avg merge
19h 44m
Merged PRs (30d)
178

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Comfy-Org/ComfyUI

All issues in Comfy-Org/ComfyUI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.