usebruno/bruno · error · Error

Invalid workspace: workspace.yml not found

Error message

Invalid workspace: workspace.yml not found

What it means

`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.

Source

Thrown at packages/bruno-electron/src/utils/workspace-config.js:178

  if (collection.remote) {
    normalizedCollection.remote = collection.remote;
  }

  return normalizedCollection;
};

const validateWorkspacePath = (workspacePath) => {
  if (!workspacePath) {
    throw new Error('Workspace path is required');
  }

  if (!fs.existsSync(workspacePath)) {
    throw new Error(`Workspace path does not exist: ${workspacePath}`);
  }

  const workspaceFilePath = path.join(workspacePath, 'workspace.yml');
  if (!fs.existsSync(workspaceFilePath)) {
    throw new Error('Invalid workspace: workspace.yml not found');
  }

  return true;
};

const validateWorkspaceDirectory = (dirPath) => {
  if (!validateName(path.basename(dirPath))) {
    throw new Error(`Invalid workspace directory name: ${dirPath}`);
  }
  return true;
};

const createWorkspaceConfig = (workspaceName) => ({
  opencollection: OPENCOLLECTION_VERSION,
  info: {
    name: workspaceName,
    type: WORKSPACE_TYPE
  },

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Point at the actual workspace root that contains `workspace.yml`.
  2. If starting fresh, create the workspace through Bruno so `workspace.yml` is generated.
  3. Restore `workspace.yml` from version control or a backup.
  4. Verify you are not passing a collection subdirectory by mistake.

Example fix

// before
validateWorkspacePath('/work/my-collection');  // no workspace.yml inside

// after
validateWorkspacePath('/work/my-workspace');   // contains workspace.yml
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs'); const path = require('path');
function isWorkspaceRoot(p) {
  return !!p && fs.existsSync(path.join(p, 'workspace.yml'));
}
if (!isWorkspaceRoot(candidate)) { /* not a workspace, don't pass to validateWorkspacePath */ }

Type guard

function isWorkspaceRoot(p: string): boolean {
  return fs.existsSync(path.join(p, 'workspace.yml'));
}

Prevention

When it happens

Trigger: 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.

Common situations: 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`.

Related errors


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/4f144902f0b12048. Report an issue: GitHub.