Kong/insomnia · error · InsoError
Expected single in the data store, but found none.
Error message
Expected single ${entity} in the data store, but found none. What it means
Validation helper failure from ensureSingle: a data-store query expected exactly one entity of the given type (identified by the interpolated entity name) but the query returned zero matches. Typically means a required singleton document (e.g. settings or a base model) is missing from the NeDB store.
Solutions
- Re-create the missing singleton via getOrCreateForParentId or equivalent
- Restore from a sync/git snapshot
- Verify the parent id used in the lookup is correct
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/insomnia-inso/src/db/models/util.ts:48 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/a783d746b4bfff52.
Report an issue: GitHub.
Appendix: source
Thrown at packages/insomnia-inso/src/db/models/util.ts:48
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)