gatsbyjs/gatsby · error
The webhook body was malformed ${JSON.stringify(webhookBody
Error message
The webhook body was malformed
${JSON.stringify(webhookBody, null, 4)} What it means
Fires when a webhook body passes the secret check but is missing the required action or data fields, so the plugin cannot determine what content changed. The warning echoes the full webhook body to aid debugging. Typical causes: the sender posts the wrong payload shape, or middleware/proxies strip or rename fields.
Source
Thrown at packages/gatsby-source-drupal/src/gatsby-node.ts:225
`loading Drupal content changes`,
{
parentSpan,
}
)
changesActivity.start()
try {
const { secret, action, data } = webhookBody
if (pluginOptions.secret && pluginOptions.secret !== secret) {
reporter.warn(
`The secret in this request did not match your plugin options secret.`
)
changesActivity.end()
return
}
if (!action || !data) {
reporter.warn(
`The webhook body was malformed
${JSON.stringify(webhookBody, null, 4)}`
)
changesActivity.end()
return
}
if (action === `delete`) {
let nodesToDelete = data
if (!Array.isArray(data)) {
nodesToDelete = [data]
}
for (const nodeToDelete of nodesToDelete) {
const deletedNode = await handleDeletedNode({
actions,View on GitHub (pinned to e85d62f177)
Solutions
- Inspect the logged webhook body and fix the sending side so it includes both action and data fields.
- Verify the webhook module version in Drupal matches what gatsby-source-drupal expects.
- Ensure the body is sent as application/json and not wrapped or stringified multiple times by intermediaries.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/gatsby-source-drupal/src/gatsby-node.ts:225 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26).
Data as JSON: /api/errors/d89cd1d56106e007.
Report an issue: GitHub.