{"record":{"id":"ef270d2a427113f1","repo":"gatsbyjs/gatsby","slug":"the-node-internal-owner-field-is-set-automatically","errorCode":null,"errorMessage":"The node internal.owner field is set automatically by Gatsby and not by plugins","messagePattern":"The node internal\\.owner field is set automatically by Gatsby and not by plugins","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/redux/actions/public.js","lineNumber":708,"sourceCode":"  // Ensure the new node has an internals object.\n  if (!node.internal) {\n    node.internal = {}\n  }\n\n  // Ensure the new node has a children array.\n  if (!node.array && !_.isArray(node.children)) {\n    node.children = []\n  }\n\n  // Ensure the new node has a parent field\n  if (!node.parent) {\n    node.parent = null\n  }\n\n  // Tell user not to set the owner name themself.\n  if (node.internal.owner) {\n    report.error(JSON.stringify(node, null, 4))\n    report.panic(\n      chalk.bold.red(\n        `The node internal.owner field is set automatically by Gatsby and not by plugins`\n      )\n    )\n  }\n\n  const trackParams = {}\n  // Add the plugin name to the internal object.\n  if (plugin) {\n    node.internal.owner = plugin.name\n    trackParams[`pluginName`] = `${plugin.name}@${plugin.version}`\n  }\n\n  const result = nodeSchema.validate(node)\n  if (result.error) {\n    if (!hasErroredBecauseOfNodeValidation.has(result.error.message)) {\n      const errorObj = {\n        id: `11467`,","sourceCodeStart":690,"sourceCodeEnd":726,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/redux/actions/public.js#L690-L726","documentation":"Thrown by the createNode action when the incoming node already has `internal.owner` set. owner is an internal field that Gatsby assigns automatically from the plugin that created the node; plugins/users must not set it themselves. The node is JSON-stringified via report.error first, then the build panics.","triggerScenarios":"A call to actions.createNode with a node object whose `internal.owner` is truthy (set by user/plugin code rather than Gatsby).","commonSituations":"Copying node objects and re-saving them; a plugin explicitly assigning internal.owner; transforming cached nodes and forwarding the owner field; misunderstanding that owner is bookkeeping, not input.","solutions":["Do not set `internal.owner` in the node you pass to createNode; only set internal.type, internal.content, internal.contentDigest, and (optionally) mediaType.","If transforming existing nodes, strip internal.owner before re-creating them.","Build the internal object fresh: { type, contentDigest, content } and let Gatsby add owner."],"exampleFix":"// before\ncreateNode({\n  id, internal: { type: `Foo`, contentDigest, owner: `my-plugin` },\n})\n// after\ncreateNode({\n  id, internal: { type: `Foo`, contentDigest },\n})","handlingStrategy":"validation","validationCode":"// Strip owner before createNode so Gatsby can set it\nconst { owner, ...internalRest } = node.internal\nif (owner) reporter.warn('internal.owner is auto-set; ignoring provided value')\nactions.createNode({ ...node, internal: internalRest })","typeGuard":"function isCleanInternal(i): i is { type: string; contentDigest: string } {\n  return i && typeof i.type === 'string' && typeof i.contentDigest === 'string' && !i.owner\n}","tryCatchPattern":null,"preventionTips":["Build internal fresh per node; never forward owner from cached/transformed nodes.","Only set internal.type, internal.content, internal.contentDigest (and mediaType when relevant).","Add a lint/test that asserts created nodes do not carry owner."],"tags":["nodes","createnode","internal","validation"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}