{"record":{"id":"12c2198c47be1039","repo":"Tencent/WeKnora","slug":"sandbox-create-install-directory-w","errorCode":null,"errorMessage":"sandbox: create install directory: %w","messagePattern":"sandbox: create install directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sandbox/session_manager.go","lineNumber":660,"sourceCode":"\tif err := m.requireRemoteBackend(); err != nil {\n\t\treturn err\n\t}\n\tif strings.TrimSpace(sessionID) == \"\" {\n\t\treturn errors.New(\"sandbox: session ID required for file staging\")\n\t}\n\tclean := path.Clean(strings.TrimSpace(filePath))\n\tif clean != SkillsImageRoot && !strings.HasPrefix(clean, SkillsImageRoot+\"/\") {\n\t\treturn fmt.Errorf(\"sandbox: install file path %q is outside %s\", filePath, SkillsImageRoot)\n\t}\n\thandle, err := m.resolveSession(ctx, sessionID)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// resetSkillDir already created this folder with mkdir -p. Cube's MakeDir\n\t// then reports the existing directory as an error; ignoreExistingDir keeps\n\t// that from aborting the seed of SKILL.md.\n\tif err := ignoreExistingDir(m.client.MakeDir(ctx, handle, path.Dir(clean))); err != nil {\n\t\treturn fmt.Errorf(\"sandbox: create install directory: %w\", err)\n\t}\n\tif err := m.client.WriteFile(ctx, handle, clean, content); err != nil {\n\t\treturn fmt.Errorf(\"sandbox: write install file %s: %w\", clean, err)\n\t}\n\treturn nil\n}\n\n// ShellExecOptions carries per-call shell execution knobs. The install-only\n// flags are explicit so skill image maintenance can write under /opt without\n// loosening work_dir or user privileges for ordinary chat sessions.\ntype ShellExecOptions struct {\n\tWorkDir string\n\tTimeout time.Duration\n\tEnv     map[string]string\n\n\t// AllowSkillsRoot lets installer calls work inside the skills image root.\n\t// See cleanSessionWorkDir for why the work_dir allowlist is lexical only.\n\t// Never set this from a model-authored tool such as shell_exec.","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/sandbox/session_manager.go#L642-L678","documentation":"Thrown in WriteSessionFile when creating the skills image install directory in the remote sandbox fails. The MakeDir call against the sandbox provider returned an error other than an already-exists condition (which ignoreExistingDir suppresses), so the staged install file cannot be written and staging aborts with the underlying provider error wrapped.","triggerScenarios":"Thrown at internal/sandbox/session_manager.go:660 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the remote sandbox is running and the session binding points to a live sandbox before staging","Check provider quotas/permissions for MakeDir on the sandbox","Retry the staging operation once the sandbox is healthy; inspect the wrapped cause for the root provider error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}