gatsby: Build script returned non-zero exit code: 1 netlify

Hi everyone! First excuse me for my english 😦

The problem is that when I want deploy my project in Netlify, the console deploy show this error and I dont know to do.

Checked all name components that will match in CamelCase and still not working

12:45:04 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
12:45:04 PM: build-image tag: v3.3.2
12:45:04 PM: buildbot version: 75cd99f62ada9e21edea53208e8baf0eab85a045
12:45:05 PM: Fetching cached dependencies
12:45:05 PM: Failed to fetch cache, continuing with build
12:45:05 PM: Starting to prepare the repo for build
12:45:06 PM: No cached dependencies found. Cloning fresh repo
12:45:06 PM: git clone https://github.com/RafaelEsaa/borodigitalGatsbyjs
12:45:08 PM: Preparing Git Reference refs/heads/master
12:45:09 PM: Starting build script
12:45:09 PM: Installing dependencies
12:45:09 PM: Attempting node version '10.11.0' from .node-version
12:45:10 PM: Downloading and installing node v10.11.0...
12:45:11 PM: Downloading https://nodejs.org/dist/v10.11.0/node-v10.11.0-linux-x64.tar.xz...
12:45:11 PM: 
###                                                                        4.4%
12:45:11 PM: 
###################################                                       49.8%
12:45:11 PM: 
#################################################################
12:45:11 PM:       91.4%
12:45:11 PM: 
########################################################################
12:45:11 PM:  100.0%
12:45:11 PM: Computing checksum with sha256sum
12:45:11 PM: Checksums matched!
12:45:14 PM: Now using node v10.11.0 (npm v6.4.1)
12:45:14 PM: Attempting ruby version 2.6.2, read from environment
12:45:16 PM: Using ruby version 2.6.2
12:45:16 PM: Using PHP version 5.6
12:45:16 PM: Started restoring cached node modules
12:45:16 PM: Finished restoring cached node modules
12:45:16 PM: Installing NPM modules using NPM version 6.4.1
12:45:50 PM: > sharp@0.22.1 install /opt/build/repo/node_modules/sharp
12:45:50 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
12:45:51 PM: info
12:45:51 PM: sharp
12:45:51 PM:  Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz
12:45:54 PM: > node-sass@4.12.0 install /opt/build/repo/node_modules/node-sass
12:45:54 PM: > node scripts/install.js
12:45:55 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux-x64-64_binding.node
12:45:56 PM: Download complete
12:45:56 PM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
12:45:56 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.12.0/linux-x64-64_binding.node
12:45:56 PM: > core-js@2.6.9 postinstall /opt/build/repo/node_modules/core-js
12:45:56 PM: > node scripts/postinstall || echo "ignore"
12:45:56 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
12:45:56 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
12:45:56 PM: > https://opencollective.com/core-js 
12:45:56 PM: > https://www.patreon.com/zloirock 
12:45:56 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
12:45:56 PM: > core-js-pure@3.1.3 postinstall /opt/build/repo/node_modules/core-js-pure
12:45:56 PM: > node scripts/postinstall || echo "ignore"
12:45:56 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
12:45:56 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
12:45:56 PM: > https://opencollective.com/core-js 
12:45:56 PM: > https://www.patreon.com/zloirock 
12:45:56 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
12:45:57 PM: > gatsby-telemetry@1.0.10 postinstall /opt/build/repo/node_modules/gatsby-telemetry
12:45:57 PM: > node src/postinstall.js
12:45:57 PM: > cwebp-bin@5.1.0 postinstall /opt/build/repo/node_modules/cwebp-bin
12:45:57 PM: > node lib/install.js
12:45:58 PM:   βœ” cwebp pre-build test passed successfully
12:45:58 PM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg
12:45:58 PM: > node lib/install.js
12:45:58 PM:   βœ” mozjpeg pre-build test passed successfully
12:45:59 PM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin
12:45:59 PM: > node lib/install.js
12:45:59 PM:   βœ” pngquant pre-build test passed successfully
12:45:59 PM: > node-sass@4.12.0 postinstall /opt/build/repo/node_modules/node-sass
12:45:59 PM: > node scripts/build.js
12:45:59 PM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
12:45:59 PM: Testing binary
12:46:00 PM: Binary is fine
12:46:02 PM: npm
12:46:02 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
12:46:02 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
12:46:02 PM: added 1920 packages from 1846 contributors and audited 30386 packages in 45.396s
12:46:02 PM: found 0 vulnerabilities
12:46:03 PM: NPM modules installed
12:46:03 PM: Started restoring cached go cache
12:46:03 PM: Finished restoring cached go cache
12:46:03 PM: unset GOOS;
12:46:03 PM: unset GOARCH;
12:46:03 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
12:46:03 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
12:46:03 PM: go version >&2;
12:46:03 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
12:46:03 PM: go version go1.12 linux/amd64
12:46:03 PM: Installing missing commands
12:46:03 PM: Verify run directory
12:46:03 PM: Executing user command: gatsby build
12:46:06 PM: success open and validate gatsby-configs β€” 0.007 s
12:46:07 PM: success load plugins β€” 1.186 s
12:46:07 PM: success onPreInit β€” 0.007 s
12:46:07 PM: success delete html and css files from previous builds β€” 0.008 s
12:46:07 PM: success initialize cache β€” 0.013 s
12:46:07 PM: success copy gatsby files β€” 0.053 s
12:46:07 PM: success onPreBootstrap β€” 0.014 s
12:46:08 PM: warning
12:46:08 PM: Could not get instagram posts using the Graph API. Error status Error: Request failed with status code 400
12:46:08 PM: warning Falling back to public scraping... with boro_digital
12:46:08 PM: success source and transform nodes β€” 1.103 s
12:46:09 PM: warning There are conflicting field types in your data.
12:46:09 PM: If you have explicitly defined a type for those fields, you can safely ignore this warning message.
12:46:09 PM: Otherwise, Gatsby will omit those fields from the GraphQL schema.
12:46:09 PM: If you know all field types in advance, the best strategy is to explicitly define them with the `createTypes` action, and skip inference with the `@dontInfer` directive.
12:46:09 PM: See https://www.gatsbyjs.org/docs/actions/#createTypes
12:46:09 PM: DataJson.title:
12:46:09 PM:  - type: [string]
12:46:09 PM:    value: [ '<p>Hola</p>', ... ]
12:46:09 PM:    source: File "src/data/html.json"
12:46:09 PM:  - type: string
12:46:09 PM:    value: 'About Us'
12:46:09 PM:    source: File "src/data/about.json"
12:46:09 PM: success building schema β€” 0.441 s
12:46:09 PM: warning The plugin "gatsby-plugin-i18n" used a reserved field name in the context object when creating a page:
12:46:09 PM:   * "path"
12:46:09 PM: {
12:46:09 PM:     "path": "/es/blog/pasos-para-iniciar-tu-negocio/",
12:46:09 PM:     "component": "/opt/build/repo/src/templates/blog-post.js",
12:46:09 PM:     "context": {
12:46:09 PM:         "path": "/es/blog/pasos-para-iniciar-tu-negocio/",
12:46:09 PM:         "slug": "/es/blog/pasos-para-iniciar-tu-negocio/",
12:46:09 PM:         "langKey": "es"
12:46:09 PM:     },
12:46:09 PM:     "layout": null
12:46:09 PM: }
12:46:09 PM: Data in "context" is passed to GraphQL as potential arguments when running the
12:46:09 PM: page query.
12:46:09 PM: When arguments for GraphQL are constructed, the context object is combined with
12:46:09 PM: the page object so *both* page object and context data are available as
12:46:09 PM: arguments. So you don't need to add the page "path" to the context as it's
12:46:09 PM: already available in GraphQL. If a context field duplicates a field already
12:46:09 PM: used by the page object, this can break functionality within Gatsby so must be
12:46:09 PM: avoided.
12:46:09 PM: Please choose another name for the conflicting fields.
12:46:09 PM: The following fields are used by the page object and should be avoided.
12:46:09 PM:   * "path"
12:46:09 PM:   * "matchPath"
12:46:09 PM:   * "component"
12:46:09 PM:   * "componentChunkName"
12:46:09 PM:   * "pluginCreator___NODE"
12:46:09 PM:   * "pluginCreatorId"
12:46:09 PM: success createPages β€” 0.062 s
12:46:09 PM: success createPagesStatefully β€” 0.088 s
12:46:09 PM: success onPreExtractQueries β€” 0.003 s
12:46:09 PM: success update schema β€” 0.053 s
12:46:10 PM: error GraphQL Error There was an error while compiling your site's GraphQL queries.
12:46:10 PM:   Error: RelayParser: Encountered duplicate defintitions for one or more documents: each document must have a unique name. Duplicated documents:
12:46:10 PM: - optBuildRepoSrcComponentsFeedInstagramJs3868669787
12:46:10 PM: - SiteTitleQuery
12:46:10 PM: - optBuildRepoSrcComponentsMenuJs1397227751
12:46:10 PM: - SiteTitleQueryEsp
12:46:10 PM: Skipping functions preparation step: no functions directory set
12:46:10 PM: Caching artifacts
12:46:10 PM: Started saving node modules
12:46:10 PM: Finished saving node modules
12:46:10 PM: Started saving pip cache
12:46:10 PM: Finished saving pip cache
12:46:10 PM: Started saving emacs cask dependencies
12:46:10 PM: Finished saving emacs cask dependencies
12:46:10 PM: Started saving maven dependencies
12:46:10 PM: Finished saving maven dependencies
12:46:10 PM: Started saving boot dependencies
12:46:10 PM: Finished saving boot dependencies
12:46:10 PM: Started saving go dependencies
12:46:10 PM: Finished saving go dependencies
12:46:13 PM: Error running command: Build script returned non-zero exit code: 1
12:46:13 PM: Failing build: Failed to build site
12:46:13 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
12:46:13 PM: Finished processing build request in 1m8.542913454s
12:46:13 PM: Shutting down logging, 0 messages pending```

I hope resolve problem coming soon! :(

This is the repo https://github.com/RafaelEsaa/borodigitalGatsbyjs if you want see the source

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

Hi @RafaelEsaa! Are you developing on a Mac? When I clone your repo to a Mac, git gives me the following warning:

warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'src/components/ContactForm.js'
  'src/components/contactForm.js'
  'src/components/FeedInstagram.js'
  'src/components/feedInstagram.js'
  'src/components/Header.js'
  'src/components/header.js'
  'src/components/Layout.js'
  'src/components/layout.js'
  'src/components/Menu.js'
  'src/components/menu.js'
  'src/components/utils/EmailContact.js'
  'src/components/utils/emailContact.js'
  'src/componentsEsp/Header.js'
  'src/componentsEsp/header.js'
  'src/componentsEsp/Layout.js'
  'src/componentsEsp/layout.js'

It seems you have multiple files with the same name, but different letter case, e.g.:

src/components/Layout.js
src/components/layout.js

The Mac filesystem can’t tell the difference, so it just saves one of the files. On my laptop I get src/components/layout.js, but no src/components/Layout.js.

The Netlify builds run in a linux environment which can tell the difference between the two files, so both files exist after Netlify clones your git repo. This means you end up with conflicting GraphQL queries when building the site on Netlify (or any other Linux environment).

I think you could use the GitHub web UI to go through and delete the duplicate files in https://github.com/RafaelEsaa/borodigitalGatsbyjs/tree/master/src/components and https://github.com/RafaelEsaa/borodigitalGatsbyjs/tree/master/src/componentsEsp.

Let me know if that helps!

I had same issue.

7:04:33 AM: Finished saving go dependencies
7:04:35 AM: Error running command: Build script returned non-zero exit code: 1
7:04:35 AM: Failing build: Failed to build site
7:04:35 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
7:04:35 AM: Finished processing build request in 1m21.157558583s

My fix was to remove yarn.lock. I had built the site locally using npm not yarn.

I had noticed this in the failed deploy log on Netlify:

7:23:18 AM: Installing NPM modules using Yarn version 1.17.0
7:23:18 AM: yarn install v1.17.0
7:23:18 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
7:23:18 AM: [1/4] Resolving packages...

So rather than remove package-lock.json I removed yarn.lock.

Thanks for your answer @m-allanson I resolved this issue, deleted that files and doing push to the repo again. Deploy netlify was success!