gatsbyjs/gatsby · error · Error

LMDB path is not set!

Error message

LMDB path is not set!

What it means

getStorage lazily initializes the LMDB databases; a falsy fullDbPath means the caller did not provide the database file path (an internal wiring bug in how storage was constructed), so opening LMDB is refused immediately rather than corrupting state with an empty path.

Source

Thrown at packages/gatsby-core-utils/src/utils/get-storage.ts:37

      buildId: string
    },
    string
  >
  mutex: Database<LockStatus, string>
}

let databases: ICoreUtilsDatabase | undefined
let rootDb: RootDatabase

export function getDatabaseDir(): string {
  const rootDir = global.__GATSBY?.root ?? process.cwd()
  return path.join(rootDir, `.cache`, `data`, `gatsby-core-utils`)
}

export function getStorage(fullDbPath: string): ICoreUtilsDatabase {
  if (!databases) {
    if (!fullDbPath) {
      throw new Error(`LMDB path is not set!`)
    }

    // __GATSBY_OPEN_LMDBS tracks if we already opened given db in this process
    // In `gatsby serve` case we might try to open it twice - once for engines
    // and second to get access to `SitePage` nodes (to power trailing slashes
    // redirect middleware). This ensure there is single instance within a process.
    // Using more instances seems to cause weird random errors.
    if (!globalThis.__GATSBY_OPEN_LMDBS) {
      globalThis.__GATSBY_OPEN_LMDBS = new Map()
    }

    databases = globalThis.__GATSBY_OPEN_LMDBS.get(fullDbPath)

    if (databases) {
      return databases
    }

    const open = getLmdb().open

View on GitHub (pinned to e85d62f177)

Solutions

  1. Verify the caller passes the .cache/data LMDB path built by getDatabaseDir()
  2. Ensure getStorage is only used via the module-level lazy initializers that resolve the db path first
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at packages/gatsby-core-utils/src/utils/get-storage.ts:37 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/32bd905dfd9270cb. Report an issue: GitHub.