{"record":{"id":"4f144902f0b12048","repo":"usebruno/bruno","slug":"invalid-workspace-workspace-yml-not-found-4f1449","errorCode":null,"errorMessage":"Invalid workspace: workspace.yml not found","messagePattern":"Invalid workspace: workspace\\.yml not found","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/utils/workspace-config.js","lineNumber":178,"sourceCode":"  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) => ({\n  opencollection: OPENCOLLECTION_VERSION,\n  info: {\n    name: workspaceName,\n    type: WORKSPACE_TYPE\n  },","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/utils/workspace-config.js#L160-L196","documentation":"`validateWorkspacePath` succeeds on the directory but then checks `path.join(workspacePath, 'workspace.yml')` and throws when the manifest file is missing. The folder exists but is not a Bruno workspace.","triggerScenarios":"A directory that exists and was passed as a workspace but contains no `workspace.yml` — an arbitrary folder, a collection directory, or a half-written/cloned workspace.","commonSituations":"User selected a plain folder instead of a workspace root; a git clone omitted workspace.yml (gitignored or never committed); the file was deleted by an external tool; a directory was created manually without `createWorkspaceConfig`.","solutions":["Point at the actual workspace root that contains `workspace.yml`.","If starting fresh, create the workspace through Bruno so `workspace.yml` is generated.","Restore `workspace.yml` from version control or a backup.","Verify you are not passing a collection subdirectory by mistake."],"exampleFix":"// before\nvalidateWorkspacePath('/work/my-collection');  // no workspace.yml inside\n\n// after\nvalidateWorkspacePath('/work/my-workspace');   // contains workspace.yml","handlingStrategy":"validation","validationCode":"const fs = require('fs'); const path = require('path');\nfunction isWorkspaceRoot(p) {\n  return !!p && fs.existsSync(path.join(p, 'workspace.yml'));\n}\nif (!isWorkspaceRoot(candidate)) { /* not a workspace, don't pass to validateWorkspacePath */ }","typeGuard":"function isWorkspaceRoot(p: string): boolean {\n  return fs.existsSync(path.join(p, 'workspace.yml'));\n}","tryCatchPattern":null,"preventionTips":["Only treat directories containing workspace.yml as workspaces.","Generate workspaces through createWorkspaceConfig so the manifest exists."],"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"}