Before submitting#
Area#
apps/server
Steps to reproduce#
- On Windows, a thread's worktree contains a directory junction: a
node_modules junction to the main checkout, or the one a Next.js dev build creates at .next\dev\node_modules\@sentry\server-runtime-injection-<hash>.
- Removing the worktree stops partway:
.git and most files are gone, but the folder stays with the junction and a few files (package.json, README.md, ...).
- Let Storage Cleanup run.
Expected behavior#
A folder in the managed worktrees directory whose .git is gone is treated as leftover: removed (unlinking junctions without following them), or listed as an orphan in Settings → Storage.
Actual behavior#
Every run logs, for the thread that owned it:
storage cleanup failed for worktree
reason: NotFound, FileSystem.stat
path: C:\Users\<user>\Developer\.worktrees\<repo>\t3-<id>\.git
ENOENT: no such file or directory
The folder is never removed or shown as removable, and the failure repeats every hour. I had 29 of these.
Impact#
Minor bug or occasional failure
Version or commit#
0.1.7
Environment#
Windows 11, git for Windows, Next.js 16 project.
Workaround#
Unlink each junction (Node's fs.unlinkSync removes the link, not its target), then delete the folder.
Related#
#17813, #25843, #14990
This is the same problem as #24390, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.