{"record":{"id":"527235e9a5c060e2","repo":"zed-industries/zed","slug":"cannot-re-verify-approved-sandbox-write-grant","errorCode":null,"errorMessage":"cannot re-verify approved sandbox write grant `{}` (if the directory was removed, remove the grant or recreate the directory)","messagePattern":"cannot re-verify approved sandbox write grant `(.+?)` \\(if the directory was removed, remove the grant or recreate the directory\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/acp_thread/src/terminal.rs","lineNumber":288,"sourceCode":"            sandbox::SandboxFsPolicy::Unrestricted { protected_paths }\n        } else {\n            // Project worktree paths are captured fresh; user-approved grants are\n            // rebuilt via the verifying reopen (or captured when legacy bare\n            // strings) through `granted_write_path_to_location`. A path that\n            // can't be captured fails the whole construction (never created).\n            let mut locations = Vec::new();\n            for path in &self.writable_paths {\n                let location = sandbox::HostFilesystemLocation::capture(path).map_err(|error| {\n                    anyhow::anyhow!(error).context(format!(\n                        \"cannot capture writable sandbox path `{}`\",\n                        path.display()\n                    ))\n                })?;\n                locations.push(location);\n            }\n            for granted in &self.extra_write_paths {\n                let location = granted_write_path_to_location(granted).map_err(|error| {\n                    anyhow::anyhow!(error).context(format!(\n                        \"cannot re-verify approved sandbox write grant `{}` (if the \\\n                         directory was removed, remove the grant or recreate the \\\n                         directory)\",\n                        granted.requested.display()\n                    ))\n                })?;\n                locations.push(location);\n            }\n            // Dedupe to a minimal cover on the captured canonical paths, so a\n            // grant nested under a worktree root (or another grant) is dropped\n            // rather than bound redundantly.\n            let writable_paths =\n                sandbox::normalize_host_filesystem_locations(locations.into_iter());\n            sandbox::SandboxFsPolicy::Restricted {\n                writable_paths,\n                protected_paths,\n            }\n        };","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/acp_thread/src/terminal.rs#L270-L306","documentation":"to_policy re-verifies each user-approved writable path grant by capturing it; a grant whose directory can no longer be captured (e.g. it was deleted) fails policy construction, telling the user to remove the grant or recreate the directory.","triggerScenarios":"Thrown at crates/acp_thread/src/terminal.rs:288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The user-approved writable grant path no longer exists on disk; either remove the stale grant from settings or recreate the directory at the granted path","Re-approve the sandbox write permission to re-capture a fresh location","Check whether the directory was deleted/moved after the grant was recorded"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}