Kong/insomnia · error · InsoError

Expected single or no

Error message

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

What it means

Data-integrity guard in ensureSingleOrNone: the query returned more than one instance of an entity that the data model defines as singleton-or-absent (e.g. multiple base environments), indicating duplicated or corrupted data.

Solutions

  1. Inspect the data store and remove the duplicate entities
  2. Re-sync or re-import the project data
  3. Report the corruption if duplicates keep reappearing
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia-inso/src/db/models/util.ts:40 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/a4c929131d62190c. Report an issue: GitHub.

Appendix: source

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

    hint?: string;
  } = {},
) => ({
  name: idIsh,
  message: indent(config.indent || 0, message),
  value: `${message} - ${idIsh}`,
  hint: config.hint || `${idIsh}`,
});

export const ensureSingleOrNone = <T>(items: T[], entity: string): T | null | undefined => {
  if (items.length === 1) {
    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)