{"record":{"id":"a660f1348efad771","repo":"gatsbyjs/gatsby","slug":"gatsby-source-drupal-encountered-corrupt-file-wh","errorCode":null,"errorMessage":"[gatsby-source-drupal] Encountered corrupt file while requesting image dimensions for ${url}","messagePattern":"\\[gatsby-source-drupal\\] Encountered corrupt file while requesting image dimensions for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-drupal/src/normalize.ts","lineNumber":118,"sourceCode":"      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(\n      JSON.stringify(\n        {\n          extraNodeData,\n          url,\n          attributes: node.attributes,\n        },\n        null,\n        2\n      )","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-source-drupal/src/normalize.ts#L100-L136","documentation":"In getGatsbyImageCdnFields, the remote file downloads but image-dimension parsing fails with 'unrecognized file format', meaning the URL points to a corrupt file or a non-image served with an image role. The plugin warns (capped at 10 per build) and returns empty Image CDN fields; the file is treated as having no usable image data.","triggerScenarios":"Thrown at packages/gatsby-source-drupal/src/normalize.ts:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-upload the file in Drupal to replace the corrupt asset.","Verify the file is actually a valid image (open it or run file/identify on the URL).","Ensure the Drupal view/response serving the placeholder isn't returning an HTML error page or wrong content type."],"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"}