{"record":{"id":"7c2b9174d110a0c7","repo":"usebruno/bruno","slug":"no-collection-configuration-found-at-collection","errorCode":null,"errorMessage":"No collection configuration found at: ${collectionPath}","messagePattern":"No collection configuration found at: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/utils/filesystem.js","lineNumber":288,"sourceCode":"  while (checkExists(uniqueName)) {\n    counter++;\n    uniqueName = `${baseName} copy ${counter}`;\n  }\n  return uniqueName;\n};\n\nconst getCollectionFormat = (collectionPath) => {\n  const ocYmlPath = path.join(collectionPath, 'opencollection.yml');\n  if (fs.existsSync(ocYmlPath)) {\n    return 'yml';\n  }\n\n  const brunoJsonPath = path.join(collectionPath, 'bruno.json');\n  if (fs.existsSync(brunoJsonPath)) {\n    return 'bru';\n  }\n\n  throw new Error(`No collection configuration found at: ${collectionPath}`);\n};\n\nconst validateName = (name) => {\n  const invalidCharacters = /[<>:\"/\\\\|?*\\x00-\\x1F]/g; // keeping this for informational purpose\n  const reservedDeviceNames = /^(CON|PRN|AUX|NUL|COM[0-9]|LPT[0-9])$/i;\n  const firstCharacter = /^[^\\s\\-<>:\"/\\\\|?*\\x00-\\x1F]/; // no space, hyphen and `invalidCharacters`\n  const middleCharacters = /^[^<>:\"/\\\\|?*\\x00-\\x1F]*$/; // no `invalidCharacters`\n  const lastCharacter = /[^.\\s<>:\"/\\\\|?*\\x00-\\x1F]$/; // no dot, space and `invalidCharacters`\n  if (name.length > 255) return false; // max name length\n\n  if (reservedDeviceNames.test(name)) return false; // windows reserved names\n\n  return (\n    firstCharacter.test(name)\n    && middleCharacters.test(name)\n    && lastCharacter.test(name)\n  );\n};","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/utils/filesystem.js#L270-L306","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nconst getCollectionFormat = (collectionPath) => {\n  if (fs.existsSync(path.join(collectionPath, 'opencollection.yml'))) return 'yml';\n  if (fs.existsSync(path.join(collectionPath, 'bruno.json'))) return 'bru';\n  throw new Error(`No collection configuration found at: ${collectionPath}`);\n};\n\n// after: caller pre-check\nif (!fs.existsSync(path.join(p, 'bruno.json')) &&\n    !fs.existsSync(path.join(p, 'opencollection.yml'))) {\n  throw new Error(`${p} is not a Bruno collection root`);\n}","handlingStrategy":"validation","validationCode":"function assertCollectionRoot(collectionPath) {\n  const hasYml = fs.existsSync(path.join(collectionPath, 'opencollection.yml'));\n  const hasJson = fs.existsSync(path.join(collectionPath, 'bruno.json'));\n  if (!hasYml && !hasJson) {\n    throw new Error(`${collectionPath} is not a Bruno collection root`);\n  }\n}","typeGuard":"function isCollectionRoot(collectionPath) {\n  return fs.existsSync(path.join(collectionPath, 'opencollection.yml')) ||\n         fs.existsSync(path.join(collectionPath, 'bruno.json'));\n}","tryCatchPattern":"try {\n  return getCollectionFormat(collectionPath);\n} catch (err) {\n  if (err.message.startsWith('No collection configuration found')) {\n    // not a collection root; prompt user to import/select a valid collection\n    return null;\n  }\n  throw err;\n}","preventionTips":["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."],"tags":["filesystem","collection","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}