Snapshot restore doesn't clear pending install-scripts.txt; a stuck job then loops on every startup
Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see how to disable custom nodes if you need help)
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.txtstill 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://.../sam2requirement 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
- Mark several node packs for update in the Manager, including ComfyUI-Impact-Pack (its requirements.txt contains
git+https://github.com/facebookresearch/sam2). - Restart. Startup hangs on the queued installs (see below), and Desktop reports a timeout waiting for port 8000.
- 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.txtwhen 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-isolationwhen torch is already present.
@bakker Interesting one. Is that startup script surviving inside the snapshot, or getting recreated on boot? I built a free diagnostic that can inspect GitHub issues and pull out likely setup problems. Could be worth running on this one.