Parallel Query Running #32389
Replies: 18 comments 64 replies
-
Hi Just updated to 3.10.0 and enabled There was an error in your GraphQL query: Unknown type "HATCH_ContentMenuItemType".
A few details:
Hopefully, this is helpful... |
Beta Was this translation helpful? Give feedback.
-
Hi, reporting an error with PQR and gatsby-source-wordpress it looks like: Logs from gatsbyjs.com on Gatsby Cloud @TylerBarnes this seems to be an issue with the wordpress plugin
|
Beta Was this translation helpful? Give feedback.
-
Hey there, I just wanted to report that I got the following error when trying PQR
also
|
Beta Was this translation helpful? Give feedback.
-
Getting these errors after enabling PQR on Netlify builds.
|
Beta Was this translation helpful? Give feedback.
-
Seeing the following message logged multiple times (once for each worker); The offending code is here: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/services/initialize.ts#L35-L54 it looks like this is inadvertently loaded for each child worker. |
Beta Was this translation helpful? Give feedback.
-
I'm using
and crashes. When I remove the |
Beta Was this translation helpful? Give feedback.
-
The error only occurs when PARALLEL_QUERY_RUNNING=true and mdx files in nested dirs > 255 characters.
gatsby info
|
Beta Was this translation helpful? Give feedback.
-
Got this error when doing a cold build:
Gatsby info:
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am creating a Gatsby project with Contentful and deploying it in Netlify. 9:03:36 PM: error ENOENT: no such file or directory, open '/opt/build/repo/.cache/caches/gatsby-source-contentful/e16675795aa57c817fbc2ebb9efecfdb-3/chuecking-pc-2.jpg' |
Beta Was this translation helpful? Give feedback.
-
I'm getting this error after upgrading to gatsby v4. Builds on vercel and local develop works but local build doesn't work.
|
Beta Was this translation helpful? Give feedback.
-
Can you turn off parallel query running for Gatsby 4? @LekoArts |
Beta Was this translation helpful? Give feedback.
-
Hi, I managed to migrate my site from gatsby 2 to version 4. The Build is successful in my local. However, when I deploy it to Netlify, I get the following error.
I also got this error during the build time
Not sure why the building time increases dramatically after I migrating my site to gatsby 4 (with same codebase)
Could you suggest to me what this error means and possibly how to fix the issue? Many thanks |
Beta Was this translation helpful? Give feedback.
-
Just upgraded from Gatsby 4.4 to 4.6 and started getting this build error, both locally and on Netlify. it's a different image every time, but it seems to consistently happen while querying my contentful images. I tried downgrading to v4.5.5 and I got build success locally and in Netlify. I was content with that solution, but then I noticed that I had left the flag I know DETECT_NODE_MUTATIONS aren't supposed to be left on (my bad) but I'm guessing something in 4.6 made it take so long it was causing build errors.
|
Beta Was this translation helpful? Give feedback.
-
Stuck with this error when trying to deploy my site on netlify. I have recently update from gatsby v2 to v4. After that I am facing the issue, please help.
This is the output of my
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to migrate my site from gatsby 2 to version 4. Stuck with this error while fetching the hero image. Would you know what the error means and how to fix it? Many thanks
My Gatsby info
|
Beta Was this translation helpful? Give feedback.
-
I have been getting a ton of build failures that send me here. Sometimes the output is unhelpful, just saying that there was an error, other times I get something more descriptive, but it is almost always about an image that is having trouble being downloaded from contentful. Just now the issue was:
It seems that PQR doesn't allow time for processing images using Is there any stop-gap solutions being worked on? This one in particular is odd because that image clearly exists (you can put that url in your browser and see the image) but it's reporting a 500 error. |
Beta Was this translation helpful? Give feedback.
-
Did you encounter a problem with Query Running?
March 1, 2022 Update: This discussion is now locked so we can better track issue reports via our standard issue reporting process here
🙏 Thank you to everyone that's shared information so far.
After introducing LMDB Data Storage in Gatsby v3.7 we're now offering a new experiment that directly builds on top of LMDB: Parallel Query Running
What is Parallel Query Running?
Gatsby's build process is composed of multiple steps (see our documentation for more details) and one step that will increase in time with more and more pages/nodes is query running. You're seeing this step as
run static queries
andrun page queries
in your build log.This step currently only runs in a singular process and the goal of Parallel Query Running is to spread out the work to multiple processes to better utilize available cores & memory. We're using
gatsby-worker
(highly inspired byjest-worker
) andlmdb-store
to accomplish this. In Gatsby v3.7 we've added support for LMDB in Gatsby and are now leveraging this new data storage option to enable communication between the main process and the workers.How to Use
Make sure that you're on
gatsby@latest
,gatsby-plugin-mdx@latest
,gatsby-plugin-sharp@latest
,gatsby-transformer-sharp@latest
and that you're using Node >= 14.15.Install
lmdb-store
as a dependency:npm install lmdb-store
.Add the
PARALLEL_QUERY_RUNNING
flag to yourgatsby-config.js
:Run
gatsby build
(as this only applies to thebuild
step).By default, Gatsby will use
cpuCount() - 1
workers to run the queries (physical cores). So if you have 4 cores/8 threads it'll use 3 workers. You can override this number with theGATSBY_CPU_COUNT
environment variable.Plugins
gatsby-source-contentful
please install this version:gatsby-source-contentful@alpha-pqr-compat
gatsby-source-wordpress
please installgatsby-source-wordpress@5.12.0-alpha-wordpress.27+67978b34c0
Your feedback
Please link to a minimal reproduction or your publicly available project on GitHub.
Feedback directly related to LMDB should still go into the LMDB Umbrella Discussion.
We're very much looking for feedback from you using this new data storage! We'll expand this section with more asks and details in the future, but for now our specific asks would be:
gatsby develop
andgatsby build
)?--verbose
flag =>gatsby build --verbose
gatsby clean
beforehand; Warm: With a cache)run page queries
vsrun queries in workers
gatsby build
for before/after PQR to see which steps increased and decreased in timeConstraints
The same notes and constraints from LMDB apply, in addition to these constraints:
ts-node
you might get problems with memory since every worker will load the runtime into the process.createTypes
,createFieldExtension
andaddThirdPartySchema
insourceNodes
is not allowed. Only allowed increateSchemaCustomization
andcreateResolvers
APIBeta Was this translation helpful? Give feedback.
All reactions