Gatsby build occasionally time out after "Caching JavaScript and CSS webpack compilation"
See original GitHub issuePreliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
About a month ago, builds of my Gatsby site started failing in GitHub Actions.
For context, this Gatsby site is a minimal example using my gatsby-source-s3
plugin, that I use for testing the plugin end-to-end.
Here’s from an example of a failed build:
# ℹ️ omitted earlier logs, check out the link above to view the entire output
success run page queries - 13.660s - 1/1 0.07/s # 👈 this is after all nodes were sourced from S3, so I don't think the problem is with my plugin
success write out requires - 0.011s
success Building production JavaScript and CSS bundles - 9.577s
success Rewriting compilation hashes - 0.005s
success Writing page-data.json files to public directory - 0.017s - 1/1 57.50/s
success Caching JavaScript and CSS webpack compilation - 13.059s # 👈 this is where is hangs
Error: Timed out waiting for: http://localhost:9000 # 👈 this is the timeout from cypress. I've also increased it to see if it just took too long, but that was not the issue
At first, all builds were failing, and in the last week it seems that some of them are passing again while others are still failing.
I’m not sure what’s happening here, as there are no helpful logs in the build output. A local gatsby develop
works completely fine. The occasional passing build seem to rule out issues in my project or in other dependencies. I also asked on discord but it didn’t seem like anyone was having the same issue.
Any thoughts on:
- what the issue is here
- how I could debug this—I haven’t found anything on the docs about this
Thank you!
A note about the reproduction link 👇 I am aware that the issue template says “Do not link to your actual project”, but in my case this example site is exactly a minimal example, since the only thing is does is pulling images from S3. I added the GH Action output there, here’s the link to the actual source although I doubt that it will be helpful.
Reproduction Link
https://github.com/robinmetral/gatsby-source-s3/runs/3912139392?check_suite_focus=true
Steps to Reproduce
- Visit the link above to see the failing build output. I cannot reliably reproduce this locally, as mentioned in the summary.
Expected Result
gatsby build
should not time out
Actual Result
gatsby build
is flaky and unreliable, and regularly hangs in CI envs
Environment
My local environment is not the issue here, this is failing on a clean GH Actions machine with:
- Ubuntu 20.04 LTS
- Latest Node 14
- Gatsby 3
Config Flags
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:34 (17 by maintainers)
I am also having this issue. I feel (although not sure) that these are caused by sharp plugin. gatsby-transformer-sharp & gatsby-plugin-sharp maybe.
edit: Reverting both of the above plugins to 3.12.0 meant the builds passed.
Upgrading to Gatsby v4 with related packages now causes my build to stop at “success run queries in workers - 7.453s - 65/65 8.72/s”