Kong/insomnia · error · InsoError

Expected single in the data store, but found multiple ( ).

Error message

Expected single ${entity} in the data store, but found multiple (${items.length}).

What it means

Validation helper failure from ensureSingle: a data-store query that must yield exactly one entity of the given type returned multiple duplicates (count is interpolated). Indicates corrupted or duplicated singleton documents in the NeDB data store rather than a user input problem.

Solutions

  1. Delete or merge the duplicate records in the data store
  2. Restore the project from a clean snapshot
  3. Check for import bugs that duplicated singleton documents
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia-inso/src/db/models/util.ts:51 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/22e5ab501a39aedf. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia-inso/src/db/models/util.ts:51

    return items[0];
  }

  if (items.length === 0) {
    return null;
  }

  throw new InsoError(`Expected single or no ${entity} in the data store, but found multiple (${items.length}).`);
};
export const ensureSingle = <T>(items: T[], entity: string): T => {
  if (items.length === 1) {
    return items[0];
  }

  if (items.length === 0) {
    throw new InsoError(`Expected single ${entity} in the data store, but found none.`);
  }

  throw new InsoError(`Expected single ${entity} in the data store, but found multiple (${items.length}).`);
};

View on GitHub (pinned to d9bb2b0142)