profile
viewpoint

Ask questionsCircleCI build Error: spawn ENOMEM

<!-- Please fill out each section below, otherwise your issue will be closed. This info allows Gatsby maintainers to diagnose (and fix!) your issue as quickly as possible.

Useful Links:

  • Documentation: https://www.gatsbyjs.org/docs/
  • How to File an Issue: https://www.gatsbyjs.org/contributing/how-to-file-an-issue/

Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues -->

Description

CircleCI builds failed with the following error:

  Error: spawn ENOMEM
  
  - child_process.js:372 ChildProcess.spawn
    internal/child_process.js:372:11
  
  - worker.js:80 exports.default._initialize
    [src]/[jest-worker]/build/worker.js:80:69
  
  - worker.js:206 exports.default._exit
    [src]/[jest-worker]/build/worker.js:206:12
  
  - child_process.js:254 Process.ChildProcess._handle.onexit
    internal/child_process.js:254:12

Steps to reproduce

Slightly modify f74d723f037ca55068b456dc808ee3dd8ec563cc and send new pull request.

Expected result

Gatsby build should pass

Actual result

Build is not passing

Environment

System: OS: Linux 4.15 Debian GNU/Linux 9 (stretch) 9 (stretch) CPU: (36) x64 Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz Shell: 4.4.12 - /bin/bash Binaries: Node: 11.5.0 - /usr/local/bin/node Yarn: 1.12.3 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Languages: Python: 2.7.13 - /usr/bin/python npmPackages: gatsby: ^2.3.31 => 2.3.31 gatsby-image: ^2.0.37 => 2.0.37 gatsby-paginate: ^1.0.17 => 1.0.17 gatsby-plugin-catch-links: ^2.0.13 => 2.0.13 gatsby-plugin-favicon: ^3.1.6 => 3.1.6 gatsby-plugin-google-tagmanager: ^2.0.12 => 2.0.12 gatsby-plugin-manifest: ^2.0.26 => 2.0.26 gatsby-plugin-netlify: ^2.0.16 => 2.0.16 gatsby-plugin-offline: ^2.1.0 => 2.1.0 gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12 gatsby-plugin-sentry: ^1.0.1 => 1.0.1 gatsby-plugin-sharp: ^2.0.32 => 2.0.32 gatsby-plugin-sitemap: ^2.0.11 => 2.0.11 gatsby-plugin-typography: ^2.2.10 => 2.2.10 gatsby-remark-images: ^3.0.10 => 3.0.10 gatsby-remark-prismjs: ^3.2.7 => 3.2.7 gatsby-source-filesystem: ^2.0.28 => 2.0.28 gatsby-transformer-json: ^2.1.11 => 2.1.11 gatsby-transformer-remark: ^2.3.8 => 2.3.8 gatsby-transformer-sharp: ^2.1.17 => 2.1.17

gatsbyjs/gatsby

Answer questions andreivmaksimov

@pieh, thanks for advice, but it was not helpful (https://circleci.com/gh/hands-on-cloud/hands-on.cloud/23). I've already tried to play with GATSBY_CPU_COUNT={1,2} and --max-old-space-size={1024,2048,4096}.

I've also tried to use Node 12.2.0. Still getting this error.

This generate images part of deployment is crucial part of whole framework. With each blog post deployment it takes more resources because of growing images count. Right now I have 20 posts and 160 images with mean size 250k. Probably we have memory leak somewhere, but I'm not strong Node dev yet to prove\fix it by myself.

useful!

Related questions

Error: Cannot create as TypeComposer the following value: Date. hot 3
Importing Link from gatsby breaks Storybook hot 2
Loading chunks while a new release is deployed hot 2
Webpack error #98123 when running "gatsby develop" hot 2
gatsby build error #11328 A page component must export a React component for it to be valid. Please make sure this file exports a React component: /Users/tiagosanchez/Documents/Projects/personalBlog/node_modules/gatsby-plugin-offline/app-shell.js hot 2
[gatsby-telemetry] error: src/postinstall.js not found in Linux environments hot 2
IE11: Object not valid as React Child hot 2
[Help] I somehow managed to butcher my site's performance hot 2
Build gets stuck at Generating image thumbnails / Update schema on large sites hot 2
[gatsby-source-graphql] Shopify GraphQL Schema Error hot 2
UNHANDLED REJECTION Source and destination must not be the same. hot 2
gatsby-source-shopify unable to complete build hot 2
Gatsby's Use Of Polyfills and the 'Missing Resources for x' error hot 2
Autoprefixer "browsers" option is deprecated in v9, produces warnings hot 2
&#39;gatsby&#39; is not recognized as an internal or external command hot 2
Github User Rank List