usebruno/bruno · error · Error

No collection configuration found at: ${collectionPath}

Error message

No collection configuration found at: ${collectionPath}

What it means

Thrown by getCollectionFormat when neither opencollection.yml nor bruno.json exists at collectionPath. These two files are the markers of a valid Bruno collection; their absence means the directory is not recognized as a collection root.

Source

Thrown at packages/bruno-electron/src/utils/filesystem.js:288

  while (checkExists(uniqueName)) {
    counter++;
    uniqueName = `${baseName} copy ${counter}`;
  }
  return uniqueName;
};

const getCollectionFormat = (collectionPath) => {
  const ocYmlPath = path.join(collectionPath, 'opencollection.yml');
  if (fs.existsSync(ocYmlPath)) {
    return 'yml';
  }

  const brunoJsonPath = path.join(collectionPath, 'bruno.json');
  if (fs.existsSync(brunoJsonPath)) {
    return 'bru';
  }

  throw new Error(`No collection configuration found at: ${collectionPath}`);
};

const validateName = (name) => {
  const invalidCharacters = /[<>:"/\\|?*\x00-\x1F]/g; // keeping this for informational purpose
  const reservedDeviceNames = /^(CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])$/i;
  const firstCharacter = /^[^\s\-<>:"/\\|?*\x00-\x1F]/; // no space, hyphen and `invalidCharacters`
  const middleCharacters = /^[^<>:"/\\|?*\x00-\x1F]*$/; // no `invalidCharacters`
  const lastCharacter = /[^.\s<>:"/\\|?*\x00-\x1F]$/; // no dot, space and `invalidCharacters`
  if (name.length > 255) return false; // max name length

  if (reservedDeviceNames.test(name)) return false; // windows reserved names

  return (
    firstCharacter.test(name)
    && middleCharacters.test(name)
    && lastCharacter.test(name)
  );
};

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Confirm collectionPath contains either opencollection.yml (yml format) or bruno.json (bru format).
  2. Re-clone or re-import the collection if the config file is missing.
  3. Validate the path with fs.existsSync on both config files before calling getCollectionFormat.

Example fix

// before
const getCollectionFormat = (collectionPath) => {
  if (fs.existsSync(path.join(collectionPath, 'opencollection.yml'))) return 'yml';
  if (fs.existsSync(path.join(collectionPath, 'bruno.json'))) return 'bru';
  throw new Error(`No collection configuration found at: ${collectionPath}`);
};

// after: caller pre-check
if (!fs.existsSync(path.join(p, 'bruno.json')) &&
    !fs.existsSync(path.join(p, 'opencollection.yml'))) {
  throw new Error(`${p} is not a Bruno collection root`);
}
Defensive patterns

Strategy: validation

Validate before calling

function assertCollectionRoot(collectionPath) {
  const hasYml = fs.existsSync(path.join(collectionPath, 'opencollection.yml'));
  const hasJson = fs.existsSync(path.join(collectionPath, 'bruno.json'));
  if (!hasYml && !hasJson) {
    throw new Error(`${collectionPath} is not a Bruno collection root`);
  }
}

Type guard

function isCollectionRoot(collectionPath) {
  return fs.existsSync(path.join(collectionPath, 'opencollection.yml')) ||
         fs.existsSync(path.join(collectionPath, 'bruno.json'));
}

Try / catch

try {
  return getCollectionFormat(collectionPath);
} catch (err) {
  if (err.message.startsWith('No collection configuration found')) {
    // not a collection root; prompt user to import/select a valid collection
    return null;
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling getCollectionFormat (directly or via searchForRequestFiles) on a directory that is not a collection — e.g. an arbitrary folder, a half-cloned repo, or a path whose collection config was deleted/renamed.

Common situations: Pointing Bruno at a plain directory; collection config file removed by a bad merge or .gitignore mishap; wrong path passed (parent or child of the actual collection root); collection still mid-clone.

Related errors


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