{"record":{"id":"38d2a0fe63d4f385","repo":"usebruno/bruno","slug":"workspace-path-does-not-exist-workspacepath","errorCode":null,"errorMessage":"Workspace path does not exist: ${workspacePath}","messagePattern":"Workspace path does not exist: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/utils/workspace-config.js","lineNumber":173,"sourceCode":"  const normalizedCollection = {\n    name: collection.name,\n    path: relativePath\n  };\n\n  if (collection.remote) {\n    normalizedCollection.remote = collection.remote;\n  }\n\n  return normalizedCollection;\n};\n\nconst validateWorkspacePath = (workspacePath) => {\n  if (!workspacePath) {\n    throw new Error('Workspace path is required');\n  }\n\n  if (!fs.existsSync(workspacePath)) {\n    throw new Error(`Workspace path does not exist: ${workspacePath}`);\n  }\n\n  const workspaceFilePath = path.join(workspacePath, 'workspace.yml');\n  if (!fs.existsSync(workspaceFilePath)) {\n    throw new Error('Invalid workspace: workspace.yml not found');\n  }\n\n  return true;\n};\n\nconst validateWorkspaceDirectory = (dirPath) => {\n  if (!validateName(path.basename(dirPath))) {\n    throw new Error(`Invalid workspace directory name: ${dirPath}`);\n  }\n  return true;\n};\n\nconst createWorkspaceConfig = (workspaceName) => ({","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/utils/workspace-config.js#L155-L191","documentation":"`validateWorkspacePath` checks `fs.existsSync(workspacePath)` after the non-empty check and throws when the directory is absent on disk. The path was supplied but the OS reports it does not exist.","triggerScenarios":"Caller hands a string path that resolves to nothing — moved/renamed workspace folder, deleted directory, network drive unmounted, or a path string assembled incorrectly.","commonSituations":"User moved the workspace folder on disk while Bruno still points at the old location; an external sync tool removed it; the path was built with a wrong separator or stale home dir; removable storage ejected.","solutions":["Confirm the folder still exists at the recorded path (`ls` / Explorer).","If moved, re-open the workspace from its new location and update the stored record.","Check for drive mounts / network shares before launching Bruno.","Inspect the stored workspace path for stale home-directory or separator issues."],"exampleFix":"// before\nvalidateWorkspacePath('/home/user/OldWorkspace');  // folder was moved\n\n// after\nvalidateWorkspacePath('/home/user/Workspace');   // current location","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nfunction ensureWorkspaceExists(p) {\n  if (!p) throw new Error('Workspace path is required');\n  if (!fs.existsSync(p)) throw new Error(`Workspace missing on disk: ${p}`);\n  return p;\n}","typeGuard":null,"tryCatchPattern":"try { validateWorkspacePath(wsPath); }\ncatch (e) { if (/does not exist/.test(e.message)) { /* re-pick workspace */ } else throw e; }","preventionTips":["Check existence before each long-running operation; folders can move.","Persist the last-used workspace and verify on startup."],"tags":["workspace","filesystem","config","electron"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}