All builds failing

I’ve got all my attempts at build failing this morning. I tried removing cache, etc. Branches that built yesterday fail this morning. I spent around 50 build minutes trying to figure out what is going on. I get failed with non zero exit code ,error location: In configuration "build.lifecycle.onBuild" command, npm run build.

Also, I tried switching to yarn and get yarn: not found in Netlify. I picked successful builds and re run them and they all crash with either yarn or npm.

Try setting CI=false in the build command and check whether it works

Hey! Apologies in advance for the following copy/paste response. If I don’t clear anything up and/or your problem persists, please do reply.

This build may have failed because of the introduction of an unplanned change to builds in the last 24 hours. In your failed deploy log, you may see the line: Treating warnings as errors because process.env.CI = true

Basically, this change would mean that your site won’t deploy if there’s warnings. Although we plan to introduce this in some capacity in the future, like most other CI platforms already have, now wasn’t the time and we’ve rolled this back.

TL;DR: if you re-deploy your site now, it should work! If not, please reply.

1 Like

Thanks. Works for master, but any other branch preview build fails.

Update: works with npm, doesn’t with yarn

Hm – interesting! It sounds like a different issue, if I’m being honest. Do you have a deploy log for this?

…
3:04:14 PM: ​
3:04:14 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:04:14 PM: β”‚ Netlify Build β”‚
3:04:14 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:04:14 PM: ​
3:04:14 PM: ❯ Version
3:04:14 PM: @netlify/build 0.3.1
3:04:14 PM: ​
3:04:14 PM: ❯ Flags
3:04:14 PM: mode: buildbot
3:04:14 PM: ​
3:04:14 PM: ❯ Current directory
3:04:14 PM: /opt/build/repo
3:04:14 PM: ​
3:04:14 PM: ❯ Config file
3:04:14 PM: /opt/build/repo/netlify.toml
3:04:14 PM: ​
3:04:14 PM: ❯ Context
3:04:14 PM: branch-deploy
3:04:14 PM: ​
3:04:15 PM: ❯ Loading plugins
3:04:15 PM: - @netlify/plugin-functions-core from build core
3:04:15 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:04:15 PM: β”‚ 1. onPreBuild command from @netlify/plugin-functions-core β”‚
3:04:15 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:04:15 PM: ​
3:04:15 PM: ​
3:04:15 PM: (@netlify/plugin-functions-core onPreBuild completed in 4ms)
3:04:15 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:04:15 PM: β”‚ 2. build.lifecycle.onBuild command from netlify.toml config file β”‚
3:04:15 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:04:15 PM: ​
3:04:15 PM: $ yarn build
3:04:15 PM: /bin/sh: 1: yarn: not found
3:04:15 PM: ​
3:04:15 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:04:15 PM: β”‚ Build failed β”‚
3:04:15 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:04:15 PM: ​
3:04:15 PM: ❯ Error message
3:04:15 PM: Command failed with exit code 127: yarn build​
3:04:15 PM: ​
3:04:15 PM: ❯ Error location
3:04:15 PM: In configuration β€œbuild.lifecycle.onBuild” command:
3:04:15 PM: yarn build
3:04:15 PM: ​
3:04:16 PM: Caching artifacts
3:04:16 PM: Started saving node modules
3:04:16 PM: Finished saving node modules
3:04:16 PM: Started saving pip cache
3:04:16 PM: Finished saving pip cache
3:04:16 PM: Started saving emacs cask dependencies
3:04:16 PM: Finished saving emacs cask dependencies
3:04:16 PM: Started saving maven dependencies
3:04:16 PM: Finished saving maven dependencies
3:04:16 PM: Started saving boot dependencies
3:04:16 PM: Finished saving boot dependencies
3:04:16 PM: Started saving go dependencies
3:04:16 PM: Finished saving go dependencies
3:04:23 PM: Error running command: Build script returned non-zero exit code: 1
3:04:23 PM: Failing build: Failed to build site
3:04:23 PM: failed during stage β€˜building site’: Build script returned non-zero exit code: 1
3:04:23 PM: Finished processing build request in 1m38.006312466s

I see there’s an exit code 127 error – I’d suggest checking out this topic for some guidance!

Thanks for the tip. I finally managed to deploy now after 10 tries yesterday, and all kinds of debugging with sleep and false etc. Today I searched for β€œTreating warnings as errors because process.env.CI = true” and reached here and realized this was indeed the culprit.

Would have been good to give advance warning about this, rather than turning on unilaterally.

Hey @zehawk,

Understood and agreed. It wasn’t intentionally enabled and, rest assured, we’re usually loud and proud when it comes to improvements, changes and upgrades!

1 Like