usebruno/bruno · error · BrunoError
The Collection file is corrupted
Error message
The Collection file is corrupted
What it means
Thrown by validateSchema() after collectionSchema.validate() rejects one or more collections. It is a deliberately generic message — the underlying Yup schema error is only console.log-ged, not surfaced — signalling the imported collection does not match Bruno's collection schema.
Source
Thrown at packages/bruno-app/src/utils/importers/common.js:28
import { BrunoError } from 'utils/common/error';
import { isOpenApiSpec } from './openapi-collection';
import { isPostmanCollection } from './postman-collection';
import { isInsomniaCollection } from './insomnia-collection';
import { valueToString } from '@usebruno/common/utils';
export const validateSchema = async (collections = []) => {
collections = Array.isArray(collections) ? collections : [collections];
try {
await Promise.all(
collections.map(async (collection) => {
await collectionSchema.validate(collection);
})
);
return collections;
} catch (err) {
console.log(err);
throw new BrunoError('The Collection file is corrupted');
}
};
export const updateUidsInCollection = (_collection) => {
const collection = cloneDeep(_collection);
collection.uid = uuid();
const updateItemUids = (items = []) => {
each(items, (item) => {
item.uid = uuid();
each(get(item, 'request.headers'), (header) => (header.uid = uuid()));
each(get(item, 'request.params'), (param) => (param.uid = uuid()));
each(get(item, 'request.vars.req'), (v) => (v.uid = uuid()));
each(get(item, 'request.vars.res'), (v) => (v.uid = uuid()));
each(get(item, 'request.assertions'), (a) => (a.uid = uuid()));
each(get(item, 'request.body.multipartForm'), (param) => (param.uid = uuid()));View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Reproduce in a console to read the real Yup error logged by validateSchema (the thrown message hides it).
- Fix the offending field named in the Yup validation error in the source spec or converter output.
- Update @usebruno/converters and retry; if it persists, file an issue with the failing source spec.
Defensive patterns
Strategy: try-catch
Validate before calling
try {
await collectionSchema.validate(collection);
} catch (schemaErr) {
console.error('Schema violation:', schemaErr);
} Try / catch
try {
await validateSchema(collection);
} catch (err) {
// 'The Collection file is corrupted' is opaque; re-run collectionSchema.validate
// separately to obtain the field-level Yup error.
throw err;
} Prevention
- Run collectionSchema.validate directly to read the field-level error Yup emits.
- Keep @usebruno/converters updated so converter output matches the schema.
- Validate converted collections in CI before user-facing import.
When it happens
Trigger: Importing a collection (OpenAPI, Insomnia, OpenCollection, Postman) whose converted Bruno shape fails collectionSchema validation: missing required fields, wrong item types, malformed request/response objects, etc.
Common situations: A converter produced an incomplete collection, an upstream spec had exotic structures the converter does not handle, or a hand-edited import file drifted from the schema after a Bruno version bump.
Related errors
- Invalid collection: Neither bruno.json nor opencollection.ym
- Import collection failed
- Invalid environment: expected an object
- Invalid environment: missing or invalid variables array
- Invalid variable at index ${index}: expected an object
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/713def0ee583429a.
Report an issue: GitHub.