ErrLookup › Background articles › NotFoundError explained: what 'not found' really means when libraries throw it (and when it hides something else)

NotFoundError explained: what 'not found' really means when libraries throw it (and when it hides something else)

NotFoundError is the generic missing-resource exception raised by dozens of open-source libraries when a lookup by id, name, or path returns nothing. This article covers how the same error class behaves across litellm, Strapi, AutoGPT, Dify, RSSHub, n8n, mem0, Ghost, open-notebook and others: when it is a genuine 404, when it deliberately conceals 'no permission' or even a wrong-origin infrastructure failure, and how to debug each variant.

Distilled from 79 documented records across 14 repositories.

Background

NotFoundError sits at the application layer, not the transport layer: almost every record shows it raised after a lookup the library itself performed — a database findOne, a filtered list, a parsed scrape — returned empty. The library then synthesizes the error and, in HTTP-facing projects (AutoGPT, n8n, Dify, RSSHub, Strapi, Ghost), maps it to a 404. Crucially, no real HTTP 404 may have occurred: litellm wraps a synthetic requests.exceptions.HTTPError with an empty Response after local equality filtering of a successfully fetched model list, and RSSHub throws NotFoundError when a scraped page or API response came back empty (a YouTube channel with no uploads, an Omega Scans series with no chapters, a missing Threads LSD token). In those cases the resource was 'not found' by the library's own matching logic, not by the remote server.

A second, deliberate pattern is conflation of 'missing' with 'not yours'. AutoGPT's session, graph, and webhook validators return the identical NotFoundError when the row does not exist or exists but belongs to another user/organization; n8n's workflow-statistics gate does the same, with the warn log admitting 'User attempted to read a workflow without permissions'. mem0's login goes further, blurring a nonexistent email and a wrong password into one 401 with a dummy bcrypt verify to defeat timing-based enumeration. So a NotFoundError from these codebases means 'gone, never existed, or inaccessible to you' — the caller cannot distinguish, by design.

The family also includes genuinely degenerate cases. open-notebook's broad except in get() converts connection drops and schema-drift deserialization failures into NotFoundError, masking outages as 404s. Ghost and n8n re-throw lower-level Bookshelf NotFound and TypeORM/FolderNotFound errors as NotFoundError, and n8n's user lookup even documents an if(!user) branch that is effectively unreachable defense-in-depth behind findOneOrFail. Whether NotFoundError is a domain exception (AutoGPT's library/triggers.py, caught and mapped at the API layer) or a controller-level response varies by library, so the catch strategy is library-specific.

Across all 30 records the dominant triggers are stale identifiers — ids cached across sessions, deleted between page load and request, or created in a different environment/database — and exact-match sensitivity, whether that is litellm's case-sensitive model_name equality, RSSHub's finite COLUMNS maps, or AutoGPT's graph id/version/user triple that must match on all three components.

Common causes

What usually fixes it

Go deeper

Documented occurrences

…and 59 more across the corpus — use search.

Honest provenance: generated on 2026-08-27 from AI-assisted analysis of the linked records. See how records are made.