React/Gatsby starter deployment error on run build: "Failed during stage 'building site': build script returned non-zero exit code: 137"

I’ve just built a new site using a Gatsby starter, and it’s supposed to deploy to “https://www.dianemarie.dev.” I previously had a different GitHub repo linked to this site for automatic deployment, but I’ve built the new site in a different repo that I’ve now linked to this Netlify project.

The build log will get stuck in an infinite loop trying to run “npm run build.” I’ve messed around with all of the deployment settings, including changing the build command to “CI= npm run build” and setting the environment variable to “CI = true” and then “CI = false.” I haven’t had any luck. Below is the full build log, but it’s long…there are more than 6000 lines of code. Any help is appreciated!

Build Log:
Loading

The build log didn’t load in the first post, so here’s what it looks like up until the first infinite loop:

11:55:02 AM: 1. @netlify/plugin-gatsby (onPreBuild event)
11:55:02 AM: ────────────────────────────────────────────────────────────────
11:55:02 AM: ​
11:55:02 AM: No Gatsby cache found. Building fresh.
11:55:02 AM: Add gatsby-plugin-netlify to gatsby-config.js if you would like to support Gatsby redirects. :tada:
11:55:02 AM: ​
11:55:02 AM: (@netlify/plugin-gatsby onPreBuild completed in 13ms)
11:55:02 AM: ​
11:55:02 AM: ────────────────────────────────────────────────────────────────
11:55:02 AM: 2. Build command from Netlify app
11:55:02 AM: ────────────────────────────────────────────────────────────────
11:55:02 AM: ​
11:55:02 AM: $ npm run build
11:55:02 AM: > jodie@0.1.5 build /opt/build/repo
11:55:02 AM: > npm run build
11:55:03 AM: > jodie@0.1.5 build /opt/build/repo
11:55:03 AM: > npm run build
11:55:03 AM: > jodie@0.1.5 build /opt/build/repo
11:55:03 AM: > npm run build
11:55:03 AM: > jodie@0.1.5 build /opt/build/repo
11:55:03 AM: > npm run build
11:55:03 AM: > jodie@0.1.5 build /opt/build/repo
11:55:03 AM: > npm run build
11:55:04 AM: > jodie@0.1.5 build /opt/build/repo
11:55:04 AM: > npm run build
11:55:04 AM: > jodie@0.1.5 build /opt/build/repo
11:55:04 AM: > npm run build
11:55:04 AM: > jodie@0.1.5 build /opt/build/repo
11:55:04 AM: > npm run build
11:55:04 AM: > jodie@0.1.5 build /opt/build/repo
11:55:04 AM: > npm run build
11:55:05 AM: > jodie@0.1.5 build /opt/build/repo
11:55:05 AM: > npm run build
11:55:05 AM: > jodie@0.1.5 build /opt/build/repo
11:55:05 AM: > npm run build
11:55:05 AM: > jodie@0.1.5 build /opt/build/repo
11:55:05 AM: > npm run build
11:55:05 AM: > jodie@0.1.5 build /opt/build/repo
11:55:05 AM: > npm run build

Once that runs for awhile, it picks back up here and hits another loop:
11:57:25 AM: > npm run build

11:57:34 AM: /opt/build-bin/build: line 92: 1598 Killed FORCE_COLOR=1 “$netlify_build_node_bin” “$netlify_build_bin” --cwd="$repository_root" --repositoryRoot="$repository_root" --branch="$branch" --siteId="$site_id" --defaultConfig="$default_config" --baseRelDir="$base_rel_dir" --context="$context" --node-path="$user_node_path" --cachedConfigPath="$cached_netlify_build_config_file" --api-host="$netlify_endpoint" --token="$netlify_token" --build-id="$BUILD_ID" --deploy-id="$DEPLOY_ID" --mode=“buildbot” --telemetry="$build_telemetry" --send-status --save-config --statsd.host="$STATSD_HOST" --statsd.port="$STATSD_PORT" --functions-dist-dir="$functions_dist_dir" --cache-dir="$cache_dir" --buildbot-server-socket="$buildbot_server_socket" --framework="$framework" --feature-flags="$feature_flags" --testOpts.silentLingeringProcesses="$SILENT_LINGERING_PROCESSES"

11:57:34 AM: Caching artifacts

11:57:34 AM: Started saving node modules

11:57:34 AM: Finished saving node modules

11:57:34 AM: Started saving build plugins

11:57:34 AM: Finished saving build plugins

11:57:34 AM: Started saving pip cache

11:57:34 AM: Finished saving pip cache

11:57:34 AM: Started saving emacs cask dependencies

11:57:34 AM: Finished saving emacs cask dependencies

11:57:34 AM: Started saving maven dependencies

11:57:34 AM: Finished saving maven dependencies

11:57:34 AM: Started saving boot dependencies

11:57:34 AM: Finished saving boot dependencies

11:57:34 AM: Started saving rust rustup cache

11:57:34 AM: Finished saving rust rustup cache

11:57:34 AM: Started saving go dependencies

11:57:34 AM: Finished saving go dependencies

11:57:34 AM: > jodie@0.1.5 build /opt/build/repo

11:57:34 AM: > npm run build

11:57:34 AM: > jodie@0.1.5 build /opt/build/repo

11:57:34 AM: > npm run build

11:57:35 AM: > jodie@0.1.5 build /opt/build/repo

11:57:35 AM: > npm run build

11:57:35 AM: > jodie@0.1.5 build /opt/build/repo

11:57:35 AM: > npm run build

11:57:35 AM: > jodie@0.1.5 build /opt/build/repo

11:57:35 AM: > npm run build

11:57:36 AM: npm WARN lifecycle npm is using /opt/buildhome/.nvm/versions/node/v12.18.0/bin/node but there is no node binary in the current PATH. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.

11:57:36 AM: > jodie@0.1.5 build /opt/build/repo

11:57:36 AM: > npm run build

11:57:36 AM: sh: 1: npm: not found

11:57:36 AM: npm ERR! code ELIFECYCLE

11:57:36 AM: npm ERR! syscall spawn

11:57:36 AM: npm ERR! file sh

11:57:36 AM: npm ERR! errno ENOENT

11:57:36 AM: npm ERR! jodie@0.1.5 build: npm run build

11:57:36 AM: npm ERR! spawn ENOENT

11:57:36 AM: npm ERR!

11:57:36 AM: npm ERR! Failed at the jodie@0.1.5 build script.

11:57:36 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

11:57:36 AM: npm WARN Local package.json exists, but node_modules missing, did you mean to install?

11:57:36 AM: npm ERR! A complete log of this run can be found in:

11:57:36 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-21T19_57_36_147Z-debug.log

11:57:36 AM: npm ERR! code ELIFECYCLE

11:57:36 AM: npm ERR! errno 1

11:57:36 AM: npm ERR! jodie@0.1.5 build: npm run build

11:57:36 AM: npm ERR! Exit status 1

11:57:36 AM: npm ERR!

11:57:36 AM: npm ERR! Failed at the jodie@0.1.5 build script.

11:57:36 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

11:57:36 AM: npm WARN Local package.json exists, but node_modules missing, did you mean to install?

11:57:36 AM: npm ERR! A complete log of this run can be found in:

11:57:36 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-21T19_57_36_160Z-debug.log

11:57:36 AM: npm ERR! code ELIFECYCLE

11:57:36 AM: npm ERR! errno 1

11:57:36 AM: npm ERR! jodie@0.1.5 build: npm run build

11:57:36 AM: npm ERR! Exit status 1

11:57:36 AM: npm ERR!

11:57:36 AM: npm ERR! Failed at the jodie@0.1.5 build script.

11:57:36 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

11:57:36 AM: npm WARN Local package.json exists, but node_modules missing, did you mean to install?

11:57:36 AM: npm ERR! A complete log of this run can be found in:

11:57:36 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-21T19_57_36_171Z-debug.log

11:57:36 AM: npm ERR! code ELIFECYCLE

11:57:36 AM: npm ERR! errno 1

11:57:36 AM: npm ERR! jodie@0.1.5 build: npm run build

11:57:36 AM: npm ERR! Exit status 1

11:57:36 AM: npm ERR!

11:57:36 AM: npm ERR! Failed at the jodie@0.1.5 build script.

11:57:36 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

11:57:36 AM: npm WARN Local package.json exists, but node_modules missing, did you mean to install?

11:57:36 AM: npm ERR! A complete log of this run can be found in:

11:57:36 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-21T19_57_36_190Z-debug.log

11:57:36 AM: npm ERR! code ELIFECYCLE

11:57:36 AM: npm ERR! errno 1

11:57:36 AM: npm ERR! jodie@0.1.5 build: npm run build

11:57:36 AM: npm ERR! Exit status 1

11:57:36 AM: npm ERR!

11:57:36 AM: npm ERR! Failed at the jodie@0.1.5 build script.

11:57:36 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

11:57:36 AM: npm WARN Local package.json exists, but node_modules missing, did you mean to install?

11:57:36 AM: npm ERR! A complete log of this run can be found in:

11:57:36 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-21T19_57_36_202Z-debug.log

11:57:36 AM: npm ERR! code ELIFECYCLE

11:57:36 AM: npm ERR! errno 1

11:57:36 AM: npm ERR! jodie@0.1.5 build: npm run build

11:57:36 AM: npm ERR! Exit status 1

And this is the end of the log:
11:57:53 AM: npm ERR! Failed at the jodie@0.1.5 build script.

11:57:53 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

11:57:53 AM: npm WARN Local package.json exists, but node_modules missing, did you mean to install?

11:57:53 AM: npm ERR! A complete log of this run can be found in:

11:57:53 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-01-21T19_57_45_655Z-debug.log

11:57:53 AM: Error running command: Build script returned non-zero exit code: 137

11:57:53 AM: Failing build: Failed to build site

11:57:53 AM: Finished processing build request in 3m59.019452786s

hi there, can you share your package.json file please?

Sure thing! Here it is:

“private”: true,
“name”: “jodie”,
“description”: “Image-heavy photography portfolio with colorful accents & customizable pages. Includes adaptive image grids powered by CSS grid and automatic image integration into projects.”,
“version”: “0.1.5”,
“author”: “LekoArts hello@lekoarts.de”,
“license”: “0BSD”,
“starter-name”: “gatsby-starter-portfolio-jodie”,
“scripts”: {
“build”: “npm run build”,
“develop”: “gatsby develop”,
“develop:cypress”: “cross-env CYPRESS_SUPPORT=y yarn develop”,
“build:cypress”: “cross-env CYPRESS_SUPPORT=y yarn build”,
“start”: “gatsby develop”,
“serve”: “gatsby serve”,
“clean”: “gatsby clean”
},
“dependencies”: {
@lekoarts/gatsby-theme-jodie”: “^3.0.0”,
“gatsby”: “^4.5.4”,
“gatsby-omni-font-loader”: “^1.3.1”,
“gatsby-plugin-gatsby-cloud”: “^4.0.0”,
“gatsby-plugin-manifest”: “^4.0.0”,
“gatsby-plugin-sitemap”: “^5.0.0”,
“gatsby-plugin-webpack-bundle-analyser-v2”: “^1.1.22”,
“react”: “^17.0.2”,
“react-dom”: “^17.0.2”
},
“devDependencies”: {
“cross-env”: “^7.0.3”
}
}

hey there diane,

the problem can be seen in the code above:

when you are telling our robots to “npm run build” in the settings you entered in our UI they go and find the command listed in your package.json:

So far so good, but that command ALSO tells the robots to “run build” so you get stuck in an infinite loop, because one command is duplicating the other.

I’m not a gatsby expert so I’m not sure what the build command should be exactly, but you’ll need to correct it in your package.json. it’s probably something like “gatsby build” or similar.

Ahh, thank you! I fixed it, and that’s stopped the infinite loop. So now, here’s an updated build log that should be a little more helpful to debug:

3:10:23 PM: Build ready to start
3:10:25 PM: build-image version: 3fa6e2800752667ac56af498951f923e208f7404 (xenial)
3:10:25 PM: build-image tag: v3.10.3
3:10:25 PM: buildbot version: 8cd320132979d1a1a502e85e77b47b97cc7d659f
3:10:25 PM: Building without cache
3:10:25 PM: Starting to prepare the repo for build
3:10:26 PM: No cached dependencies found. Cloning fresh repo
3:10:26 PM: git clone https://github.com/dianestephani/portfolio-two
3:10:28 PM: Preparing Git Reference refs/heads/master
3:10:28 PM: Parsing package.json dependencies
3:10:29 PM: Starting build script
3:10:29 PM: Installing dependencies
3:10:29 PM: Python version set to 2.7
3:10:31 PM: v12.18.0 is already installed.
3:10:31 PM: Now using node v12.18.0 (npm v6.14.4)
3:10:32 PM: Started restoring cached build plugins
3:10:32 PM: Finished restoring cached build plugins
3:10:32 PM: Attempting ruby version 2.7.2, read from environment
3:10:33 PM: Using ruby version 2.7.2
3:10:34 PM: Using PHP version 5.6
3:10:34 PM: Started restoring cached node modules
3:10:34 PM: Finished restoring cached node modules
3:10:34 PM: Installing NPM modules using NPM version 6.14.4
3:11:15 PM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I’ll try to do my best with it!
3:11:15 PM: > msgpackr-extract@1.0.16 install /opt/build/repo/node_modules/msgpackr-extract
3:11:15 PM: > node-gyp-build
3:11:16 PM: > lmdb-store@1.6.14 install /opt/build/repo/node_modules/lmdb-store
3:11:16 PM: > node-gyp-build
3:11:16 PM: > sharp@0.29.3 install /opt/build/repo/node_modules/sharp
3:11:16 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
3:11:19 PM: sharp: Downloading
3:11:24 PM: > core-js@3.20.3 postinstall /opt/build/repo/node_modules/core-js
3:11:24 PM: > node -e “try{require(‘./postinstall’)}catch(e){}”
3:11:24 PM: Thank you for using core-js ( ) for polyfilling JavaScript standard library!
3:11:24 PM: The project needs your help! Please consider supporting of core-js:
3:11:24 PM: > core-js - Open Collective
3:11:24 PM: > https://patreon.com/zloirock
3:11:24 PM: > PayPal.Me
3:11:24 PM: > bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
3:11:24 PM: Also, the author of core-js ( ) is looking for a good job -)
3:11:24 PM: > core-js-pure@3.20.3 postinstall /opt/build/repo/node_modules/core-js-pure
3:11:24 PM: > node -e “try{require(‘./postinstall’)}catch(e){}”
3:11:25 PM: > gatsby-telemetry@3.5.2 postinstall /opt/build/repo/node_modules/gatsby-telemetry
3:11:25 PM: > node src/postinstall.js || true
3:11:26 PM: > gatsby-cli@4.5.2 postinstall
3:11:26 PM: > node scripts/postinstall.js
3:11:26 PM: > gatsby@4.5.4 postinstall
3:11:26 PM: > node scripts/postinstall.js
3:11:29 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
3:11:29 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
3:11:29 PM: added 1913 packages from 1037 contributors and audited 1913 packages in 53.838s
3:11:31 PM: 240 packages are looking for funding
3:11:31 PM: run npm fund for details
3:11:31 PM: found 17 vulnerabilities (11 moderate, 5 high, 1 critical)
3:11:31 PM: run npm audit fix to fix them, or npm audit for details
3:11:31 PM: NPM modules installed
3:11:31 PM: Started restoring cached go cache
3:11:31 PM: Finished restoring cached go cache
3:11:31 PM: go version go1.14.4 linux/amd64
3:11:31 PM: go version go1.14.4 linux/amd64
3:11:31 PM: Installing missing commands
3:11:31 PM: Verify run directory
3:11:33 PM: ​
3:11:33 PM: ────────────────────────────────────────────────────────────────
3:11:33 PM: Netlify Build
3:11:33 PM: ────────────────────────────────────────────────────────────────
3:11:33 PM: ​
3:11:33 PM: ❯ Version
3:11:33 PM: @netlify/build 26.2.0
3:11:33 PM: ​
3:11:33 PM: ❯ Flags
3:11:33 PM: baseRelDir: true
3:11:33 PM: buildId: 61eb3d5f83f67100570b43e9
3:11:33 PM: deployId: 61eb3d5f83f67100570b43eb
3:11:33 PM: ​
3:11:33 PM: ❯ Current directory
3:11:33 PM: /opt/build/repo
3:11:33 PM: ​
3:11:33 PM: ❯ Config file
3:11:33 PM: No config file was defined: using default values.
3:11:33 PM: ​
3:11:33 PM: ❯ Context
3:11:33 PM: production
3:11:33 PM: ​
3:11:33 PM: ❯ Installing plugins
3:11:33 PM: - @netlify/plugin-gatsby@1.0.3
3:11:45 PM: ​
3:11:45 PM: ❯ Loading plugins
3:11:45 PM: - @netlify/plugin-gatsby@1.0.3 from Netlify app
3:11:47 PM: ​
3:11:47 PM: ────────────────────────────────────────────────────────────────
3:11:47 PM: 1. @netlify/plugin-gatsby (onPreBuild event)
3:11:47 PM: ────────────────────────────────────────────────────────────────
3:11:47 PM: ​
3:11:47 PM: No Gatsby cache found. Building fresh.
3:11:47 PM: Add gatsby-plugin-netlify to gatsby-config.js if you would like to support Gatsby redirects. :tada:
3:11:47 PM: ​
3:11:47 PM: (@netlify/plugin-gatsby onPreBuild completed in 13ms)
3:11:47 PM: ​
3:11:47 PM: ────────────────────────────────────────────────────────────────
3:11:47 PM: 2. Build command from Netlify app
3:11:47 PM: ────────────────────────────────────────────────────────────────
3:11:47 PM: ​
3:11:47 PM: $ npm run build
3:11:47 PM: > jodie@0.1.5 build /opt/build/repo
3:11:47 PM: > gatsby build
3:11:48 PM: error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0).
3:11:48 PM: Upgrade Node to the latest stable release:
3:11:48 PM: npm ERR! code ELIFECYCLE
3:11:48 PM: npm ERR! errno 1
3:11:48 PM: npm ERR! jodie@0.1.5 build: gatsby build
3:11:48 PM: npm ERR! Exit status 1
3:11:48 PM: npm ERR!
3:11:48 PM: npm ERR! Failed at the jodie@0.1.5 build script.
3:11:48 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:11:48 PM: npm ERR! A complete log of this run can be found in:
3:11:48 PM: npm ERR!
3:11:48 PM: ​
3:11:48 PM: ────────────────────────────────────────────────────────────────
3:11:48 PM: “build.command” failed
3:11:48 PM: ────────────────────────────────────────────────────────────────
3:11:48 PM: ​
3:11:48 PM: Error message
3:11:48 PM: Command failed with exit code 1: npm run build
3:11:48 PM: ​
3:11:48 PM: Error location
3:11:48 PM: In Build command from Netlify app:
3:11:48 PM: npm run build
3:11:48 PM: ​
3:11:48 PM: Resolved config
3:11:48 PM: build:
3:11:48 PM: command: npm run build
3:11:48 PM: commandOrigin: ui
3:11:48 PM: environment:
3:11:48 PM: - CI
3:11:48 PM: publish: /opt/build/repo/build
3:11:48 PM: publishOrigin: ui
3:11:48 PM: plugins:
3:11:48 PM: - inputs: {}
3:11:48 PM: origin: ui
3:11:48 PM: package: ‘@netlify/plugin-gatsby’
3:11:48 PM: Caching artifacts
3:11:48 PM: Started saving node modules
3:11:48 PM: Finished saving node modules
3:11:48 PM: Started saving build plugins
3:11:48 PM: Finished saving build plugins
3:11:48 PM: Started saving pip cache
3:11:48 PM: Finished saving pip cache
3:11:48 PM: Started saving emacs cask dependencies
3:11:48 PM: Finished saving emacs cask dependencies
3:11:48 PM: Started saving maven dependencies
3:11:48 PM: Finished saving maven dependencies
3:11:48 PM: Started saving boot dependencies
3:11:49 PM: Finished saving boot dependencies
3:11:49 PM: Started saving rust rustup cache
3:11:49 PM: Finished saving rust rustup cache
3:11:49 PM: Started saving go dependencies
3:11:49 PM: Finished saving go dependencies
3:11:51 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:11:51 PM: Creating deploy upload records
3:11:51 PM: Failing build: Failed to build site
3:11:51 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
3:11:51 PM: Finished processing build request in 1m26.576836324s

1 Like

great. now we are dealing with a slightly more pedestrian node bug.

the error is described above - the software you are trying to use needs a certain version of node, but by default netlify’s robots install an older version.

you’ll need to tell our bots to install the version that gatsby is asking for. docs here:

try and see if you can get this to work! we’ll be here if you need us.

I’m so close! I almost got it to work! I set the latest node version as an environment variable, so I’ve made progress. I’m still running into more errors though. I tried changing my build command and adding “CI= npm run build” but no luck. I’m about to try uninstalling Gatsby and reinstalling the older version it needs. Outside of that, I’m not sure what else to do.

────────────────────────────────────────────────────────────────
11:42:22 PM: ​
11:42:22 PM: $ npm run build
11:42:22 PM: > jodie@0.1.5 build
11:42:22 PM: > gatsby build
11:42:25 PM: warning Plugin gatsby-plugin-theme-ui is not compatible with your gatsby version 4.5.4 - It requires gatsby@^2.0.0 || ^3.0.0
11:42:25 PM: warning Plugin gatsby-plugin-theme-ui is not compatible with your gatsby version 4.5.4 - It requires gatsby@^2.0.0 || ^3.0.0
11:42:26 PM: success open and validate gatsby-configs, load plugins - 1.214s
11:42:26 PM: success onPreInit - 0.011s
11:42:26 PM: success initialize cache - 0.225s
11:42:26 PM: success copy gatsby files - 0.080s
11:42:26 PM: success Compiling Gatsby Functions - 0.310s
11:42:26 PM: success onPreBootstrap - 0.327s
11:42:26 PM: success createSchemaCustomization - 0.014s
11:42:27 PM: success Checking for changed pages - 0.000s
11:42:27 PM: success source and transform nodes - 1.000s
11:42:28 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
11:42:31 PM: success building schema - 3.601s
11:42:32 PM: success createPages - 0.694s
11:42:32 PM: success createPagesStatefully - 0.278s
11:42:32 PM: info Total nodes: 99, SitePage nodes: 11 (use --verbose for breakdown)
11:42:32 PM: success Checking for changed pages - 0.000s
11:42:32 PM: success onPreExtractQueries - 0.000s
11:42:38 PM: success extract queries from components - 6.587s
11:42:38 PM: success write out redirect data - 0.009s
11:42:38 PM: success Build manifest and related icons - 0.001s
11:42:38 PM: success onPostBootstrap - 0.004s
11:42:38 PM: info bootstrap finished - 16.543s
11:42:38 PM: success write out requires - 0.006s
11:43:04 PM: success Building production JavaScript and CSS bundles - 25.498s
11:43:25 PM: success Building HTML renderer - 20.679s
11:43:25 PM: success Execute page configs - 0.132s
11:43:25 PM: success Caching Webpack compilations - 0.001s
11:43:26 PM: error There was an error in your GraphQL query:
11:43:26 PM: Cannot return null for non-nullable field MdxProject.cover.
11:43:26 PM: The field “MdxProject.cover.” was explicitly defined as non-nullable via the schema customization API (by yourself or a plugin/theme). This means that this field is not optional and you have to define a value. If this is not your desired behavior and you defined the schema yourself, go to “createTypes” in gatsby-node.js. If you’re using a plugin/theme, you can learn more here on how to fix field types:Customizing the GraphQL Schema | Gatsby
11:43:26 PM: 1 | query pageOptbuildreponodeModulesLekoartsgatsbyThemeJodieCoresrctemplatesprojectQueryTsx3371708240($slug: String!, $formatString: String!, $relativeDirectory: String!) {
11:43:26 PM: 2 | project(slug: {eq: $slug}) {
11:43:26 PM: 3 | body
11:43:26 PM: 4 | excerpt
11:43:26 PM: 5 | color
11:43:26 PM: 6 | date(formatString: $formatString)
11:43:26 PM: 7 | slug
11:43:26 PM: 8 | title
11:43:26 PM: 9 | shortTitle
11:43:26 PM: 10 | category
11:43:26 PM: > 11 | cover {
11:43:26 PM: | ^
11:43:26 PM: 12 | childImageSharp {
11:43:26 PM: 13 | resize(width: 1200, quality: 85) {
11:43:26 PM: 14 | src
11:43:26 PM: 15 | }
11:43:26 PM: 16 | }
11:43:26 PM: 17 | }
11:43:26 PM: 18 | }
11:43:26 PM: 19 | images: allFile(
11:43:26 PM: 20 | filter: {relativeDirectory: {eq: $relativeDirectory}, extension: {regex: “/(jpg)|(png)|(tif)|(tiff)|(webp)|(jpeg)/”}}
11:43:26 PM: 21 | ) {
11:43:26 PM: File path: /opt/build/repo/node_modules/@lekoarts/gatsby-theme-jodie-core/src/templates/project-query.tsx
11:43:26 PM: Url path: /color-in-all-its-glory
11:43:26 PM: Plugin: none
11:43:26 PM: error An error occurred during parallel query running.
11:43:26 PM: Go here for troubleshooting tips: Parallel Query Running · Discussion #32389 · gatsbyjs/gatsby · GitHub
11:43:26 PM:
11:43:26 PM:
11:43:26 PM: Error: Worker exited before finishing task
11:43:26 PM:
11:43:26 PM: - index.js:112 ChildProcess.
11:43:26 PM: [repo]/[gatsby-worker]/dist/index.js:112:45
11:43:26 PM:
11:43:26 PM: - node:events:390 ChildProcess.emit
11:43:26 PM: node:events:390:28
11:43:26 PM:
11:43:26 PM: - child_process:290 Process.ChildProcess._handle.onexit
11:43:26 PM: node:internal/child_process:290:12
11:43:26 PM:
11:43:26 PM:
11:43:26 PM: not finished run queries in workers - 0.959s
11:43:26 PM: not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 0.116s
11:43:26 PM: ​
11:43:26 PM: ────────────────────────────────────────────────────────────────
11:43:26 PM: “build.command” failed
11:43:26 PM: ────────────────────────────────────────────────────────────────
11:43:26 PM: ​
11:43:26 PM: Error message
11:43:26 PM: Command failed with exit code 1: npm run build
11:43:26 PM: ​
11:43:26 PM: Error location
11:43:26 PM: In Build command from Netlify app:
11:43:26 PM: npm run build
11:43:26 PM: ​
11:43:26 PM: Resolved config
11:43:26 PM: build:
11:43:26 PM: command: npm run build
11:43:26 PM: commandOrigin: ui
11:43:26 PM: environment:
11:43:26 PM: - NODE_VERSION
11:43:26 PM: publish: /opt/build/repo/build
11:43:26 PM: publishOrigin: ui
11:43:26 PM: plugins:
11:43:26 PM: - inputs: {}
11:43:26 PM: origin: ui
11:43:26 PM: package: ‘@netlify/plugin-gatsby’
11:43:27 PM: Caching artifacts
11:43:27 PM: Started saving node modules
11:43:27 PM: Finished saving node modules
11:43:27 PM: Started saving build plugins
11:43:27 PM: Finished saving build plugins
11:43:27 PM: Started saving pip cache
11:43:27 PM: Finished saving pip cache
11:43:27 PM: Started saving emacs cask dependencies
11:43:27 PM: Finished saving emacs cask dependencies
11:43:27 PM: Started saving maven dependencies
11:43:27 PM: Finished saving maven dependencies
11:43:27 PM: Started saving boot dependencies
11:43:27 PM: Finished saving boot dependencies
11:43:27 PM: Started saving rust rustup cache
11:43:27 PM: Finished saving rust rustup cache
11:43:27 PM: Started saving go dependencies
11:43:27 PM: Finished saving go dependencies
11:43:30 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:43:30 PM: Creating deploy upload records
11:43:30 PM: Failing build: Failed to build site
11:43:30 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
11:43:30 PM: Finished processing build request in 2m19.837414274s

hey @dianestephani

Based on this section of the log (and the several lines below this section), there is now a GraphQL error

A link to the repository you are deploying would help in determining a solution (should you not find one yourself.)