mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4089] [GUI] Deleting a model stops at an empty read-only folder (WinError 5) and leaves the rest of the pack on disk #1782
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1782
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 @abdou-rgd on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4089
Area
[GUI] (the desktop app)
Desktop app, Terminal or source?
Desktop app (Windows, Linux or Mac)
What happened
Deleting IQ2_XS from the app showed:
Both
mtp\rtandpacks\iq2_xs\tokenizerwere empty, with the WindowsReadOnlyattribute set. Every folder underDocuments\Strata(Models,mtp,packs,Workspace…) has it; I don't know what sets it. Antivirus and Controlled Folder Access are not involved (EnableControlledFolderAccess = 0).Because
shutil.rmtreeraises on the first read-only folder, the delete stopped partway. Left on disk:packs\iq2_xs\experts.bin(33.8 GB),dense.bin(1.5 GB) and most ofmtp\tensors(~5 GB).Clearing the attribute then deleting worked straight away.
Where it happens:
tools/strata_mcp.py,strata_remove()callsshutil.rmtree(p, onerror=_rmtree_ignore_missing). The hook only ignoresFileNotFoundErrorand re-raises everything else. On Windows,RemoveDirectoryrefuses a folder withFILE_ATTRIBUTE_READONLY, even when it is empty.Expected: the delete removes everything it planned, for example with an error hook that clears the read-only attribute and retries (
os.chmod(path, stat.S_IWRITE), thenfunc(path)), as pip'srmtree_errorhandlerdoes.Smallest steps or command that reproduce it
Documents\Strata).packs\<size>andmtpare still on disk.Reproduction status
Reproduced locally
Strata version
Strata desktop 0.2.3 · control 0.1.48 (
5c8dd32)Graphics card, memory and system
RTX 3060 12 GB · 32 GB RAM · Windows 11 (26200)
Model, size and settings
Qwen3.8-Flash-Next IQ2_XS (GSQ-RCO)
@XiaoBinGan commented on GitHub (Nov 1, 2026):
Reproduced on
main(c62d5e3a) on Windows 11 with the delete path oftools/strata_mcp.py(strata_remove()), nomodel files and no GPU needed.
strata_remove()callsshutil.rmtree(p, onerror=_rmtree_ignore_missing), and the hook only returns forFileNotFoundError, re-raising everything else. Windows refusesRemoveDirectoryon a folder withFILE_ATTRIBUTE_READONLYeven when it is empty, so the first such folder stops that model's delete part-way:(The message text is in Chinese because of this machine's locale; the code is WinError 5,
ERROR_ACCESS_DENIED.)Expected: the delete removes every path it planned (clear the read-only attribute and retry that one path, as pip's
rmtree_errorhandlerdoes), so a read-only empty folder costs only itself and not the rest of the pack.I will send a PR with the hook change and a Windows-only regression test in
tools/test_strata_mcp.pythat fails onmainwith exactly thatfailed=[...]and passes with the change.