{"record":{"id":"444b89bfc70550fc","repo":"google-gemini/gemini-cli","slug":"workspace-path-resolvedpath-does-not-exist","errorCode":null,"errorMessage":"Workspace path ${resolvedPath} does not exist","messagePattern":"Workspace path (.+?) does not exist","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/a2a-server/src/config/config.ts","lineNumber":488,"sourceCode":"        `Workspace path ${resolvedPath} is outside the allowed root directory`,\n      );\n    }\n\n    let stats: fs.Stats;\n    try {\n      stats = await fs.promises.stat(resolvedPath);\n    } catch (err: unknown) {\n      if (\n        err &&\n        typeof err === 'object' &&\n        'code' in err &&\n        err.code === 'ENOENT'\n      ) {\n        if (isTestEnv) {\n          await fs.promises.mkdir(resolvedPath, { recursive: true });\n          stats = await fs.promises.stat(resolvedPath);\n        } else {\n          throw new Error(`Workspace path ${resolvedPath} does not exist`);\n        }\n      } else {\n        throw err;\n      }\n    }\n\n    if (!stats.isDirectory()) {\n      throw new Error(`Workspace path ${resolvedPath} is not a directory`);\n    }\n\n    return resolvedPath;\n  } catch (e) {\n    logger.error(`[CoderAgentExecutor] Error resolving workspace path: ${e}`);\n    throw e;\n  }\n}\n\nexport async function loadEnvironment(","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/a2a-server/src/config/config.ts#L470-L506","documentation":"Thrown by validateWorkspacePath after fs.stat fails with ENOENT in non-test mode. The path passed the allowed-root check but does not exist on disk; in test environments the directory would be auto-created (mkdir recursive), but production refuses to silently create workspaces.","triggerScenarios":"CODER_AGENT_WORKSPACE_PATH points at a directory that has not been created yet; typo in the path; the directory was deleted between runs; mount point not yet attached in a container.","commonSituations":"Fresh deploy referencing a workspace dir that the orchestrator hasn't provisioned; typo like /home/user/projcts; container start order where the volume mount lags the server boot.","solutions":["Create the directory before starting the server: mkdir -p $CODER_AGENT_WORKSPACE_PATH.","Verify the path is correct (no typos, correct absolute path).","If the volume mount is async, add a readiness check that the dir exists before launching the agent.","For ephemeral workspaces, set NODE_ENV=test only in truly throwaway environments (it auto-creates)."],"exampleFix":"# before\nexport CODER_AGENT_WORKSPACE_PATH=/srv/workspaces/agent-1\n# throws: does not exist\n\n# after\nmkdir -p /srv/workspaces/agent-1\nexport CODER_AGENT_WORKSPACE_PATH=/srv/workspaces/agent-1","handlingStrategy":"validation","validationCode":"import fs from 'node:fs/promises';\n\nasync function ensureWorkspaceExists(p: string) {\n  try { await fs.access(p); }\n  catch { throw new Error(`Workspace ${p} does not exist. Create it before starting the agent.`); }\n}\nawait ensureWorkspaceExists(process.env.CODER_AGENT_WORKSPACE_PATH!);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a startup readiness check that the workspace dir exists before binding the server.","Provision the directory in your orchestrator (k8s emptyDir, Docker volume) before the agent starts.","Double-check the path for typos.","Only rely on the test-env auto-mkdir in truly ephemeral test runs."],"tags":["workspace","filesystem","config","startup"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}