Builds suddenly failing during yarn build:staging (exit code: 1)

Hey!

I’ve been working on a site (https://infallible-shannon-d89688.netlify.app) for a few months, and while it used to build and deploy with no problem all of a sudden the builds started failing.

I’ve combed through the build logs of both the successful and failed builds and the only differences I can spot are that the netlify/build version has gone up from 1.0.16 to 2.0.10 and a deployId flag has been added.

The project builds fine on my local machine.

Below is the full failed build log.

Thank you for any help!

6:25:54 PM: build-image version: 342853e31ef590be8195dfbea64bbc4657de7b6b
6:25:54 PM: build-image tag: v3.3.16
6:25:54 PM: buildbot version: 0ffb969a1fc5a7aa9d2a93dd77dd40a990576807
6:25:55 PM: Fetching cached dependencies
6:25:55 PM: Starting to download cache of 221.7MB
6:25:59 PM: Finished downloading cache in 4.279584388s
6:25:59 PM: Starting to extract cache
6:26:12 PM: Finished extracting cache in 13.126906196s
6:26:12 PM: Finished fetching cache in 17.475474573s
6:26:12 PM: Starting to prepare the repo for build
6:26:13 PM: Preparing Git Reference refs/heads/develop
6:26:14 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus 'build/' in the Netlify UI
6:26:14 PM: Starting build script
6:26:14 PM: Installing dependencies
6:26:14 PM: Python version set to 2.7
6:26:15 PM: Started restoring cached node version
6:26:20 PM: Finished restoring cached node version
6:26:21 PM: v10.21.0 is already installed.
6:26:21 PM: Now using node v10.21.0 (npm v6.14.4)
6:26:21 PM: Started restoring cached build plugins
6:26:21 PM: Finished restoring cached build plugins
6:26:22 PM: Attempting ruby version 2.6.2, read from environment
6:26:22 PM: 
6:26:22 PM: ** WARNING **
6:26:22 PM: Using custom ruby version 2.6.2, this will slow down the build.
6:26:22 PM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
6:26:22 PM: Included versions: 2.7.1
6:26:22 PM: 
6:26:23 PM: Required ruby-2.6.2 is not installed - installing.
6:26:23 PM: Searching for binary rubies, this might take some time.
6:26:23 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.6.2.tar.bz2
6:26:23 PM: Checking requirements for ubuntu.
6:26:24 PM: Requirements installation successful.
6:26:24 PM: ruby-2.6.2 - #configure
6:26:24 PM: ruby-2.6.2 - #download
6:26:25 PM: No checksum for downloaded archive, recording checksum in user configuration.
6:26:25 PM: ruby-2.6.2 - #validate archive
6:26:30 PM: ruby-2.6.2 - #extract
6:26:33 PM: ruby-2.6.2 - #validate binary
6:26:34 PM: ruby-2.6.2 - #setup
6:26:34 PM: ruby-2.6.2 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.2@global
6:26:35 PM: ruby-2.6.2 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
6:26:35 PM: ruby-2.6.2 - #generating global wrappers.......
6:26:35 PM: ruby-2.6.2 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.6.2
6:26:35 PM: ruby-2.6.2 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
6:26:35 PM: ruby-2.6.2 - #generating default wrappers.......
6:26:36 PM: Using /opt/buildhome/.rvm/gems/ruby-2.6.2
6:26:36 PM: Using ruby version 2.6.2
6:26:36 PM: Using PHP version 5.6
6:26:36 PM: 5.2 is already installed.
6:26:36 PM: Using Swift version 5.2
6:26:36 PM: Started restoring cached node modules
6:26:36 PM: Finished restoring cached node modules
6:26:36 PM: Started restoring cached yarn cache
6:26:36 PM: Finished restoring cached yarn cache
6:26:37 PM: Installing NPM modules using Yarn version 1.17.0
6:26:38 PM: yarn install v1.17.0
6:26:38 PM: [1/4] Resolving packages...
6:26:39 PM: success Already up-to-date.
6:26:39 PM: Done in 0.91s.
6:26:39 PM: NPM modules installed using Yarn
6:26:39 PM: Started restoring cached go cache
6:26:39 PM: Finished restoring cached go cache
6:26:39 PM: Installing Go version 1.12
6:26:45 PM: unset GOOS;
6:26:45 PM: unset GOARCH;
6:26:45 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
6:26:45 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
6:26:45 PM: go version >&2;
6:26:45 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
6:26:45 PM: go version go1.12 linux/amd64
6:26:45 PM: Installing missing commands
6:26:45 PM: Verify run directory
6:26:46 PM: ​
6:26:46 PM: ┌─────────────────────────────┐
6:26:46 PM: │        Netlify Build        │
6:26:46 PM: └─────────────────────────────┘
6:26:46 PM: ​
6:26:46 PM: ❯ Version
6:26:46 PM:   @netlify/build 2.0.10
6:26:46 PM: ​
6:26:46 PM: ❯ Flags
6:26:46 PM:   deployId: 5eea987032ec6b00086a0f97
6:26:46 PM:   mode: buildbot
6:26:46 PM: ​
6:26:46 PM: ❯ Current directory
6:26:46 PM:   /opt/build/repo
6:26:46 PM: ​
6:26:46 PM: ❯ Config file
6:26:46 PM:   No config file was defined: using default values.
6:26:46 PM: ​
6:26:46 PM: ❯ Context
6:26:46 PM:   production
6:26:46 PM: ​
6:26:46 PM: ┌────────────────────────────────┐
6:26:46 PM: │ 1. Build command from settings │
6:26:46 PM: └────────────────────────────────┘
6:26:46 PM: ​
6:26:46 PM: $ yarn build:staging
6:26:47 PM: yarn run v1.17.0
6:26:47 PM: $ env-cmd -f .env.staging node scripts/build.js
6:26:48 PM: Creating an optimized production build...
6:27:16 PM: 
6:27:16 PM: Treating warnings as errors because process.env.CI = true.
6:27:16 PM: Most CI servers set it automatically.
6:27:16 PM: 
6:27:16 PM: Failed to compile.
6:27:16 PM: 
6:27:16 PM: ./src/TournamentCalendar/index.jsx
6:27:16 PM:   Line 108:6:  React Hook useEffect has missing dependencies: 'isFiltering', 'location.search', 'pageLoaded', 'query.date_range', 'query.page', 'setQuery', and 'user'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM:   Line 121:6:  React Hook useEffect has missing dependencies: 'location.search', 'query', and 'setQuery'. Either include them or remove the dependency array                                                                react-hooks/exhaustive-deps
6:27:16 PM: ./src/Profile/AccountInfo/index.jsx
6:27:16 PM:   Line 109:6:  React Hook useEffect has a missing dependency: 'localEditing'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/PlayerSearch/PlayerFilters/GameSubFilters/index.jsx
6:27:16 PM:   Line 116:6:  React Hook useEffect has missing dependencies: 'activeFilterCategories' and 'setActiveFilterCategories'. Either include them or remove the dependency array. If 'setActiveFilterCategories' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
6:27:16 PM:   Line 126:6:  React Hook useEffect has a missing dependency: 'setActiveFilterCategories'. Either include it or remove the dependency array. If 'setActiveFilterCategories' changes too often, find the parent component that defines it and wrap that definition in useCallback                                 react-hooks/exhaustive-deps
6:27:16 PM:   Line 134:6:  React Hook useEffect has a missing dependency: 'setActiveFilterCategories'. Either include it or remove the dependency array. If 'setActiveFilterCategories' changes too often, find the parent component that defines it and wrap that definition in useCallback                                 react-hooks/exhaustive-deps
6:27:16 PM: ./src/shared/components/Formik/FormikEffect.jsx
6:27:16 PM:   Line 15:6:  React Hook useEffect has missing dependencies: 'formik', 'onChange', and 'prevValues'. Either include them or remove the dependency array. If 'onChange' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
6:27:16 PM: ./src/shared/components/ScrollToTop.jsx
6:27:16 PM:   Line 17:6:  React Hook useEffect has a missing dependency: 'history'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/shared/hooks/interval.js
6:27:16 PM:   Line 1:8:   'React' is defined but never used     no-unused-vars
6:27:16 PM:   Line 1:36:  'useState' is defined but never used  no-unused-vars
6:27:16 PM: ./src/PlayerSearch/PlayerFilters/index.jsx
6:27:16 PM:   Line 203:9:  'handleAppliedFilterClose' is assigned a value but never used  no-unused-vars
6:27:16 PM: ./src/shared/hooks/resize.js
6:27:16 PM:   Line 23:17:  Assignments to the 'timeout' variable from inside React Hook useLayoutEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside useLayoutEffect  react-hooks/exhaustive-deps
6:27:16 PM: ./src/TournamentCalendar/Calendar/index.jsx
6:27:16 PM:   Line 24:7:  'defaultProps' is assigned a value but never used  no-unused-vars
6:27:16 PM: ./src/PlayerSearch/PlayerFilters/GenreFilters.jsx
6:27:16 PM:   Line 2:8:  'colors' is defined but never used  no-unused-vars
6:27:16 PM: ./src/Profile/ProfileDetail/index.jsx
6:27:16 PM:   Line 31:6:  React Hook useEffect has missing dependencies: 'currentUser.id' and 'updateUserActivity'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/Auth/DiscordSignup/index.jsx
6:27:16 PM:   Line 34:6:  React Hook useEffect has a missing dependency: 'addAlert'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/shared/components/GameCarousel/index.jsx
6:27:16 PM:   Line 3:16:   'CardContent' is defined but never used  no-unused-vars
6:27:16 PM:   Line 3:40:   'Paper' is defined but never used        no-unused-vars
6:27:16 PM:   Line 6:8:    'Room' is defined but never used         no-unused-vars
6:27:16 PM:   Line 10:10:  'Link' is defined but never used         no-unused-vars
6:27:16 PM: ./src/Profile/ProfileEdit/index.jsx
6:27:16 PM:   Line 3:46:   'ListItemText' is defined but never used                                                                                                                                                                                                                                                           no-unused-vars
6:27:16 PM:   Line 153:6:  React Hook useCallback has missing dependencies: 'setPlatformInfo' and 'setSelectedGameFilterOptions'. Either include them or remove the dependency array. If 'setSelectedGameFilterOptions' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
6:27:16 PM: ./src/TournamentCalendar/Filters/FilterGenres.jsx
6:27:16 PM:   Line 4:8:  'colors' is defined but never used  no-unused-vars
6:27:16 PM: ./src/PlayerSearch/PlayerFilters/GameSubFilters/RegionSelector/index.jsx
6:27:16 PM:   Line 52:6:  React Hook useEffect has a missing dependency: 'setRegionOnInit'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/Chat/ChatDetail/MessagesContainer/index.jsx
6:27:16 PM:   Line 53:6:  React Hook useEffect has missing dependencies: 'messageSent', 'page', and 'user'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/Chat/ChatList/index.jsx
6:27:16 PM:   Line 56:6:  React Hook useEffect has a missing dependency: 'currentUser.data.id'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/Chat/index.jsx
6:27:16 PM:   Line 57:6:   React Hook useMemo has a missing dependency: 'user.data.id'. Either include it or remove the dependency array                                                           react-hooks/exhaustive-deps
6:27:16 PM:   Line 93:6:   React Hook useEffect has missing dependencies: 'setLocalData' and 'user.data.id'. Either include them or remove the dependency array                                    react-hooks/exhaustive-deps
6:27:16 PM:   Line 149:6:  React Hook useEffect has missing dependencies: 'isChatRoot', 'user.data.id', and 'userId'. Either include them or remove the dependency array                           react-hooks/exhaustive-deps
6:27:16 PM:   Line 157:6:  React Hook useEffect has a missing dependency: 'user.data.id'. Either include it or remove the dependency array                                                         react-hooks/exhaustive-deps
6:27:16 PM:   Line 169:6:  React Hook useEffect has missing dependencies: 'history', 'isChatRoot', 'justPushed', 'selectedChat', and 'userId'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM:   Line 188:6:  React Hook useEffect has missing dependencies: 'history', 'refetchChats', and 'refetchToken'. Either include them or remove the dependency array                        react-hooks/exhaustive-deps
6:27:16 PM: ./src/shared/components/GameSearch/index.jsx
6:27:16 PM:   Line 59:6:  React Hook useEffect has missing dependencies: 'games' and 'selectedGenre'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/Chat/ChatDetail/index.jsx
6:27:16 PM:   Line 64:6:   React Hook useEffect has missing dependencies: 'updateUserActivity' and 'user'. Either include them or remove the dependency array                                                                                                                                  react-hooks/exhaustive-deps
6:27:16 PM:   Line 86:6:   React Hook useEffect has missing dependencies: 'setLocalData' and 'user.data.id'. Either include them or remove the dependency array                                                                                                                                react-hooks/exhaustive-deps
6:27:16 PM:   Line 106:6:  React Hook useEffect has missing dependencies: 'chatGroup', 'refetchChats', and 'user'. Either include them or remove the dependency array. If 'refetchChats' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
6:27:16 PM: ./src/PlayerSearch/index.jsx
6:27:16 PM:   Line 73:6:    React Hook useEffect has missing dependencies: 'query.page' and 'setQuery'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM:   Line 164:36:  Expected '===' and instead saw '=='                                                                                             eqeqeq
6:27:16 PM: ./src/Profile/Completeness/index.jsx
6:27:16 PM:   Line 80:6:  React Hook useEffect has a missing dependency: 'handleCompletenessShift'. Either include it or remove the dependency array       react-hooks/exhaustive-deps
6:27:16 PM:   Line 85:6:  React Hook useEffect has a missing dependency: 'handleItemsNeedingCompletion'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
6:27:16 PM: ./src/shared/components/ConfirmDialog/index.jsx
6:27:16 PM:   Line 9:17:  'useState' is defined but never used  no-unused-vars
6:27:16 PM: error Command failed with exit code 1.
6:27:16 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
6:27:16 PM: ​
6:27:16 PM: ┌─────────────────────────────┐
6:27:16 PM: │   "build.command" failed    │
6:27:16 PM: └─────────────────────────────┘
6:27:16 PM: ​
6:27:16 PM:   Error message
6:27:16 PM:   Command failed with exit code 1: yarn build:staging
6:27:16 PM: ​
6:27:16 PM:   Error location
6:27:16 PM:   In Build command from settings:
6:27:16 PM:   yarn build:staging
6:27:16 PM: ​
6:27:16 PM:   Resolved config
6:27:16 PM:   build:
6:27:16 PM:     command: 'yarn build:staging'
6:27:16 PM:     publish: /opt/build/repo/build
6:27:16 PM: Caching artifacts
6:27:16 PM: Started saving node modules
6:27:16 PM: Finished saving node modules
6:27:16 PM: Started saving build plugins
6:27:16 PM: Finished saving build plugins
6:27:16 PM: Started saving yarn cache
6:27:16 PM: Finished saving yarn cache
6:27:16 PM: Started saving pip cache
6:27:16 PM: Finished saving pip cache
6:27:16 PM: Started saving emacs cask dependencies
6:27:16 PM: Finished saving emacs cask dependencies
6:27:16 PM: Started saving maven dependencies
6:27:16 PM: Finished saving maven dependencies
6:27:16 PM: Started saving boot dependencies
6:27:17 PM: Finished saving boot dependencies
6:27:17 PM: Started saving go dependencies
6:27:18 PM: Finished saving go dependencies
6:27:18 PM: Cached ruby version 2.6.2
6:27:19 PM: Error running command: Build script returned non-zero exit code: 1
6:27:19 PM: Failing build: Failed to build site
6:27:19 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
6:27:19 PM: Finished processing build request in 1m24.284820894s```

hi there, please see this thread - there are some steps a little bit further down to help you remediate this issue :muscle:

1 Like

Thank you so much! Worked like a charm.

1 Like