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
- Confirm collectionPath contains either opencollection.yml (yml format) or bruno.json (bru format).
- Re-clone or re-import the collection if the config file is missing.
- 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
- Confirm a config file is present before treating a directory as a collection root.
- Re-import or re-clone when the config file is missing.
- Pass the exact collection root path, not a parent or child.
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
- The Collection file is corrupted
- No files selected
- Invalid file type: ${file.name}. Only JSON files are support
- The collection is not valid (neither bruno.json nor opencoll
- ${request.filename} is not a valid filename
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/7c2b9174d110a0c7.
Report an issue: GitHub.