Home
Support Forums

Gatsby Build Failed [Generic title]

I am getting an error on the build for this site and I can’t tell what the error is specifically. I am using Gatsby V3 on this site and I am using 1 plugin for cache.

I was getting the error command did not finish within the time limit

I am also now running the command npm run build || { cat /opt/buildhome/.npm/_logs/* ; sleep 30 ; false; } to get the logs.

Site Name: cranky-keller-cab144.netlify.app

Build Logs

4:31:11 PM: Build ready to start
4:31:13 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
4:31:13 PM: build-image tag: v3.7.6
4:31:13 PM: buildbot version: 5bd5f67b3a2fd548e6d0fc6a8ce4f41761563804
4:31:13 PM: Fetching cached dependencies
4:31:13 PM: Starting to download cache of 367.0MB
4:31:22 PM: Finished downloading cache in 9.57568953s
4:31:22 PM: Starting to extract cache
4:31:33 PM: Finished extracting cache in 10.649160643s
4:31:33 PM: Finished fetching cache in 20.306726364s
4:31:33 PM: Starting to prepare the repo for build
4:31:33 PM: Preparing Git Reference refs/heads/master
4:31:34 PM: Parsing package.json dependencies
4:31:34 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'frontend/public' versus 'public/' in the Netlify UI
4:31:34 PM: Starting build script
4:31:34 PM: Installing dependencies
4:31:35 PM: Python version set to 2.7
4:31:35 PM: Started restoring cached node version
4:31:37 PM: Finished restoring cached node version
4:31:38 PM: v12.18.0 is already installed.
4:31:39 PM: Now using node v12.18.0 (npm v6.14.4)
4:31:39 PM: Started restoring cached build plugins
4:31:39 PM: Finished restoring cached build plugins
4:31:39 PM: Attempting ruby version 2.7.1, read from environment
4:31:40 PM: Using ruby version 2.7.1
4:31:40 PM: Using PHP version 5.6
4:31:40 PM: Started restoring cached node modules
4:31:40 PM: Finished restoring cached node modules
4:31:41 PM: Started restoring cached go cache
4:31:41 PM: Finished restoring cached go cache
4:31:41 PM: go version go1.14.4 linux/amd64
4:31:41 PM: go version go1.14.4 linux/amd64
4:31:41 PM: Installing missing commands
4:31:41 PM: Verify run directory
4:31:41 PM: ​
4:31:41 PM: ────────────────────────────────────────────────────────────────
4:31:41 PM:   Netlify Build                                                 
4:31:41 PM: ────────────────────────────────────────────────────────────────
4:31:41 PM: ​
4:31:41 PM: ❯ Version
4:31:41 PM:   @netlify/build 11.31.1
4:31:41 PM: ​
4:31:41 PM: ❯ Flags
4:31:41 PM:   deployId: 60b94a1f14b1240090d0f14a
4:31:41 PM: ​
4:31:41 PM: ❯ Current directory
4:31:41 PM:   /opt/build/repo/frontend
4:31:41 PM: ​
4:31:41 PM: ❯ Config file
4:31:41 PM:   No config file was defined: using default values.
4:31:41 PM: ​
4:31:41 PM: ❯ Context
4:31:41 PM:   production
4:31:42 PM: ​
4:31:42 PM: ❯ Loading plugins
4:31:42 PM:    - netlify-plugin-gatsby-cache@0.3.0 from Netlify app
4:31:42 PM: ​
4:31:42 PM: ────────────────────────────────────────────────────────────────
4:31:42 PM:   1. onPreBuild command from netlify-plugin-gatsby-cache        
4:31:42 PM: ────────────────────────────────────────────────────────────────
4:31:42 PM: ​
4:31:45 PM: Found a Gatsby cache. We’re about to go FAST. ⚑️
4:31:45 PM: ​
4:31:45 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 3s)
4:31:45 PM: ​
4:31:45 PM: ────────────────────────────────────────────────────────────────
4:31:45 PM:   2. Build command from Netlify app                             
4:31:45 PM: ────────────────────────────────────────────────────────────────
4:31:45 PM: ​
4:31:45 PM: $ npm run build || { cat /opt/buildhome/.npm/_logs/* ; sleep 30 ; false; }
4:31:45 PM: > portillo-tenor@0.1.0 build /opt/build/repo/frontend
4:31:45 PM: > gatsby build
4:31:48 PM: info The following flags are active:
4:31:48 PM: - PRESERVE_WEBPACK_CACHE Β· (Umbrella Issue (https://gatsby.dev/cache-clearing-feedback)) Β· Use webpack's persistent caching and don't delete webpack's cache when changing gatsby-node.js & gatsby-config.js files.
4:31:48 PM: There are 3 other flags available that you might be interested in:
4:31:48 PM: - PRESERVE_FILE_DOWNLOAD_CACHE Β· (Umbrella Issue (https://gatsby.dev/cache-clearing-feedback)) Β· Don't delete the downloaded files cache when changing gatsby-node.js & gatsby-config.js files.
4:31:48 PM: - PARALLEL_SOURCING Β· EXPERIMENTAL Β· (Umbrella Issue (https://gatsby.dev/parallel-sourcing-feedback)) Β· Run all source plugins at the same time instead of serially. For sites with multiple source plugins, this can speedup sourcing and transforming considerably.
4:31:48 PM: - FUNCTIONS Β· EXPERIMENTAL Β· (Umbrella Issue (https://gatsby.dev/functions-feedback)) Β· Compile Serverless functions in your Gatsby project and write them to disk, ready to deploy to Gatsby Cloud
4:31:48 PM: success open and validate gatsby-configs - 0.031s
4:31:50 PM: success load plugins - 1.055s
4:31:50 PM: success onPreInit - 0.036s
4:31:50 PM: success initialize cache - 0.006s
4:31:50 PM: success copy gatsby files - 0.103s
4:31:50 PM: success onPreBootstrap - 0.025s
4:31:50 PM: success createSchemaCustomization - 0.006s
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/events with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/acclaims with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/carousels with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/videos with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/merches with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/photo-albums with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/banners with params {"_limit":1000}
4:31:50 PM: info Starting to fetch data from Strapi - http://13.65.120.79:1337/biography with params {"_limit":1000}
4:31:51 PM: error (node:1315) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
4:31:52 PM: success Fetched Strapi Data - 2.206s
4:31:52 PM: success Checking for changed pages - 0.000s
4:31:52 PM: success source and transform nodes - 2.310s
4:31:53 PM: success building schema - 1.038s
4:31:53 PM: success createPages - 0.000s
4:31:53 PM: success createPagesStatefully - 0.081s
4:31:53 PM: info Total nodes: 423, SitePage nodes: 7 (use --verbose for breakdown)
4:31:53 PM: success Checking for changed pages - 0.001s
4:31:53 PM: success Cleaning up stale page-data - 0.001s
4:31:54 PM: success update schema - 0.111s
4:31:54 PM: success onPreExtractQueries - 0.000s
4:31:56 PM: success extract queries from components - 2.088s
4:31:56 PM: success write out redirect data - 0.001s
4:31:56 PM: success Build manifest and related icons - 0.088s
4:31:56 PM: success onPostBootstrap - 0.154s
4:31:56 PM: info bootstrap finished - 10.725s
4:32:11 PM: warning Query takes too long:
4:32:11 PM: File path: /opt/build/repo/frontend/src/pages/media.js
4:33:01 PM: success run static queries - 65.502s - 6/6 0.09/s
4:34:29 PM: success write out requires - 87.507s
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:24919: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:25789: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:25789: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:28665: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:29606: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:29606: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:58940: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:59377: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:59937: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:61244: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:74405: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:75529: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:104333: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:98:104575: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:179:3: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:186:3: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:285:3: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:290:3: Error: Plugin name should be specified
4:35:57 PM: warning undefined
4:35:57 PM: Css Minimizer Plugin: postcss-svgo: /opt/build/repo/frontend/styles.3a32f8aca15401cc10ee.css:295:3: Error: Plugin name should be specified
4:35:57 PM: success Building production JavaScript and CSS bundles - 88.506s
4:35:58 PM: success Caching JavaScript and CSS webpack compilation - 4.390s
4:36:38 PM: Killed
4:36:38 PM: npm ERR! code ELIFECYCLE
4:36:38 PM: npm ERR! errno 137
4:36:38 PM: npm ERR! portillo-tenor@0.1.0 build: `gatsby build`
4:36:38 PM: npm ERR! Exit status 137
4:36:38 PM: npm ERR!
4:36:38 PM: npm ERR! Failed at the portillo-tenor@0.1.0 build script.
4:36:38 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
4:36:38 PM: npm ERR! A complete log of this run can be found in:
4:36:38 PM: npm ERR!     /opt/buildhome/.npm/_logs/2021-06-03T21_36_38_558Z-debug.log
4:36:38 PM: 0 info it worked if it ends with ok
4:36:38 PM: 1 verbose cli [
4:36:38 PM: 1 verbose cli   '/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node',
4:36:38 PM: 1 verbose cli   '/opt/buildhome/.nvm/versions/node/v12.18.0/bin/npm',
4:36:38 PM: 1 verbose cli   'run',
4:36:38 PM: 1 verbose cli   'build'
4:36:38 PM: 1 verbose cli ]
4:36:38 PM: 2 info using npm@6.14.4
4:36:38 PM: 3 info using node@v12.18.0
4:36:38 PM: 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
4:36:38 PM: 5 info lifecycle portillo-tenor@0.1.0~prebuild: portillo-tenor@0.1.0
4:36:38 PM: 6 info lifecycle portillo-tenor@0.1.0~build: portillo-tenor@0.1.0
4:36:38 PM: 7 verbose lifecycle portillo-tenor@0.1.0~build: unsafe-perm in lifecycle true
4:36:38 PM: 8 verbose lifecycle portillo-tenor@0.1.0~build: PATH: /opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/build/repo/frontend/node_modules/.bin:/opt/build/repo/frontend/node_modules/.bin:/opt/build/repo/node_modules/.bin:/opt/build/node_modules/.bin:/opt/node_modules/.bin:/node_modules/.bin:/opt/buildhome/.nvm/versions/node/v12.18.0/bin:/opt/buildhome/.gimme/versions/go1.14.4.linux.amd64/bin:/opt/build/repo/frontend/node_modules/.bin:/opt/buildhome/.rvm/gems/ruby-2.7.1/bin:/opt/buildhome/.rvm/gems/ruby-2.7.1@global/bin:/opt/buildhome/.rvm/rubies/ruby-2.7.1/bin:/opt/buildhome/.rvm/bin:/opt/buildhome/.nvm/versions/node/v12.18.0/bin:/opt/buildhome/python2.7/bin:/home/linuxbrew/.linuxbrew/bin:/opt/buildhome/.swiftenv/bin:/opt/buildhome/.swiftenv/shims:/opt/buildhome/.php:/opt/buildhome/.binrc/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/buildhome/.cask/bin:/opt/buildhome/.gimme/bin:/opt/buildhome/.dotnet/tools:/opt/buildhome/.dotnet:/opt/buildhome/.cargo/bin
4:36:38 PM: 9 verbose lifecycle portillo-tenor@0.1.0~build: CWD: /opt/build/repo/frontend
4:36:38 PM: 10 silly lifecycle portillo-tenor@0.1.0~build: Args: [ '-c', 'gatsby build' ]
4:36:38 PM: 11 silly lifecycle portillo-tenor@0.1.0~build: Returned: code: 137  signal: null
4:36:38 PM: 12 info lifecycle portillo-tenor@0.1.0~build: Failed to exec build script
4:36:38 PM: 13 verbose stack Error: portillo-tenor@0.1.0 build: `gatsby build`
4:36:38 PM: 13 verbose stack Exit status 137
4:36:38 PM: 13 verbose stack     at EventEmitter.<anonymous> (/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
4:36:38 PM: 13 verbose stack     at EventEmitter.emit (events.js:315:20)
4:36:38 PM: 13 verbose stack     at ChildProcess.<anonymous> (/opt/buildhome/.nvm/versions/node/v12.18.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
4:36:38 PM: 13 verbose stack     at ChildProcess.emit (events.js:315:20)
4:36:38 PM: 13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
4:36:38 PM: 13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
4:36:38 PM: 14 verbose pkgid portillo-tenor@0.1.0
4:36:38 PM: 15 verbose cwd /opt/build/repo/frontend
4:36:38 PM: 16 verbose Linux 4.19.167+
4:36:38 PM: 17 verbose argv "/opt/buildhome/.nvm/versions/node/v12.18.0/bin/node" "/opt/buildhome/.nvm/versions/node/v12.18.0/bin/npm" "run" "build"
4:36:38 PM: 18 verbose node v12.18.0
4:36:38 PM: 19 verbose npm  v6.14.4
4:36:38 PM: 20 error code ELIFECYCLE
4:36:38 PM: 21 error errno 137
4:36:38 PM: 22 error portillo-tenor@0.1.0 build: `gatsby build`
4:36:38 PM: 22 error Exit status 137
4:36:38 PM: 23 error Failed at the portillo-tenor@0.1.0 build script.
4:36:38 PM: 23 error This is probably not a problem with npm. There is likely additional logging output above.
4:36:38 PM: 24 verbose exit [ 137, true ]
4:37:08 PM: ​
4:37:08 PM: ────────────────────────────────────────────────────────────────
4:37:08 PM:   "build.command" failed                                        
4:37:08 PM: ────────────────────────────────────────────────────────────────
4:37:08 PM: ​
4:37:08 PM:   Error message
4:37:08 PM:   Command failed with exit code 1: npm run build || { cat /opt/buildhome/.npm/_logs/* ; sleep 30 ; false; }
​
  Error location
  In Build command from Netlify app:
  npm run build || { cat /opt/buildhome/.npm/_logs/* ; sleep 30 ; false; }
​
  Resolved config
  build:
4:37:08 PM:     base: /opt/build/repo/frontend
4:37:09 PM:     command: npm run build || { cat /opt/buildhome/.npm/_logs/* ; sleep 30 ; false; }
    commandOrigin: ui
    publish: /opt/build/repo/frontend/public
  functions:
    '*': {}
  plugins:
    - inputs: {}
      origin: ui
      package: netlify-plugin-gatsby-cache
Caching artifacts
4:37:09 PM: Started saving node modules
4:37:09 PM: Finished saving node modules
4:37:09 PM: Started saving build plugins
4:37:09 PM: Finished saving build plugins
4:37:09 PM: Started saving pip cache
4:37:09 PM: Finished saving pip cache
4:37:09 PM: Started saving emacs cask dependencies
4:37:09 PM: Finished saving emacs cask dependencies
4:37:09 PM: Started saving maven dependencies
4:37:09 PM: Finished saving maven dependencies
4:37:09 PM: Started saving boot dependencies
4:37:09 PM: Finished saving boot dependencies
4:37:09 PM: Started saving rust rustup cache
4:37:09 PM: Finished saving rust rustup cache
4:37:09 PM: Started saving go dependencies
4:37:09 PM: Finished saving go dependencies
4:37:09 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:37:09 PM: Creating deploy upload records
4:37:09 PM: Failing build: Failed to build site
4:37:09 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:37:09 PM: Finished processing build request in 5m56.432509122s
1 Like

hi there @pcast01 - are you able to get the site to build without the plugin? your build seems to be timing out after 5 minutes, which should actually be fine, as our default build time is 15 minutes, which should be sufficient unless you have a very large site. how big is your site?

Not big at all. Not sure what the problem could be. Me and another have been trying to troubleshoot this issue with no luck yet.

Hi there, @pcast01 :wave:

Thanks for your patience on this thread. Are you still encountering this? Let us know if you are, and one of our Gatsby pros to dig in further. Additionally, if you could share your repo here that would be beneficial!

Thank you :slight_smile:

Hi @hillary, thanks for your response. I am Paul’s business partner and am familiar with the project.

We are still experiencing issues with the builds. We are using Gatsby 3 on this project and pairing it with Strapi as a CMS.

Here is the repo link from GitHub:
https://github.com/sacodersunited/portillo-tenor

Thanks for offering to help and hope the Gatsby experts can offer some guidance!

@jonsully is the one to go to with this topic. I’ll tag him in this now and we shall await his response :grinning:

1 Like

Greetings :wave:t2:

@fpigeonjr / @pcast01 β€” could you try using a build command of just npm run build instead of all the extra logging stuff? Curious if that extra command chaining is causing issues in your build.

–
Jon

1 Like

@fpigeonjr, let us know if @jonsully’s suggestion worked!

Thanks @jonsully and we are running npm run build. I am not aware of how to reduce the logs since it is from the gatsby-plugin-sass working on the bootstrap-sass.

Please advise if there is a way to minimize the warnings. I’d prefer them not being there too.

As an aside, we ran this on a competitor’s cloud product and it is also failing saying that we going over the memory allowance on the server.

hey there, @fpigeonjr :wave:

Thanks for following up. I see that you are discussing this site in two threads. Let’s continue the conversation over here, as I have looped in one of our Gatsby experts and they have asked some further questions.

In general, we encourage folks to keep questions in one thread in order to streamline support. Thanks for understanding!

Sounds good @lhillary86 . Thanks for your support.