I have a similar issue with a project I tried to deploy yesterday.
This is the error I got:
Error running command: Build script returned non-zero exit code: 139
The complete log is the following:
8:23:06 PM: Build ready to start
8:23:09 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
8:23:09 PM: build-image tag: v3.3.2
8:23:09 PM: buildbot version: f71b4aa1b1ebc2bff806e48691024e0ab383dc02
8:23:09 PM: Fetching cached dependencies
8:23:09 PM: Starting to download cache of 255.0KB
8:23:09 PM: Finished downloading cache in 104.754792ms
8:23:09 PM: Starting to extract cache
8:23:09 PM: Failed to fetch cache, continuing with build
8:23:09 PM: Starting to prepare the repo for build
8:23:09 PM: No cached dependencies found. Cloning fresh repo
8:23:09 PM: git clone https://github.com/joerlop/gatsby-intro
8:23:11 PM: Preparing Git Reference refs/heads/master
8:23:11 PM: Starting build script
8:23:11 PM: Installing dependencies
8:23:13 PM: Downloading and installing node v10.16.3...
8:23:13 PM: Downloading https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz...
8:23:14 PM: 0.0%
8:23:14 PM:
8:23:14 PM: 8.1%
8:23:14 PM:
############
8:23:14 PM: 17.0%
8:23:15 PM:
#####################
8:23:15 PM: 29.2%
8:23:15 PM:
################################
8:23:15 PM: 45.7%
8:23:15 PM:
################################################
8:23:15 PM: ####### 76.8%
8:23:15 PM:
################################################################
8:23:15 PM: ######## 100.0%
8:23:15 PM: Computing checksum with sha256sum
8:23:15 PM: Checksums matched!
8:23:18 PM: Now using node v10.16.3 (npm v6.9.0)
8:23:18 PM: Attempting ruby version 2.6.2, read from environment
8:23:20 PM: Using ruby version 2.6.2
8:23:20 PM: Using PHP version 5.6
8:23:20 PM: Started restoring cached node modules
8:23:20 PM: Finished restoring cached node modules
8:23:21 PM: Installing NPM modules using NPM version 6.9.0
8:24:01 PM: > [email protected] install /opt/build/repo/node_modules/sharp
8:24:01 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
8:24:02 PM: info
8:24:02 PM: sharp
8:24:02 PM: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz
8:24:04 PM: > [email protected] postinstall /opt/build/repo/node_modules/core-js
8:24:04 PM: > node scripts/postinstall || echo "ignore"
8:24:05 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
8:24:05 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
8:24:05 PM: > https://opencollective.com/core-js
8:24:05 PM: > https://www.patreon.com/zloirock
8:24:05 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
8:24:05 PM: > [email protected] postinstall /opt/build/repo/node_modules/core-js-pure
8:24:05 PM: > node scripts/postinstall || echo "ignore"
8:24:05 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
8:24:05 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
8:24:05 PM: > https://opencollective.com/core-js
8:24:05 PM: > https://www.patreon.com/zloirock
8:24:05 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
8:24:05 PM: > [email protected] postinstall /opt/build/repo/node_modules/gatsby-telemetry
8:24:05 PM: > node src/postinstall.js
8:24:05 PM: > [email protected] postinstall /opt/build/repo/node_modules/cwebp-bin
8:24:05 PM: > node lib/install.js
8:24:06 PM: โ cwebp pre-build test passed successfully
8:24:06 PM: > [email protected] postinstall /opt/build/repo/node_modules/mozjpeg
8:24:06 PM: > node lib/install.js
8:24:07 PM: โ mozjpeg pre-build test passed successfully
8:24:07 PM: > [email protected] postinstall /opt/build/repo/node_modules/pngquant-bin
8:24:07 PM: > node lib/install.js
8:24:07 PM: โ pngquant pre-build test passed successfully
8:24:10 PM: npm WARN optional
8:24:10 PM: SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
8:24:10 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
8:24:10 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/gatsby-source-filesystem/node_modules/fsevents):
8:24:10 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
8:24:10 PM: added 2028 packages from 1062 contributors and audited 28017 packages in 47.706s
8:24:10 PM: found 807 vulnerabilities (806 high, 1 critical)
8:24:10 PM: run npm audit fix to fix them, or npm audit for details
8:24:11 PM: NPM modules installed
8:24:11 PM: Started restoring cached go cache
8:24:11 PM: Finished restoring cached go cache
8:24:11 PM: unset GOOS;
8:24:11 PM: unset GOARCH;
8:24:11 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
8:24:11 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
8:24:11 PM: go version >&2;
8:24:11 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
8:24:11 PM: go version go1.12 linux/amd64
8:24:11 PM: Installing missing commands
8:24:11 PM: Verify run directory
8:24:11 PM: Executing user command: gatsby build
8:24:14 PM: success open and validate gatsby-configs โ 0.008 s
8:24:16 PM: success load plugins โ 1.859 s
8:24:16 PM: success onPreInit โ 0.006 s
8:24:16 PM: success delete html and css files from previous builds โ 0.006 s
8:24:16 PM: success initialize cache โ 0.007 s
8:24:16 PM: success copy gatsby files โ 0.028 s
8:24:16 PM: success onPreBootstrap โ 0.014 s
8:24:18 PM: success source and transform nodes โ 2.093 s
8:24:18 PM: success building schema โ 0.333 s
8:24:18 PM: success createPages โ 0.038 s
8:24:18 PM: success createPagesStatefully โ 0.089 s
8:24:18 PM: success onPreExtractQueries โ 0.004 s
8:24:18 PM: success update schema โ 0.035 s
8:24:18 PM: success extract queries from components โ 0.153 s
8:24:18 PM: success write out requires โ 0.005 s
8:24:18 PM: success write out redirect data โ 0.001 s
8:24:18 PM: success onPostBootstrap โ 0.001 s
8:24:18 PM: info bootstrap finished - 7.499 s
8:24:22 PM: success run static queries โ 3.284 s โ 4/4 1.22 queries/second
8:24:48 PM: success Building production JavaScript and CSS bundles โ 26.319 s
8:24:49 PM: success Rewriting compilation hashes โ 0.001 s
8:24:49 PM: success run page queries โ 0.021 s โ 5/5 255.21 queries/second
8:25:31 PM: success Building static HTML for pages โ 5.288 s โ 5/5 14.46 pages/second
8:25:31 PM: info Done building in 80.38 sec
8:25:33 PM: (sharp:1476): GLib-CRITICAL **: 01:25:33.723: g_hash_table_lookup: assertion 'hash_table != NULL' failed
8:25:33 PM: (sharp:1476): GLib-CRITICAL **: 01:25:33.723: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
8:25:33 PM: (sharp:1476): GLib-CRITICAL **: 01:25:33.723: g_hash_table_lookup: assertion 'hash_table != NULL' failed
8:25:36 PM: /usr/local/bin/build: line 60: 1476 Segmentation fault (core dumped) gatsby build
8:25:36 PM: Skipping functions preparation step: no functions directory set
8:25:36 PM: Caching artifacts
8:25:36 PM: Started saving node modules
8:25:36 PM: Finished saving node modules
8:25:36 PM: Started saving pip cache
8:25:36 PM: Finished saving pip cache
8:25:36 PM: Started saving emacs cask dependencies
8:25:36 PM: Finished saving emacs cask dependencies
8:25:36 PM: Started saving maven dependencies
8:25:36 PM: Finished saving maven dependencies
8:25:36 PM: Started saving boot dependencies
8:25:36 PM: Finished saving boot dependencies
8:25:36 PM: Started saving go dependencies
8:25:36 PM: Finished saving go dependencies
8:25:40 PM: Error running command: Build script returned non-zero exit code: 139
8:25:40 PM: Failing build: Failed to build site
8:25:40 PM: failed during stage 'building site': Build script returned non-zero exit code: 139
8:25:40 PM: Finished processing build request in 2m31.553944778s
Maybe similar to your problem?
In some logs in this issue I see the same sharp errors
So...
I ran npm install npm-check-updates
Then npm update
And re-deployed and it worked.
Thanks!
Most helpful comment
So...
I ran
npm install npm-check-updatesThen
npm updateAnd re-deployed and it worked.
Thanks!