{"record":{"id":"2f638ec6e9a126ca","repo":"gatsbyjs/gatsby","slug":"gatsby-source-drupal-file-returns-404-url","errorCode":null,"errorMessage":"[gatsby-source-drupal] file returns 404: ${url}","messagePattern":"\\[gatsby-source-drupal\\] file returns 404: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-drupal/src/normalize.ts","lineNumber":109,"sourceCode":"    if (!hasRequiredData(imageSize) || !placeholderUrl) {\n      return {}\n    }\n\n    const gatsbyImageCdnFields = {\n      filename,\n      url,\n      placeholderUrl,\n      width: imageSize.width,\n      height: imageSize.height,\n      mimeType,\n    }\n\n    return gatsbyImageCdnFields\n  } catch (e) {\n    if (e.message.includes(`404`)) {\n      if (four04WarningCount < 10) {\n        four04WarningCount++\n        reporter.warn(`[gatsby-source-drupal] file returns 404: ${url}`)\n      }\n\n      return {}\n    }\n\n    if (e.message.includes(`unrecognized file format`)) {\n      if (corruptFileWarningCount < 10) {\n        corruptFileWarningCount++\n        reporter.warn(\n          `[gatsby-source-drupal] Encountered corrupt file while requesting image dimensions for ${url}`\n        )\n      }\n\n      return {}\n    }\n\n    reporter.error(e)\n    reporter.info(","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-source-drupal/src/normalize.ts#L91-L127","documentation":"In getGatsbyImageCdnFields, the plugin requests the remote file to read its image dimensions; when that request 404s, the file is missing on the Drupal server (deleted, renamed, or a stale URL). The plugin warns (max 10 times per build to avoid log flooding) and returns an empty object, so the node gets no Image CDN fields and gatsby-plugin-image data for that file will be absent.","triggerScenarios":"Thrown at packages/gatsby-source-drupal/src/normalize.ts:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or remove the content in Drupal that references the missing file so the URL resolves.","Re-save/re-upload the file in Drupal and re-run the build.","Clear Drupal's CDN/reverse-proxy cache if the file exists but the edge still 404s.","If many files 404, audit the Drupal media library for orphaned references."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}