Deploys stopped with working

Hello everybody.

Yesterday my deploys stopped working without a major change in github. I work with gatsby, react, contentful, netlify and github. Has anyone had the same error? You can find the full deployment report at the bottom.

I hope that someone can tell me what is going wrong ( i am 100% sure that the accestoken en spaceid are right).

The error:
Build failed due to a user error: Build script returned non-zero exit code: 2

The report:
2:49:10 PM: Build ready to start
2:49:12 PM: build-image version: e4d2dbe4cfec46db257e869258461ded89b75c9b
2:49:12 PM: build-image tag: v3.7.3
2:49:12 PM: buildbot version: 2cb5794cb93042dadefe5dbdc6b35edc34c20454
2:49:12 PM: Fetching cached dependencies
2:49:12 PM: Starting to download cache of 208.5MB
2:49:18 PM: Finished downloading cache in 6.338005256s
2:49:18 PM: Starting to extract cache
2:49:25 PM: Finished extracting cache in 6.917111356s
2:49:25 PM: Finished fetching cache in 13.302723544s
2:49:25 PM: Starting to prepare the repo for build
2:49:26 PM: Preparing Git Reference refs/heads/main
2:49:26 PM: Parsing package.json dependencies
2:49:27 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: β€˜public’ versus β€˜public/’ in the Netlify UI
2:49:27 PM: Starting build script
2:49:27 PM: Installing dependencies
2:49:27 PM: Python version set to 2.7
2:49:28 PM: Started restoring cached node version
2:49:30 PM: Finished restoring cached node version
2:49:31 PM: v12.18.0 is already installed.
2:49:32 PM: Now using node v12.18.0 (npm v6.14.4)
2:49:32 PM: Started restoring cached build plugins
2:49:32 PM: Finished restoring cached build plugins
2:49:32 PM: Attempting ruby version 2.7.1, read from environment
2:49:33 PM: Using ruby version 2.7.1
2:49:33 PM: Using PHP version 5.6
2:49:33 PM: Started restoring cached node modules
2:49:33 PM: Finished restoring cached node modules
2:49:33 PM: Installing NPM modules using NPM version 6.14.4
2:49:59 PM: > core-js@3.11.1 postinstall /opt/build/repo/node_modules/core-js
2:49:59 PM: > node -e β€œtry{require(’./postinstall’)}catch(e){}”
2:49:59 PM: > core-js-pure@3.11.1 postinstall /opt/build/repo/node_modules/core-js-pure
2:49:59 PM: > node -e β€œtry{require(’./postinstall’)}catch(e){}”
2:49:59 PM: > gatsby-telemetry@2.4.0 postinstall /opt/build/repo/node_modules/gatsby-telemetry
2:49:59 PM: > node src/postinstall.js || true
2:49:59 PM: > gatsby-cli@3.4.0 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
2:49:59 PM: > node scripts/postinstall.js
2:49:59 PM: > gatsby@3.4.0 postinstall /opt/build/repo/node_modules/gatsby
2:49:59 PM: > node scripts/postinstall.js
2:50:01 PM: npm WARN eslint-config-react-app@6.0.0 requires a peer of babel-eslint@^10.0.0 but none is installed. You must install peer dependencies yourself.
2:50:01 PM: npm WARN express-graphql@0.9.0 requires a peer of graphql@^14.4.1 but none is installed. You must install peer dependencies yourself.
2:50:01 PM: npm WARN ts-node@9.1.1 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
2:50:01 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
2:50:01 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
2:50:01 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
2:50:01 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
2:50:01 PM: added 58 packages from 101 contributors, removed 45 packages, updated 231 packages and audited 2550 packages in 27.178s
2:50:03 PM: 267 packages are looking for funding
2:50:03 PM: run npm fund for details
2:50:03 PM: found 0 vulnerabilities
2:50:03 PM: NPM modules installed
2:50:03 PM: Started restoring cached go cache
2:50:03 PM: Finished restoring cached go cache
2:50:03 PM: go version go1.14.4 linux/amd64
2:50:03 PM: go version go1.14.4 linux/amd64
2:50:03 PM: Installing missing commands
2:50:03 PM: Verify run directory
2:50:05 PM: ​
2:50:05 PM: ────────────────────────────────────────────────────────────────
2:50:05 PM: Netlify Build
2:50:05 PM: ────────────────────────────────────────────────────────────────
2:50:05 PM: ​
2:50:05 PM: ❯ Version
2:50:05 PM: @netlify/build 11.5.1
2:50:05 PM: ​
2:50:05 PM: ❯ Flags
2:50:05 PM: deployId: 608d4e465cb7100007849bc7
2:50:05 PM: ​
2:50:05 PM: ❯ Current directory
2:50:05 PM: /opt/build/repo
2:50:05 PM: ​
2:50:05 PM: ❯ Config file
2:50:05 PM: No config file was defined: using default values.
2:50:05 PM: ​
2:50:05 PM: ❯ Context
2:50:05 PM: production
2:50:05 PM: ​
2:50:05 PM: ❯ Loading plugins
2:50:05 PM: - netlify-plugin-gatsby-cache@0.3.0 from Netlify app
2:50:05 PM: ​
2:50:05 PM: ────────────────────────────────────────────────────────────────
2:50:05 PM: 1. onPreBuild command from netlify-plugin-gatsby-cache
2:50:05 PM: ────────────────────────────────────────────────────────────────
2:50:05 PM: ​
2:50:06 PM: Found a Gatsby cache. We’re about to go FAST. :zap:
2:50:06 PM: ​
2:50:06 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 623ms)
2:50:06 PM: ​
2:50:06 PM: ────────────────────────────────────────────────────────────────
2:50:06 PM: 2. Build command from Netlify app
2:50:06 PM: ────────────────────────────────────────────────────────────────
2:50:06 PM: ​
2:50:06 PM: npm run build 2:50:06 PM: > airbridge@0.1.0 build /opt/build/repo 2:50:06 PM: > gatsby build 2:50:09 PM: Using environment config: {activeEnv}
2:50:09 PM: success open and validate gatsby-configs - 0.021s
2:50:10 PM: error Cannot access Contentful space β€œ*********c0c” on environment β€œmaster” with access token β€œ*******ed”. Make sure to double check them! (value)
2:50:10 PM:
2:50:10 PM:
2:50:10 PM: Error: Cannot access Contentful space β€œ*********c0c” on environment β€œmaster” w ith access token β€œ*******ed”. Make sure to double check them! (value)
2:50:10 PM:
2:50:10 PM: - gatsby-node.js:52
2:50:10 PM: [repo]/[gatsby-source-contentful]/gatsby-node.js:52:13
2:50:10 PM:
2:50:10 PM: - task_queues.js:97 processTicksAndRejections
2:50:10 PM: internal/process/task_queues.js:97:5
2:50:10 PM:
2:50:10 PM: - gatsby-node.js:44 validateContentfulAccess
2:50:10 PM: [repo]/[gatsby-source-contentful]/gatsby-node.js:44:3
2:50:10 PM:
2:50:10 PM: - validator.js:82 Object.exports.entryAsync
2:50:10 PM: [repo]/[joi]/lib/validator.js:82:32
2:50:10 PM:
2:50:10 PM:
2:50:10 PM: not finished load plugins - 0.825s
2:50:10 PM: npm ERR! code ELIFECYCLE
2:50:10 PM: npm ERR! errno 1
2:50:10 PM: npm ERR! airbridge@0.1.0 build: gatsby build
2:50:10 PM: npm ERR! Exit status 1
2:50:10 PM: npm ERR!
2:50:10 PM: npm ERR! Failed at the airbridge@0.1.0 build script.
2:50:10 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:50:10 PM: npm ERR! A complete log of this run can be found in:
2:50:10 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-05-01T12_50_10_738Z-debug.log
2:50:10 PM: ​
2:50:10 PM: ────────────────────────────────────────────────────────────────
2:50:10 PM: β€œbuild.command” failed
2:50:10 PM: ────────────────────────────────────────────────────────────────
2:50:10 PM: ​
2:50:10 PM: Error message
2:50:10 PM: Command failed with exit code 1: npm run build
2:50:10 PM: ​
2:50:10 PM: Error location
2:50:10 PM: In Build command from Netlify app:
2:50:10 PM: npm run build
2:50:10 PM: ​
2:50:10 PM: Resolved config
2:50:10 PM: build:
2:50:10 PM: command: npm run build
2:50:10 PM: commandOrigin: ui
2:50:10 PM: environment:
2:50:10 PM: - GATSBY_CONTENTFUL_ACCES_TOKEN
2:50:10 PM: - GATSBY_CONTENTFUL_SPACE_ID
2:50:10 PM: publish: /opt/build/repo/public
2:50:10 PM: plugins:
2:50:10 PM: - inputs: {}
2:50:10 PM: origin: ui
2:50:10 PM: package: netlify-plugin-gatsby-cache
2:50:11 PM: Caching artifacts
2:50:11 PM: Started saving node modules
2:50:11 PM: Finished saving node modules
2:50:11 PM: Started saving build plugins
2:50:11 PM: Finished saving build plugins
2:50:11 PM: Started saving pip cache
2:50:11 PM: Finished saving pip cache
2:50:11 PM: Started saving emacs cask dependencies
2:50:11 PM: Finished saving emacs cask dependencies
2:50:11 PM: Started saving maven dependencies
2:50:11 PM: Finished saving maven dependencies
2:50:11 PM: Started saving boot dependencies
2:50:11 PM: Finished saving boot dependencies
2:50:11 PM: Started saving rust rustup cache
2:50:11 PM: Finished saving rust rustup cache
2:50:11 PM: Started saving go dependencies
2:50:11 PM: Finished saving go dependencies
2:50:11 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:50:11 PM: Creating deploy upload records
2:50:11 PM: Failing build: Failed to build site
2:50:11 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
2:50:11 PM: Finished processing build request in 59.438425111s

Sitename:
http://www.samsamdigital.nl/

There seems to be a problem with your Contentful config.

1 Like

Thank you for the quick reply.
I did not change anything in contentful. Do you have another suggestion?

I didn’t mean you changed something on Contentful, it’s just that your code is not able to access it, some probably something changed in your code, maybe your API keys or environment variables or something.

Or if it’s possible, try creating another Contentful space and connecting to it and see if it works. If it does, maybe something has gone wrong there.

Apart from that, since I’m not a Contentful user myself, I am not exactly sure of the possible changes that could affect it.

1 Like