{"record":{"id":"1fadb439ad92d751","repo":"paperclipai/paperclip","slug":"workspace-realization-failed","errorCode":"workspace_realization_failed","errorMessage":"Failed to realize workspace for environment \"${environment.name}\" (${environment.driver}): ${err instanceof Error ? err.message : String(err)}","messagePattern":"Failed to realize workspace for environment \"(.+?)\" \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"EnvironmentRunError","httpStatus":null,"severity":"error","filePath":"server/src/services/environment-run-orchestrator.ts","lineNumber":406,"sourceCode":"        const workspaceRealizationResult = await environmentRuntime.realizeWorkspace({\n          environment,\n          lease,\n          workspace: {\n            localPath: executionWorkspace.cwd,\n            remotePath: remoteCwd,\n            mode: persistedExecutionWorkspace?.mode ?? effectiveExecutionWorkspaceMode ?? undefined,\n            metadata: {\n              workspaceRealizationRequest,\n            },\n          },\n        });\n        realizedWorkspaceCwd =\n          typeof workspaceRealizationResult.cwd === \"string\" && workspaceRealizationResult.cwd.trim().length > 0\n            ? workspaceRealizationResult.cwd.trim()\n            : null;\n        workspaceRealization = parseObject(workspaceRealizationResult.metadata?.workspaceRealization);\n      } catch (err) {\n        throw new EnvironmentRunError(\n          \"workspace_realization_failed\",\n          `Failed to realize workspace for environment \"${environment.name}\" (${environment.driver}): ${err instanceof Error ? err.message : String(err)}`,\n          {\n            environmentId: environment.id,\n            driver: environment.driver,\n            cause: err,\n          },\n        );\n      }\n    }\n\n    const provisionCommand = workspaceRealizationRequest.runtimeOverlay.provisionCommand?.trim() ?? \"\";\n    const realizedCwd =\n      realizedWorkspaceCwd ??\n      (typeof lease.metadata?.remoteCwd === \"string\" && lease.metadata.remoteCwd.trim().length > 0\n        ? lease.metadata.remoteCwd.trim()\n        : executionWorkspace.cwd);\n    // The host `provisionCommand` runs on the host worktree during the","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/environment-run-orchestrator.ts#L388-L424","documentation":"Failure inside realizeForRun: environmentRuntime.realizeWorkspace threw while materializing the execution workspace (local path or remote mount) for the leased environment. The driver error message is embedded, so workspace setup failures are attributed to the environment rather than the agent.","triggerScenarios":"Thrown at server/src/services/environment-run-orchestrator.ts:406 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the workspace realization failure reported in the message (repo access, path availability), then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}