We're a headless CMS vendor and we've developed a source plugin for our SaaS service. Our source plugin supports creating links of 4 different kinds among data retrieved from our public API. We use the (yet not documented) ___NODE convention to let Gatsby create link fields. One of the four kinds of relationships exhibits a strange behavior--always only one node has this kind of relationship properly created. Other nodes have this relationship fields null.
createNode is called and start a debug session.createNode have their summary_nodes___NODE properties properly populated of id values (GUIDs) of related nodes (previously created with createNodeId).summary_nodes properties in all nodes in the output. Notice that there will be nodes that represent three content items, all of them being translated to three languages, totalling to 9 nodes.All summary_nodes properties should be populated.
In each of the 3 languages in the output, there's only one node with summary_nodes populated in each language.
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
Binaries:
npm: 5.6.0 - C:Program Filesnodejsnpm.CMD
Browsers:
Edge: 40.15063.674.0
npmPackages:
gatsby: ^1.9.277 => 1.9.277
gatsby-link: ^1.6.46 => 1.6.46
gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
error The system cannot find the path specified.
Error: The system cannot find the path specified.
envinfo.js:1 Function.e.exports.sync
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778
envinfo.js:1 Object.copySync
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:104976
envinfo.js:1 Object.t.writeSync.e [as writeSync]
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499
envinfo.js:1
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274
envinfo.js:1 Promise.all.then.e
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289
From previous event:
envinfo.js:1 p
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123986
envinfo.js:1 Object.run
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:125487
create-cli.js:181 Object.handler
[npm]/[gatsby-cli]/lib/create-cli.js:181:17
command.js:235 Object.runCommand
[npm]/[gatsby-cli]/[yargs]/lib/command.js:235:44
yargs.js:1046 Object.parseArgs [as _parseArgs]
[npm]/[gatsby-cli]/[yargs]/yargs.js:1046:30
yargs.js:551 Object.parse
[npm]/[gatsby-cli]/[yargs]/yargs.js:551:25
create-cli.js:242 module.exports
[npm]/[gatsby-cli]/lib/create-cli.js:242:157
index.js:126 Object.
[npm]/[gatsby-cli]/lib/index.js:126:1
bootstrap_node.js:187 startup
bootstrap_node.js:187:16
bootstrap_node.js:608
bootstrap_node.js:608:3
error UNHANDLED REJECTION
Error: The system cannot find the path specified.
envinfo.js:1 Function.e.exports.sync
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778
envinfo.js:1 Object.copySync
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:104976
envinfo.js:1 Object.t.writeSync.e [as writeSync]
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499
envinfo.js:1
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274
envinfo.js:1 Promise.all.then.e
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289
From previous event:
envinfo.js:1 p
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123986
envinfo.js:1 Object.run
[npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:125487
create-cli.js:181 Object.handler
[npm]/[gatsby-cli]/lib/create-cli.js:181:17
command.js:235 Object.runCommand
[npm]/[gatsby-cli]/[yargs]/lib/command.js:235:44
yargs.js:1046 Object.parseArgs [as _parseArgs]
[npm]/[gatsby-cli]/[yargs]/yargs.js:1046:30
yargs.js:551 Object.parse
[npm]/[gatsby-cli]/[yargs]/yargs.js:551:25
create-cli.js:242 module.exports
[npm]/[gatsby-cli]/lib/create-cli.js:242:157
index.js:126 Object.
[npm]/[gatsby-cli]/lib/index.js:126:1
bootstrap_node.js:187 startup
bootstrap_node.js:187:16
bootstrap_node.js:608
bootstrap_node.js:608:3
Hi @JanLenoch, we'll look into this.
I took a look and it seems like nodes that miss summary_nodes in graphql output just don't have summary_nodes___NODE defined when creating them - I've added some debugging helper code:
const nameToSummaryNodes = {}
const interestingNodes = getNodes().filter(
node => node.internal.type === `KenticoCloudItemBlogpostReference`
)
interestingNodes.forEach(node => {
nameToSummaryNodes[`${node.system.name} - [${node.fields.languageStep1}]`] =
node.summary_nodes___NODE
})
and result is:

Which match output from graphql (those are nodes that You create in plugin and not graphql results)
Hi @pieh ,
Thanks for looking into it! The fields aren't there but still, this is not the root cause.
That absence of the summary_node____NODE field is only caused by my adding a check for property.modular_content.length > 0 in normalize.js before submitting this issue. That check was designed just to save the bootstrap process from a few inexpensive Array.includes checks. But never mind, I removed it to always have the ____NODE field present.
But, the problem is that even with the length check removed, the createNode API still sometimes fails to create relationships.
It can be reproduced like that:
createNode is callednonDefaultLanguageItemNodes and compare the node with the 8de2c58a-f4cc-5b2a-a132-b06ac9ebef9a ID with the result in the GraphiQL interface, as seen in the following images.

is node.internal.contentDigest changed when after removed that check? because gatsby will keep nodes data in .cache directory and it will not mark nodes as dirty if contentDigest is same in next run - as quick check - try deleting .cache directory and run gatsby develop again and see if things will show up then
Deleting the .cache folder helped. Thank you!
I suppose this makes the issue resolved, doesn't it?
I think so. I'll close it, but if you run into similiar problems comment here or create new issue :)
Most helpful comment
Hi @JanLenoch, we'll look into this.