Repository navigation
workspace-write unusable when %TEMP% is a volume-root folder (Dev Drive): opaque "temp grant materialization failed and its cleanup also failed" #10623
AndyZHENG0715
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment: Windows 11, DSH 0.2.1-rc.2 desktop (win32). Workspace on
E:\Playground,%TEMP%onE:\Temp;E:is a ReFS Dev Drive (labelDev). The user profile stays onC:.Symptom: With the default
workspace-writesandbox policy, every tool call fails before the command starts. Two surfaces observed in sequence:Workspace grant:
Error: SetNamedSecurityInfoW failed (Win32 5): grantWrite(E:\Playground)
After the workspace root was repaired (the bundled
diagnose-windows-sandbox-aclskill added a FullControl allow ACE for the user), every call failed at the per-session private temp directory instead:Error: sandbox-local windows-acl temp grant materialization failed and its cleanup also failed
The second message is an
AggregateErrorfromLocalSandboxProvider.materializeAclGrant()(@deepseek-ai/dsh-sandbox-local): it aggregates the grant failure with the cleanup failure and surfaces only the top-level message, so the offending path and the Win32 code are invisible.Root cause:
grantWrite()(@deepseek-ai/dsh-sandbox-windows-acl) applies the DACL and the Low mandatory label (SACL) in oneSetNamedSecurityInfoWcall. Writing the SACL requiresWRITE_OWNER(documented Windows behavior: WRITE_OWNER also grants SACL write, while owner-implicit rights are only READ_CONTROL + WRITE_DAC). A directory created directly under a volume root inherits that root's default ACL. HereE:\grants the user onlyModify, with no FullControl inheritance, so the new directory is owned by the user but lacksWRITE_OWNER— both the workspace ACE and the per-session temp ACE fail.%TEMP%is affected the same way:mkdtempSync(join(tmpdir(), "dsh-"))creates the private dir underE:\Temp, inheriting the same missing rights. PointingTEMPat a Dev Drive is a recommended setup for temp-heavy workloads, so this is not exotic user error.Why the bundled skill does not save you here:
diagnose-windows-sandbox-aclrepairs the workspace chain, and the ACE it adds is non-inheritable. The per-session temp directory is a new child of the temp root, so even running that script onE:\Tempwould not make futuredsh-*children inherit FullControl. We fixed it by granting the user an inheritable FullControl ACE on the temp root; afterwards the confined shell runs normally (verified).Suggested fixes (any subset)
WRITE_OWNER; if absent, fall back to a provisionable temp location (%LOCALAPPDATA%\Temp) instead of failing every call, or fail once with an actionable message naming the directory and the fix.SetNamedSecurityInfoWerror, Win32 code, and path in the AggregateError message (today only the wrapper text reaches the caller).Repro sketch: fresh Windows 11 + ReFS Dev Drive
E:; setTMP/TEMP=E:\Temp; workspaceE:\Playground; any sandboxed command inworkspace-writefails as above. Granting an inheritable FullControl ACE for the signed-in user on both roots resolves it.All reactions