gatsbyjs/gatsby · error

File node failed to restore from cache. This is a bug in gat

Error message

File node failed to restore from cache. This is a bug in gatsby-source-wordpress. Please open an issue so we can help you out :)

What it means

Cache-restoration warning while collecting HTML-embedded images: gatsby-source-wordpress keeps a map of sourceUrl → node id, but the node for a cached URL no longer exists in the store (e.g. it was garbage-collected, deleted in WP, or state was partially restored). Shown once per run; the code then re-fetches/creates the missing media item nodes instead of failing.

Source

Thrown at packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes/process-node.js:188

  wpUrl,
}) => {
  // get all the image nodes we've cached from elsewhere
  const { nodeMetaByUrl } = getStore().getState().imageNodes

  const previouslyCachedNodesByUrl = (
    await Promise.all(
      Object.entries(nodeMetaByUrl).map(([sourceUrl, { id } = {}]) => {
        if (!sourceUrl || !id) {
          return null
        }

        sourceUrl = ensureSrcHasHostname({ wpUrl, src: sourceUrl })

        const existingNode = helpers.getNode(id)

        if (!existingNode) {
          if (!displayedFailedToRestoreMessage) {
            helpers.reporter.warn(
              formatLogMessage(
                `File node failed to restore from cache. This is a bug in gatsby-source-wordpress. Please open an issue so we can help you out :)`
              )
            )
            displayedFailedToRestoreMessage = true
          }

          return null
        }

        return {
          sourceUrl,
          ...existingNode,
        }
      })
    )
  ).filter(Boolean)

View on GitHub (pinned to e85d62f177)

Solutions

  1. Usually transient — run `gatsby clean` to purge the inconsistent .cache and re-develop
  2. If persistent, verify the referenced media still exists in WordPress and WPGraphQL returns it
  3. Report a reproduction to the gatsby-source-wordpress issue tracker, since the message indicates a plugin-side cache bug
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes/process-node.js:188 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/a5823a22abf6daf9. Report an issue: GitHub.