gatsby: [gatsby-remark-images-contentful] intermittent build errors with/to base64
Description
We’re having an issue during the build phase of our project: sometimes the run graphql queries...
step finishes without any issues and the site builds fine. But since recently the build process gets stuck at the ⡀ run graphql queries — 123/125 46.15 queries/second
step and keeps either spinning forever or, if it finishes, takes a very long time (it doesn’t always stop at 123. Sometimes it stops at 7/125 or other numbers).
Steps to reproduce
- delete
.cache
folder - run
gatsby build
Expected result
The build process should finish without issues.
Actual result
The build process gets stuck at the “run graphql queries…” phase.
Environment
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.10.0 - ~/.nvm/versions/node/v11.10.0/bin/node
npm: 6.8.0 - ~/.nvm/versions/node/v11.10.0/bin/npm
Languages:
Python: 2.7.15 - /usr/local/bin/python
Browsers:
Chrome: 72.0.3626.109
Firefox: 65.0.1
Safari: 12.0.3
npmPackages:
gatsby: ^2.1.4 => 2.1.4
gatsby-image: ^2.0.29 => 2.0.29
gatsby-plugin-manifest: ^2.0.17 => 2.0.17
gatsby-plugin-offline: ^2.0.23 => 2.0.23
gatsby-plugin-postcss: ^2.0.5 => 2.0.5
gatsby-plugin-react-helmet: ^3.0.6 => 3.0.6
gatsby-plugin-remove-trailing-slashes: ^2.0.7 => 2.0.7
gatsby-plugin-robots-txt: ^1.4.0 => 1.4.0
gatsby-plugin-sharp: ^2.0.20 => 2.0.20
gatsby-plugin-sitemap: ^2.0.5 => 2.0.5
gatsby-plugin-svgr: ^2.0.1 => 2.0.1
gatsby-remark-embed-video: ^1.7.0 => 1.7.0
gatsby-remark-images-contentful: ^2.0.8 => 2.0.8
gatsby-remark-responsive-iframe: ^2.0.9 => 2.0.9
gatsby-source-contentful: ^2.0.29 => 2.0.29
gatsby-source-filesystem: ^2.0.20 => 2.0.20
gatsby-source-hire-with-google: ^1.3.0 => 1.3.0
gatsby-transformer-remark: ^2.2.5 => 2.2.5
gatsby-transformer-sharp: ^2.1.13 => 2.1.13
npmGlobalPackages:
gatsby-cli: 2.4.10
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 25 (9 by maintainers)
Commits related to this issue
- use BLURRED insted of TRACED_SVG https://github.com/gatsbyjs/gatsby/issues/11867 — committed to dowdiness/yowai-zine by dowdiness 3 years ago
@floriangaechter thanks for the repro i’ll try to look at this today or else tomorrow.
We’re running into this issue as well with the Figma marketing site when building on Ubuntu. We had a similar issue on some machines on macOS, but running
yarn cache clean
resolved the issue on those machines.To resolve in production we’ve replaced all Gatsby Image gql queries w/ the
_noBase64
variants.Any chance someone on the @gatsbyjs/core team can take a look?
@thetrevorharmon, I ended up having to remove the plugin for now.
gatsby-remark-images-contentful
doesn’t seem to ignore.gif
files likegatsby-remark-images
does which was causing a whole slew of errors for me. Once I removed the plugin, all of my build errors were resolved.Hi all,
I’m also seeing this behaviour, but it’s originating from gatsby-remark-images-contentful.
The issue seems intermittent for me also, sometimes building fine, other times hanging on the queries stage.
I ran the build via Charles Proxy and can see the image requests going out. When the build hangs, I can see one or more images that have started transferring but don’t complete, axios then hangs indefinitely. I’ve only seen this effect the original images, not the w=40 variants.
I tried adding a timeout to the axios call, but this doesn’t have any effect. I believe this is due to the fact that the connection has started, rather than failed to connect at all.
With my very limited knowledge in this area, it does look like the code always expects the connection to be successful and timely. I wonder if we could bolster the connection handling to allow it to time out and then gracefully re-try the failed resources.
Interestingly when I requested the same resources via a bash script, concurrently requested, it succeeded every time. The transfers appeared to slow down towards the end, but no dropouts.
@ddsr17 yes, as soon as we pull in data from Contentful the build task crashes, stalls, or, if we’re very lucky, succeeds 😄 but to be serious, yes, we still have the issue.
Currently we’re doing without any image preprocessing, just serving the images without traced SVGs or blurred versions of the image.
Some new information – sometimes I’m getting the following error:
Here’s the stack trace:
and:
I think it has to do with the way the images are pulled from Contentful…