mirror of
https://github.com/Comfy-Org/desktop.git
synced 2026-11-04 23:47:43 +00:00
[GH-ISSUE #1395] [Bug]: Config is deleted when updating #391
Labels
No labels
area: desktop-app
Bounty
bug
bug-cop:answered
bug-cop:response-received
component: installer
component: preload
custom node
dependencies
Design
documentation
duplicate
enhancement
expected
frontend
good first issue
installation
Low-Priority
performance
Planned
platform: cross-platform
platform: windows
Potential Bug
Potential Bug
pull-request
question
refactor
Release
stale
User Support
V1
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/desktop#391
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Z-nonymous on GitHub (Nov 2, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1395
Originally assigned to: @benceruleanlu on GitHub.
App Version
While updating to 0.5.3 (from 0.5.5), the files inside the config folder were all deleted and all configuration was lost (workflows, models, output files ...).
This is a Windows installation.
What is strange is I had some folders for instance in
ComfyUI/config/outputor inComfyUI/config/user/default/workflowsand the folders are still there but all the files inside are gone.Expected Behavior
The contents in
ComfyUI/config/user/defaultfolder should not be deleted and recreated when updating ComfyUIActual Behavior
The install/update was hanging for several minutes, and it deleted all current configuration 'ComfyUI/config/user/default'
Steps to Reproduce
Install 0.5.3, save some workflows and models, then update to 0.5.5
Debug Logs
Browser Logs
No response
Settings JSON
The config file was deleted !
Other
No response
┆Issue is synchronized with this Notion page by Unito
@dosubot[bot] commented on GitHub (Nov 2, 2025):
Hi @Z-nonymous! I'm Dosu and I’m helping the desktop team.
This is not expected behavior and appears to be a critical bug in the update process. The code does not intentionally delete user config files during updates, but if the installation state becomes unavailable or corrupted (for example, due to a hang or forced close during update), the app may incorrectly trigger a "fresh install" flow. When this happens, the installer can overwrite or reset configuration files in your config/user/default directory without backing them up, while leaving the folder structure intact. This results in loss of workflows, models, and other config files, but not the folders themselves.
There is no documented recovery or backup mechanism for this scenario, and the documentation states that user config should be preserved during updates (source). This is a data loss bug that can occur if the update process is interrupted or if the app cannot validate the existing installation state after an update.
If you have backups, restoring them is the only way to recover lost config files. To avoid this in the future, ensure the update process completes without interruption and consider making manual backups of your config directory before updating.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
@christian-byrne commented on GitHub (Nov 2, 2025):
We are working on a fix right now but your files are likely stranded in the TEMP folder.
@Z-nonymous commented on GitHub (Nov 3, 2025):
@christian-byrne Thanks for the reply.
What TEMP folder are you referring to ?
There's nothing in
%TEMP%related to comfyUI, no .safetensor files, no .json, .mp4, .jpg, png files.Nothing is in the recycle bin either.
I lost all previous work that was in the install folder of Comfy desktop.
It seems that it also cleared what was in
ComfyUI/resources/ComfyUI/models, so all models in there, loras, controlnets, models, all is gone.I don't think that what the bot says is correct:
Because I chose update, and then the update triggered a fresh install (in silent mode).
There is a serious flaw in the installation procedure if at any point all user files are deleted. Note that here, as the folder structure is still intact, there must have been a command run to delete the files inside the folders...
@Z-nonymous commented on GitHub (Nov 8, 2025):
@benceruleanlu Does PR https://github.com/Comfy-Org/desktop/pull/1380 resolves my issue or just partially?
In my case, I think stuff might have been copied to %TEMP% at some point during the update. But then as it failed got deleted because install resume does do a freshinstall.
If for some reason an update fails, the resume always triggers a new install because in InstallationManager, when (installation.state === 'started') it just uses resumeInstallation() which does freshInstall()
github.com/Comfy-Org/desktop@addb0e8a/src/install/installationManager.ts (L98-L102)Maybe your change avoids loosing the data ? (I'm trying to see if I can update without getting the same issue)
@benceruleanlu commented on GitHub (Nov 17, 2025):
Thanks for the detailed repro – we dug through the updater/installer flow and found why files disappear even though the folders survive.
Root cause
Our packaged app keeps the bundled ComfyUI repo, ComfyUI-Manager, UV binaries, etc. inside the Electron
resourcesfolder. During packaging we literally copyassets/ComfyUI/**into that folder (scripts/todesktop/afterPack.cjs), andgetAppResourcesPath()resolves toprocess.resourcesPathwhenever the app is packaged (src/install/resourcePaths.ts). When the Windows updater runs it wipes that entire install directory so it can lay down the newresourcestree.During onboarding we persist whatever install path the renderer sends (
src/install/installationManager.ts:184-199). The renderer never checks whether that path lives inside the application folder – it only validates writability, free space, OneDrive, etc. (src/handlers/pathHandlers.ts). So if someone points the “ComfyUI files” picker atD:\Apps\ComfyUI\config– i.e. a folder that sits right under the EXE’s install root – we happily accept it. On every update the updater deletes that folder along with the binaries, then the app recreates an empty directory structure on next launch, leaving the subfolders but none of the files. That matches what you observed.We also ship the renderer the application path under the “System Locations” section, so it’s easy for users to copy/paste the wrong location. Since
basePathnever gets migrated out of the binary tree afterward, the problem repeats on every update.What we’re doing next
VALIDATE_INSTALL_PATH/ the UI to reject (or at least warn loudly) when the install path is insideapp.getAppPath()/process.resourcesPath/%LocalAppData%\Programs\comfyui-electronor the updater cache. The renderer will show a clear error such as “Install ComfyUI data outside the application folder.”basePathis still inside the application directory, prompt the user to move it, and provide an automated migration into%USERPROFILE%\Documents\ComfyUI(or another safe location) so a future update cannot wipe it again.%LOCALAPPDATA%\@comfyorgcomfyui-electron-updaterfor stranded files from interrupted upgrades and provide a recovery prompt if we can rescue anything.For now the workaround is to move
config,models, etc. outside of the app install directory (e.g. somewhere under Documents) and point the desktop app there via Settings → System Paths. That folder is never touched by the updater. Let us know if there’s anything else we can do to help recover the lost files.@Z-nonymous commented on GitHub (Nov 20, 2025):
Thank you very much for the work identifying and fixing the issue. 👍
FYI wrt to recovering the lost files they are nowhere to be found. I forgot to try to run an undelete right after it happened to try to get those back. When I thought of doing so, I had done a lot of writing on the disk and those were already overwritten. Even if I had, when I noticed those were missing they were likely already overwritten by the installer new files anyway.
Anyway, no big deal I just lost 5-6 test wan videos. The workflows I had backups for and the models I lost were Wan models and loras so where easily redownloaded.
I'm glad this was detected before someone had the issue with important data.
@benceruleanlu commented on GitHub (Nov 23, 2025):
This should be fixed in the latest desktop release, let me know if you run into it again!