Build fails with no error message

Hey team - been using Netlify for a while, this is the first time I couldn’t overcome a build failure.

Details below. The deploy log is devoid of a tangible error message. Here’s what I’ve tried already:

  • :white_check_mark: Built locally
  • :white_check_mark: Ensure that Yarn and Node versions match local and prod
  • :white_check_mark: Renamed my yarn build command to something else
  • :white_check_mark: Pulled build-image and successfully ran the build command using the same Netlify build bot

The git diff between the last successful build and this one is fairly substantial, but I just can’t imagine what’s causing it. The gist of what’s in the diff:

  • New images
  • Updates to JS files
  • A new yarn package (that’s in yarn and yarn.lock)

Details about the app:

  • Create React App (latest) + TypeScript
  • Yarn @ 1.22.4 (set in env variable)
  • Node @ 12.13.1 (set in .nvmrc)

Build log:

5:04:07 PM: Build ready to start
5:04:08 PM: build-image version: 3031d4c9e432fd7016f6279fc9ad706f9205d845
5:04:08 PM: build-image tag: v3.3.17
5:04:08 PM: buildbot version: 1f35b3abd6e2bf5230d8edf68072840fdec1513f
5:04:09 PM: Fetching cached dependencies
5:04:09 PM: Starting to download cache of 254.3KB
5:04:09 PM: Finished downloading cache in 74.465594ms
5:04:09 PM: Starting to extract cache
5:04:09 PM: Failed to fetch cache, continuing with build
5:04:09 PM: Starting to prepare the repo for build
5:04:09 PM: No cached dependencies found. Cloning fresh repo
5:04:09 PM: git clone [omitted]
5:04:10 PM: Preparing Git Reference refs/heads/master
5:04:11 PM: Starting build script
5:04:11 PM: Installing dependencies
5:04:11 PM: Python version set to 2.7
5:04:12 PM: Attempting node version '12.13.1' from .nvmrc
5:04:12 PM: Downloading and installing node v12.13.1...
5:04:13 PM: Downloading https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz...
5:04:13 PM: Computing checksum with sha256sum
5:04:13 PM: Checksums matched!
5:04:15 PM: Now using node v12.13.1 (npm v6.12.1)
5:04:15 PM: Started restoring cached build plugins
5:04:15 PM: Finished restoring cached build plugins
5:04:16 PM: Attempting ruby version 2.6.2, read from environment
5:04:17 PM: Using ruby version 2.6.2
5:04:17 PM: Using PHP version 5.6
5:04:17 PM: 5.2 is already installed.
5:04:17 PM: Using Swift version 5.2
5:04:17 PM: Started restoring cached node modules
5:04:17 PM: Finished restoring cached node modules
5:04:17 PM: Started restoring cached yarn cache
5:04:17 PM: Finished restoring cached yarn cache
5:04:17 PM: Installing yarn at version 1.22.4
5:04:17 PM: Installing Yarn!
5:04:17 PM: > Downloading tarball...
5:04:17 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.b8h66cJ5W9
5:04:17 PM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
5:04:17 PM:                                  Dload  Upload   Total   Spent    Left  Speed
5:04:18 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
5:04:18 PM: 100    80  100    80    0     0    264      0 --:--:-- --:--:-- --:--:--   264
5:04:18 PM: 100    93  100    93    0     0    149      0 --:--:-- --:--:-- --:--:--   149
5:04:18 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
5:04:18 PM: 100   630  100   630    0     0    711      0 --:--:-- --:--:-- --:--:-- 12600
5:04:19 PM: 100 1215k  100 1215k    0     0   901k      0  0:00:01  0:00:01 --:--:--  901k
5:04:19 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.b8h66cJ5W9.asc
5:04:19 PM: 100    84  100    84    0     0   3043      0 --:--:-- --:--:-- --:--:--  3043
5:04:19 PM: 100    97  100    97    0     0   1758      0 --:--:-- --:--:-- --:--:--  1758
5:04:19 PM: 100   634  100   634    0     0   2975      0 --:--:-- --:--:-- --:--:--  2975
5:04:19 PM: 100  1028  100  1028    0     0   4076      0 --:--:-- --:--:-- --:--:--  4076
5:04:19 PM: > Verifying integrity...
5:04:19 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
5:04:19 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
5:04:19 PM: gpg: WARNING: This key is not certified with a trusted signature!
5:04:19 PM: gpg:          There is no indication that the signature belongs to the owner.
5:04:19 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
5:04:19 PM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
5:04:19 PM: > GPG signature looks good
5:04:19 PM: > Extracting to ~/.yarn...
5:04:19 PM: > Adding to $PATH...
5:04:19 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.
5:04:20 PM: Installing NPM modules using Yarn version 1.22.4
5:04:20 PM: yarn install v1.22.4
5:04:20 PM: [1/4] Resolving packages...
5:04:20 PM: [2/4] Fetching packages...
5:04:20 PM: [3/4] Linking dependencies...
5:04:20 PM: [4/4] Building fresh packages...
5:04:20 PM: success Saved lockfile.
5:04:20 PM: Done in 0.12s.
5:04:20 PM: NPM modules installed using Yarn
5:04:20 PM: Started restoring cached go cache
5:04:20 PM: Finished restoring cached go cache
5:04:20 PM: Installing Go version 1.12
5:04:26 PM: unset GOOS;
5:04:26 PM: unset GOARCH;
5:04:26 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
5:04:26 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
5:04:26 PM: go version >&2;
5:04:26 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
5:04:26 PM: go version go1.12 linux/amd64
5:04:26 PM: Installing missing commands
5:04:26 PM: Verify run directory
5:04:27 PM: ​
5:04:27 PM: ┌─────────────────────────────┐
5:04:27 PM: │        Netlify Build        │
5:04:27 PM: └─────────────────────────────┘
5:04:27 PM: ​
5:04:27 PM: ❯ Version
5:04:27 PM:   @netlify/build 2.0.10
5:04:27 PM: ​
5:04:27 PM: ❯ Flags
5:04:27 PM:   deployId: 5ef3e9f74cb8464edbd20d46
5:04:27 PM:   mode: buildbot
5:04:27 PM: ​
5:04:27 PM: ❯ Current directory
5:04:27 PM:   /opt/build/repo
5:04:27 PM: ​
5:04:27 PM: ❯ Config file
5:04:27 PM:   No config file was defined: using default values.
5:04:27 PM: ​
5:04:27 PM: ❯ Context
5:04:27 PM:   production
5:04:27 PM: ​
5:04:27 PM: ┌────────────────────────────────┐
5:04:27 PM: │ 1. Build command from settings │
5:04:27 PM: └────────────────────────────────┘
5:04:27 PM: ​
5:04:27 PM: $ yarn build-dash
5:04:27 PM: yarn run v1.22.4
5:04:27 PM: $ yarn --cwd frontend install && yarn --cwd frontend build-dash
5:04:27 PM: [1/4] Resolving packages...
5:04:28 PM: [2/4] Fetching packages...
5:04:58 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
5:04:58 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
5:04:58 PM: info fsevents@1.2.12: The platform "linux" is incompatible with this module.
5:04:58 PM: info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
5:04:58 PM: [3/4] Linking dependencies...
5:04:58 PM: warning "antd > rc-picker@1.4.7" has unmet peer dependency "dayjs@^1.8.18".
5:05:14 PM: [4/4] Building fresh packages...
5:05:19 PM: $ react-app-rewired build
5:05:21 PM: Creating an optimized production build...
5:06:48 PM: 
5:06:48 PM: Treating warnings as errors because process.env.CI = true.
5:06:48 PM: Most CI servers set it automatically.
5:06:48 PM: 
5:06:48 PM: Failed to compile.
5:06:48 PM: 
5:06:48 PM: error Command failed with exit code 1.
5:06:48 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
5:06:48 PM: error Command failed with exit code 1.
5:06:48 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
5:06:48 PM: ​
5:06:48 PM: ┌─────────────────────────────┐
5:06:48 PM: │   "build.command" failed    │
5:06:48 PM: └─────────────────────────────┘
5:06:48 PM: ​
5:06:48 PM:   Error message
5:06:48 PM:   Command failed with exit code 1: yarn build-dash
5:06:48 PM: ​
5:06:48 PM:   Error location
5:06:48 PM:   In Build command from settings:
5:06:48 PM:   yarn build-dash
5:06:48 PM: ​
5:06:48 PM:   Resolved config
5:06:48 PM:   build:
5:06:48 PM:     command: yarn build-dash
5:06:48 PM:     publish: /opt/build/repo/frontend/build
5:06:48 PM: Caching artifacts
5:06:48 PM: Started saving node modules
5:06:48 PM: Finished saving node modules
5:06:48 PM: Started saving build plugins
5:06:48 PM: Finished saving build plugins
5:06:48 PM: Started saving yarn cache
5:06:48 PM: Finished saving yarn cache
5:06:48 PM: Started saving pip cache
5:07:02 PM: Finished saving pip cache
5:07:02 PM: Started saving emacs cask dependencies
5:07:02 PM: Finished saving emacs cask dependencies
5:07:02 PM: Started saving maven dependencies
5:07:02 PM: Finished saving maven dependencies
5:07:02 PM: Started saving boot dependencies
5:07:02 PM: Finished saving boot dependencies
5:07:02 PM: Started saving go dependencies
5:07:04 PM: Finished saving go dependencies
5:07:07 PM: Error running command: Build script returned non-zero exit code: 1
5:07:07 PM: Failing build: Failed to build site
5:07:07 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
5:07:07 PM: Finished processing build request in 2m58.978354124s

Anything else I should try? Any way for me to see a better error message? Thanks!

Anthony

Hey @acco,

I’m sure your problem is that your build command (yarn build-dash) is outputting warnings to the console and since recently warnings are now considered errors among CI platforms.
Just search for “Treating warnings as errors because process.env.CI = true” and you’ll understand.

This happened to me and fortunately all I had to do what fix a couple unused imports to prevent linting warnings. In your case, maybe you could try calling commands internally with a lower verbosity setting?

Hope this helps,
JC

hi there,

please see this article:

Thanks team! This is surely the issue

1 Like

Confirmed, thank you. Linter errors were failing the build

1 Like