New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby Cloud id "[object Object]" is nullish.
error
#13
Comments
It looks like our query nodeChanges {
nodesUpdatedSince (since: "2021-04-16 22:02:24") { nodeId nodeType siteId}
nodesDeletedSince (since: "2021-04-16 22:02:24") { nodeId nodeType siteId}
} {
"data": {
"nodesUpdatedSince": [
{
"nodeId": "45346",
"nodeType": "uploads_Asset",
"siteId": "1"
},
{
"nodeId": "45350",
"nodeType": "news_articles_Entry",
"siteId": "1"
},
{
"nodeId": "45593",
"nodeType": "uploads_Asset",
"siteId": "1"
},
{
"nodeId": "45596",
"nodeType": "uploads_Asset",
"siteId": "1"
},
{
"nodeId": "45597",
"nodeType": "news_articles_Entry",
"siteId": "1"
}
],
"nodesDeletedSince": [
{
"nodeId": "45322",
"nodeType": "news_articles_Entry",
"siteId": null
},
{
"nodeId": "45356",
"nodeType": "news_articles_Entry",
"siteId": null
}
]
}
}
|
Not to keep talking to myself here but... :) It seems like this might be an issue with gatsby-hepler? The resolver doesn't appear to return the siteId. Is this not needed for deletions? If so, it should probably be removed from the |
That's a great observation about the site id and deleted nodes. I'll see if I can reproduce the troubles you're describing! |
@andris-sevcenko I've been trying to get clarification on what the signature should be for the nodeEvents map... The
I think this is causing my issue. It seems like the node isn't being matched properly... but I'm not sure what the match criteria is... Do you have any insight into this? |
@kara-todd Here's what I think is happening: This function generates the GraphQL fragment that lists all the fields Gatsby will use for a node ID. So, since site id is missing for deleted nodes, this line generates an incorrect key. So, the end result would be that Gatsby never internally deletes this node and doesn't delete it from relations, either. So, if for any reason Gatsby figured it needed to update a node that it didn't know should have been deleted, you would get the So the issue is actually on the gatsby-helper plugin side. |
…y incremental content sourcing to fail. Resolve #13
@kara-todd Okay. Can you change your Gatsby Helper plugin requirement in the "require": {
"craftcms/gatsby-helper": "dev-develop#56c8a4cc36292fae21aa246d02163c2e8bb18a77 as 1.0.0",
"...": "..."
} and run Can you test this out for a while and see if that resolves these issues going forward? |
Thanks @andris-sevcenko ! I tried this out locally, but it seems there is currently a bug where deleting an entry causes an internal error. I believe the issue is that I also ran into an issue where the This seems to be working locally, but I didn't want to commit my hacked version. 🙃 Also happy to open a PR if needed. I just thought the changes were pretty minor. |
One of these days being lazy will pay off, I swear. I cleaned up the code. Can you update the commit hash to Sorry for doing such a half-assed job previously. |
Thanks again @andris-sevcenko. I tested this on my local and QA and the changes look good. I've gone ahead and started running this live. I'll report back on if we are still seeing any routine failures |
Appreciate it, @kara-todd! |
I am getting a similar issue where intermittently incremental builds will fail and continue to do so until I "Clear Cache and Deploy" via Netlify. I am also using the Gatsby cache plugin in order to speed up builds. Most of the time I get the below error:
The last two times I have gotten this error:
Let me know if you need any more info! |
@andris-sevcenko unfortunately... it looks like this is still cropping up for builds on me as well. I'm going to try and dig through the logs more and find the correct conditions to replicate the issue. |
@mcclaskiem what's the type of |
@kara-todd appreciate all your help - it's not very feasible for me to reproduce this without knowing how, indeed. |
@andris-sevcenko Just as an update. I'm still looking into this... I worked together with Vladar to get improve the error reporting in graphqph-toolkit (gatsbyjs/gatsby-graphql-toolkit#32.) I'm going to run this in production for a while and hopefully that will uncover the issue in more detail. I haven't been able to create a reproducible test case locally. Please bear with me... Thank you. 🙏🏻 |
@kara-todd I just wanted the record to show that @vladar is the best. Without him, it's unlikely Craft would have decent Gatsby support. |
It’s a Super Table field within a matrix block @andris-sevcenko |
@andris-sevcenko I'll edit this with a better follow up tomorrow, but I think I finally figured out the core of the issue. The build is failing when there is a pending entry. I confirmed that the node causing the build to fail has a status of "pending" Should pending entries be included in the |
That accords with what I've been seeing on Netlify – I'm getting a crashing build pretty often after editors add new content, which I can't replicate, though I wouldn't be surprised if they're building while an entry is pending. |
@mcclaskiem Sounds like you're not using the latest version of SuperTable - 2.6.7 was the Gatsby Helper plugin compatibility release for SuperTable. If you update to that, your error should disappear! |
@dbvisel @kara-todd ah, interesting. This sort of rings a bell. What Craft version are you both using? For background, Craft 3.6.8 introduced a new setting for GraphQL schemas for querying drafts, revisions, and inactive elements. If updating to 3.6.8, a migration automatically added those for all existing schemas (since it was always allowed before), but, if you start with 3.6.8 or later, those settings would be disabled by default and it would be easy to miss. So, if you started on 3.6.8 or later and did not notice the new settings, you would start running into this. Can you both check if it's the case? To me, it would make sense if non-live elements were not required, however, drafts will definitely be required for live preview to work. |
I'm on Craft Pro 3.6.14, which I just updated to – my site was started before 3.6.8. I have those three boxes checked in the schema I'm using (and I'm not sure when they started being checked). Would unchecking them change things? (and thanks, as ever, for the support!) |
@dbvisel they got checked when added as you updated to 3.6.8 and unchecking them would not help. Let's wait for a follow up by @kara-todd. |
Ok. I think I’ve worked this down to a reproducible case. What I believe is happening here is that Gatsby (via Pre step: If using yarn (not sure how to do this in npm) set a resolutions definition to pull the latest version of
Here's the steps to reproduce:
My initial thought here was just to add Do you have any insight as to why this might be @andris-sevcenko? Also, to answer your previous question. I'm on |
Okay, I fixed this in the gatsby-source-craft plugin. I Will see if we can publish a new version today. |
Gatsby Helper 1.0.2 is out now with the additional fix. |
Description
We've been running a Gatsby 2.x build on Gatsby Cloud with
gatsby-source-craft
for a few weeks now. Intermittently, we are getting the error posted below. The NodeType varies... it's beennews_articles_Entry
,pages_pages_Entry
, etc. It seems to only happen on incremental builds... In other words the messageCraft config version has not changed since last sourcing. Checking for content changes since "dateTime"
always appears. At this point... we only have like a 60-50% success rate on builds. Generally, they have to be manually re-triggered, and sometimes with the cache fully cleared.Steps to reproduce
Inconsistent. I know for sure it is happening on Gatsby Cloud and seems to only occur on incremental builds.
Additional info
The text was updated successfully, but these errors were encountered: