All deploys fail after deploy contexts changed

I’m unable to deploy a project since yesterday.

The previous commit deployed correctly, the only difference is two numbers in the markdown.

One thing I did just before the problem started was that I modified some “Branch deploys” in the “Deploy contexts” area. Deleted some obsolete branches and added one new branch. But I didn’t touch any other setting, nor the master or stage branch which were already present in the “Branch deploy” list.
Any help is appreciated. This is a live site, which needs to be updated urgently.
thanks

These are the last lines of the last deploy attempt:

failed during stage 'building site': Build script returned non-zero exit code: 1 
Shutting down logging, 84 messages pending

Can it be possible that the Deploy contexts settings has anything to do with the problem?

The error message might be hidden. There is more about this here:

Would you please try the workaround there to get complete build logs?

If the full build logs don’t reveal the root cause, would you please send us a link to those logs in the Netlify UI?

1 Like

Thanks for the suggestion @luke, it will surely be helpful in the future!

The local build has lead us to this error message that we haven’t been able to find a fix to:
error Field "src" must not have a selection since type "String" has no subfields

The paths are correct, the naming of the images is also fine, the plugin order in gatsby-config.js is also correct (these were the suggestions from searching solutions for this error).

The thing I don’t understand, is why we get this error, when the site deployed fine with the same code (it’s currently live and running with the same code), nothing changed (only some markdown data, but nothing to do with images). But no successful deploy ever since, and I’d really need to push some new content.

This will be a bit too long, but I don’t see how I could share the deploy log URL. So this is the latest deploy log:

11:52:52 PM: Build ready to start
11:52:57 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
11:52:57 PM: build-image tag: v3.3.5
11:52:57 PM: buildbot version: 1c753eef258dfb3c0efc0675c36d881d135e648f
11:52:58 PM: Fetching cached dependencies
11:52:58 PM: Starting to download cache of 923.7MB
11:53:03 PM: Finished downloading cache in 4.882100309s
11:53:03 PM: Starting to extract cache
11:53:22 PM: Finished extracting cache in 19.306607283s
11:53:23 PM: Finished fetching cache in 25.076783658s
11:53:23 PM: Starting to prepare the repo for build
11:53:23 PM: Preparing Git Reference refs/heads/test
11:53:28 PM: Starting build script
11:53:28 PM: Installing dependencies
11:53:29 PM: Started restoring cached node version
11:53:32 PM: Finished restoring cached node version
11:53:33 PM: v10.17.0 is already installed.
11:53:34 PM: Now using node v10.17.0 (npm v6.11.3)
11:53:35 PM: Attempting ruby version 2.6.2, read from environment
11:53:36 PM: Using ruby version 2.6.2
11:53:37 PM: Using PHP version 5.6
11:53:37 PM: Started restoring cached node modules
11:53:37 PM: Finished restoring cached node modules
11:53:37 PM: Installing NPM modules using NPM version 6.11.3
11:54:23 PM: npm
11:54:23 PM: WARN rm
11:54:23 PM:  not removing /opt/build/repo/node_modules/.bin/gatsby as it wasn't installed by /opt/build/repo/node_modules/gatsby
11:54:23 PM: npm WARN rm
11:54:23 PM:  not removing /opt/build/repo/node_modules/.bin/rimraf as it wasn't installed by /opt/build/repo/node_modules/rimraf
11:54:23 PM: npm
11:54:23 PM: WARN rm not removing /opt/build/repo/node_modules/.bin/uuid as it wasn't installed by /opt/build/repo/node_modules/uuid
11:54:23 PM: npm WARN rm not removing /opt/build/repo/node_modules/.bin/svgo as it wasn't installed by /opt/build/repo/node_modules/svgo
11:54:23 PM: npm WARN rm not removing /opt/build/repo/node_modules/.bin/js-yaml as it wasn't installed by /opt/build/repo/node_modules/js-yaml
11:54:23 PM: npm WARN
11:54:23 PM:  rm not removing /opt/build/repo/node_modules/.bin/browserslist as it wasn't installed by /opt/build/repo/node_modules/browserslist
11:54:23 PM: npm WARN
11:54:23 PM:  rm not removing /opt/build/repo/node_modules/.bin/semver as it wasn't installed by /opt/build/repo/node_modules/semver
11:54:23 PM: npm WARN
11:54:23 PM:  rm not removing /opt/build/repo/node_modules/.bin/regjsparser as it wasn't installed by /opt/build/repo/node_modules/regjsparser
11:54:23 PM: npm WARN
11:54:23 PM: rm not removing /opt/build/repo/node_modules/.bin/mime as it wasn't installed by /opt/build/repo/node_modules/mime
11:54:23 PM: npm WARN rm not removing /opt/build/repo/node_modules/.bin/jsesc as it wasn't installed by /opt/build/repo/node_modules/jsesc
11:54:23 PM: npm WARN
11:54:23 PM: rm not removing /opt/build/repo/node_modules/.bin/detect as it wasn't installed by /opt/build/repo/node_modules/detect-port
11:54:23 PM: npm WARN rm not removing /opt/build/repo/node_modules/.bin/detect-port as it wasn't installed by /opt/build/repo/node_modules/detect-port
11:54:24 PM: npm WARN
11:54:24 PM:  rm not removing /opt/build/repo/node_modules/.bin/parser as it wasn't installed by /opt/build/repo/node_modules/@babel/parser
11:54:43 PM: > sharp@0.23.3 install /opt/build/repo/node_modules/sharp
11:54:43 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
11:54:44 PM: info
11:54:44 PM: sharp
11:54:44 PM:  Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz
11:54:46 PM: > node-sass@4.13.0 install /opt/build/repo/node_modules/node-sass
11:54:46 PM: > node scripts/install.js
11:54:47 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-64_binding.node
11:54:47 PM: Download complete
11:54:47 PM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
11:54:47 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.13.0/linux-x64-64_binding.node
11:54:48 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@babel/polyfill/node_modules/core-js
11:54:48 PM: > node postinstall || echo "ignore"
11:54:48 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
11:54:48 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
11:54:48 PM: > https://opencollective.com/core-js 
11:54:48 PM: > https://www.patreon.com/zloirock 
11:54:48 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
11:54:48 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@gatsbyjs/relay-compiler/node_modules/core-js
11:54:48 PM: > node postinstall || echo "ignore"
11:54:48 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/bmp/node_modules/core-js
11:54:48 PM: > node postinstall || echo "ignore"
11:54:48 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/core/node_modules/core-js
11:54:48 PM: > node postinstall || echo "ignore"
11:54:48 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/custom/node_modules/core-js
11:54:48 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/gif/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/jpeg/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-blit/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-blur/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-color/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-contain/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:49 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-cover/node_modules/core-js
11:54:49 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-crop/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-displace/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-dither/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-flip/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-gaussian/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-invert/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:50 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-mask/node_modules/core-js
11:54:50 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-normalize/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-print/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-resize/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-rotate/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugin-scale/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/plugins/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:51 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/png/node_modules/core-js
11:54:51 PM: > node postinstall || echo "ignore"
11:54:52 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/tiff/node_modules/core-js
11:54:52 PM: > node postinstall || echo "ignore"
11:54:52 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/types/node_modules/core-js
11:54:52 PM: > node postinstall || echo "ignore"
11:54:52 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/@jimp/utils/node_modules/core-js
11:54:52 PM: > node postinstall || echo "ignore"
11:54:52 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/babel-polyfill/node_modules/core-js
11:54:52 PM: > node postinstall || echo "ignore"
11:54:52 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
11:54:52 PM: > node postinstall || echo "ignore"
11:54:52 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/gatsby-cli/node_modules/core-js
11:54:52 PM: > node postinstall || echo "ignore"
11:54:53 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/gatsby/node_modules/core-js
11:54:53 PM: > node postinstall || echo "ignore"
11:54:53 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/jimp/node_modules/core-js
11:54:53 PM: > node postinstall || echo "ignore"
11:54:53 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/relay-runtime/node_modules/core-js
11:54:53 PM: > node postinstall || echo "ignore"
11:54:53 PM: > gatsby-telemetry@1.1.39 postinstall /opt/build/repo/node_modules/gatsby-telemetry
11:54:53 PM: > node src/postinstall.js
11:54:53 PM: > cwebp-bin@5.1.0 postinstall /opt/build/repo/node_modules/cwebp-bin
11:54:53 PM: > node lib/install.js
11:54:54 PM:   ✔ cwebp pre-build test passed successfully
11:54:54 PM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg
11:54:54 PM: > node lib/install.js
11:54:54 PM:   ✔ mozjpeg pre-build test passed successfully
11:54:54 PM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin
11:54:54 PM: > node lib/install.js
11:54:55 PM:   ✔ pngquant pre-build test passed successfully
11:54:55 PM: > gatsby-cli@2.8.13 postinstall /opt/build/repo/node_modules/gatsby-cli
11:54:55 PM: > node scripts/postinstall.js
11:54:55 PM: > core-js@3.4.2 postinstall /opt/build/repo/node_modules/core-js
11:54:55 PM: > node -e "try{require('./postinstall')}catch(e){}"
11:54:55 PM: > gatsby@2.18.3 postinstall /opt/build/repo/node_modules/gatsby
11:54:55 PM: > node scripts/postinstall.js
11:54:56 PM: > node-sass@4.13.0 postinstall /opt/build/repo/node_modules/node-sass
11:54:56 PM: > node scripts/build.js
11:54:56 PM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
11:54:56 PM: Testing binary
11:54:56 PM: Binary is fine
11:55:00 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/webpack-dev-server/node_modules/fsevents):
11:55:00 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:55:00 PM: npm
11:55:00 PM:  WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/watchpack/node_modules/fsevents):
11:55:00 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:55:00 PM: npm
11:55:00 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/babel-plugin-add-module-exports/node_modules/fsevents):
11:55:00 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:55:00 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
11:55:00 PM: npm WARN
11:55:00 PM:  notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:55:00 PM: added 747 packages from 167 contributors, removed 704 packages, updated 1828 packages and audited 36902 packages in 81.893s
11:55:00 PM: found 2 low severity vulnerabilities
11:55:00 PM:   run `npm audit fix` to fix them, or `npm audit` for details
11:55:00 PM: NPM modules installed
11:55:01 PM: Started restoring cached go cache
11:55:01 PM: Finished restoring cached go cache
11:55:01 PM: unset GOOS;
11:55:01 PM: unset GOARCH;
11:55:01 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
11:55:01 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
11:55:01 PM: go version >&2;
11:55:01 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
11:55:01 PM: go version go1.12 linux/amd64
11:55:01 PM: Installing missing commands
11:55:01 PM: Verify run directory
11:55:01 PM: Executing user command: gatsby build || { sleep 120; false; }
11:55:04 PM: success open and validate gatsby-configs - 0.091s
11:55:05 PM: success load plugins - 1.756s
11:55:05 PM: success onPreInit - 0.004s
11:55:05 PM: success delete html and css files from previous builds - 0.013s
11:55:06 PM: success initialize cache - 0.011s
11:55:06 PM: success copy gatsby files - 0.052s
11:55:06 PM: success onPreBootstrap - 0.015s
11:55:06 PM: success createSchemaCustomization - 0.033s
11:55:11 PM: success source and transform nodes - 5.093s
11:55:11 PM: success building schema - 0.615s
11:55:12 PM: success createPages - 0.627s
11:55:12 PM: success createPagesStatefully - 0.095s
11:55:12 PM: success onPreExtractQueries - 0.003s
11:55:13 PM: success update schema - 0.327s
11:55:13 PM: error Field "src" must not have a selection since type "String" has no subfields
11:55:13 PM: failed extract queries from components - 0.855s
11:57:14 PM: Skipping functions preparation step: no functions directory set
11:57:14 PM: Caching artifacts
11:57:14 PM: Started saving node modules
11:57:14 PM: Finished saving node modules
11:57:14 PM: Started saving pip cache
11:57:14 PM: Finished saving pip cache
11:57:14 PM: Started saving emacs cask dependencies
11:57:14 PM: Finished saving emacs cask dependencies
11:57:14 PM: Started saving maven dependencies
11:57:14 PM: Finished saving maven dependencies
11:57:14 PM: Started saving boot dependencies
11:57:14 PM: Finished saving boot dependencies
11:57:14 PM: Started saving go dependencies
11:57:14 PM: Finished saving go dependencies
11:57:14 PM: Error running command: Build script returned non-zero exit code: 1
11:57:14 PM: Failing build: Failed to build site
11:57:14 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
11:57:14 PM: Finished processing build request in 4m16.701703385s

You can cut and paste the deploy log URL from your browser - that’s what we’ll want :slight_smile:

The next suggestion I’d have would be setting your node, npm, etc versions explicitly. I can see from those logs that you’re using our defaults.

Check out this article with versioning details: Manage build dependencies | Netlify Docs

OK, I just thought it had to be publicly available, but here goes:

I can see from the build log, that the node and the npm versions are the same for the successful and the failed builds, so I guess that shouldn’t be the issue.

Hey @luke and @fool, we have updated all gatsby related plugins in our repo and are completely losing it, for some reason cannot get gatsby to build correctly (both locally and on netlify) and therefore cannot deploy updates to our site at all. We need to put out some black friday content, and are way too late already :cry:.

This is the last deploy we tried:

It’s quite clear that the problem has to do with the gatsby-remark-relative-images plugin, because the errors are all connected to images that should be handled by gatsby-remark-relative-images.

The thing we don’t understand is how it is possible that we were able to deploy one day, and without making changes to any functional code, we fail to deploy ever since.

There was one amazing moment today, when we were able to run a successful build command locally, then deployed with the netlify-cli, but with the same settings, and the same code, we cannot repeat this miracle again.

Is there anything we can do to make it easier to find a solution to our situation?

After downgrading to gatsby version 2.17.1, the build process moves past the mentioned image error.
Thanks to this issue on the gatsby-remark-relative-image page.

We are now stuck with a graphql error and it has to do with how we handle languages:
select is not a function

We seem to finally have a direction to move towards

@megant, we don’t have access to the repo (the build system does but our support team does not). This makes our troubleshooting of build errors limited to what we see in the logs.

(There can be exceptions to this. For example, if the error is not during the build but the pre/post processing stages of the build that Netlify controls. If there are errors in these build stages, we often do have additional details we can see in backend logs.)

In this case, I only see the same log error that you see. Does this same error happen locally?

Another thing to check is that we are using the same version of node and npm packages in our build as are being used locally. Are those the same as well? If not, we can research why not and get that corrected.

If there are other questions or more details to share, please send those anytime .

our problem persists, but with a twist.
I am developing on a Linux system and am unable to build nor deploy locally.
My colleague uses a Mac with the same node, npm, gatsby, gatsby-cli versions az I am using, and is able to build but not deploy locally.
These are the versions he is using:

  • node: 10.16.3
  • npm: 6.13.1
  • gatsby-cli: 2.8.14
  • gatsby: 2.18.5

Can the different operating systems have anything to do with the different result?

I set the node and npm versions in the netlify.toml file, so the build also runs with these versions.
We have not been able to push a single commit that netlify was able to build and deploy ever since I opened this thread.
My colleague has been able to deploy from a local netlify-cli. That is what saved us.

For some reason neither of us understand, netlify will not deploy successfully since the day I made the changes to our deploy context settings (maybe doesn’t have anything to do with our problem, but it’s the only thing that changed when deploys started failing).

Since then we have tried many versions of gatsby, npm and node, updated gastby plugins… downgraded plugins to versions used when netlify deployed successfully… no luck.

Our newest error is:
chmod: cannot access ‘/opt/buildhome/.gimme_cache’: No such file or directory

Lots of things can affect the result, but it is not expected that if you can’t build locally, we’d be able to :slight_smile:

netlify-cli is “build on your system and send us the source code”, so no surprise that that would work well; it removes any chance for our build system to be involved and break. If the CLI is not working for you we can also troubleshoot that, but let’s pick what your goal is and work on that goal instead of working on multiple things in parallel. I think you’d rather build based on commits in our CI. Is that true?

From today the site is unreachable:

We pushed a deploy from netlify-cli yesterday, the site was fine, haven’t done anything since, and now the site can’t be reached.
We need very urgent help!

-EDIT: now turns out my colleague did try to fix our deploy problem since the last successful deploy. But any help would be appreciated from netlifys side, to get our site up and running ASAP.

It turns out that my colleague installed a new version of node, and that may have caused some problem, but even though he has downgraded to the original version, our problem persists.

I am unable to build, but my colleagues local build is successful. It is a question how this is possible, but it’s less important then the other problem we are facing.

My colleague is able to build and locally serve the site, but when he deploys from the netlify-cli, instead of the site, there is a “page cannot be found” netlify error page.

We currently re-deployed an earlier successful deploy on the netlify admin, but are unable to refresh the site, and deploy anything new.

Is there anything we can do to find the cause, and fix our issue? Do you need any more specific information from our side to get closer to a solution?

If you believe the issue is related to a change in the node version, you can make sure that our buildbot uses the same version that your colleague is using (which builds successfully) by setting the NODE_VERSION env var, as mentioned in this doc about managing dependencies. I recommend making sure you are able to build locally yourself. Then trying my suggestion. The next step after that would be to try building your site locally using the same build-image our buildbot uses.