Command failed with exit code 127: build staging

https://scofpstaging.netlify.com/

I just have the website pointing to a repo’s staging branch.
Been working fine for months, but now I am running into this code 127 when trying to deploy site or clear cache and deploy site

I’ve never adjust any build script. Just pointed to the repo and it deployed

8:18:31 PM: Build ready to start

8:18:33 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
8:18:33 PM: build-image tag: v3.3.20
8:18:33 PM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
8:18:33 PM: Fetching cached dependencies
8:18:33 PM: Starting to download cache of 254.7KB
8:18:33 PM: Finished downloading cache in 86.220423ms
8:18:33 PM: Starting to extract cache
8:18:33 PM: Failed to fetch cache, continuing with build
8:18:33 PM: Starting to prepare the repo for build
8:18:33 PM: No cached dependencies found. Cloning fresh repo
8:18:33 PM: git clone https://github.com/scofp/scofp
8:18:35 PM: Preparing Git Reference refs/heads/staging
8:18:36 PM: Starting build script
8:18:36 PM: Installing dependencies
8:18:36 PM: Python version set to 2.7
8:18:37 PM: Downloading and installing node v10.21.0…
8:18:37 PM: Downloading https://nodejs.org/dist/v10.21.0/node-v10.21.0-linux-x64.tar.xz
8:18:38 PM: Computing checksum with sha256sum
8:18:38 PM: Checksums matched!
8:18:40 PM: Now using node v10.21.0 (npm v6.14.4)
8:18:40 PM: Started restoring cached build plugins
8:18:40 PM: Finished restoring cached build plugins
8:18:40 PM: Attempting ruby version 2.6.2, read from environment
8:18:41 PM: Using ruby version 2.6.2
8:18:42 PM: Using PHP version 5.6
8:18:42 PM: 5.2 is already installed.
8:18:42 PM: Using Swift version 5.2
8:18:42 PM: Started restoring cached go cache
8:18:42 PM: Finished restoring cached go cache
8:18:42 PM: Installing Go version 1.12
8:18:47 PM: unset GOOS;
8:18:47 PM: unset GOARCH;
8:18:47 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
8:18:47 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:{PATH}"; 8:18:47 PM: go version >&2; 8:18:47 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env" 8:18:47 PM: go version go1.12 linux/amd64 8:18:47 PM: Installing missing commands 8:18:47 PM: Verify run directory 8:18:48 PM: ​ 8:18:48 PM: ┌─────────────────────────────┐ 8:18:48 PM: │ Netlify Build │ 8:18:48 PM: └─────────────────────────────┘ 8:18:48 PM: ​ 8:18:48 PM: ❯ Version 8:18:48 PM: @netlify/build 2.0.27 8:18:48 PM: ​ 8:18:48 PM: ❯ Flags 8:18:48 PM: deployId: 5f07de075edcd5d568a72cae 8:18:48 PM: mode: buildbot 8:18:48 PM: ​ 8:18:48 PM: ❯ Current directory 8:18:48 PM: /opt/build/repo 8:18:48 PM: ​ 8:18:48 PM: ❯ Config file 8:18:48 PM: No config file was defined: using default values. 8:18:48 PM: ​ 8:18:48 PM: ❯ Context 8:18:48 PM: production 8:18:48 PM: ​ 8:18:48 PM: ┌───────────────────────────────────┐ 8:18:48 PM: │ 1. Build command from Netlify app │ 8:18:48 PM: └───────────────────────────────────┘ 8:18:48 PM: ​ 8:18:48 PM: build staging
8:18:48 PM: /usr/local/bin/build: line 24: cd: staging: No such file or directory
8:18:48 PM: Installing dependencies
8:18:48 PM: Python version set to 2.7
8:18:49 PM: v10.21.0 is already installed.
8:18:50 PM: Now using node v10.21.0 (npm v6.14.4)
8:18:50 PM: Started restoring cached build plugins
8:18:50 PM: Finished restoring cached build plugins
8:18:50 PM: Attempting ruby version 2.6.2, read from environment
8:18:51 PM: Using ruby version 2.6.2
8:18:52 PM: Using PHP version 5.6
8:18:52 PM: 5.2 is already installed.
8:18:52 PM: Using Swift version 5.2
8:18:52 PM: Started restoring cached go cache
8:18:52 PM: Finished restoring cached go cache
8:18:52 PM: Installing Go version 1.12
8:18:56 PM: unset GOOS;
8:18:56 PM: unset GOARCH;
8:18:56 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
8:18:56 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
8:18:56 PM: go version >&2;
8:18:56 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
8:18:56 PM: go version go1.12 linux/amd64
8:18:56 PM: Installing missing commands
8:18:56 PM: Verify run directory
8:18:56 PM: /usr/local/bin/build: line 42: : command not found
8:18:56 PM: Caching artifacts
8:18:56 PM: Started saving build plugins
8:18:56 PM: Finished saving build plugins
8:18:56 PM: Started saving pip cache
8:18:56 PM: Finished saving pip cache
8:18:56 PM: Started saving emacs cask dependencies
8:18:57 PM: Finished saving emacs cask dependencies
8:18:57 PM: Started saving maven dependencies
8:18:57 PM: Finished saving maven dependencies
8:18:57 PM: Started saving boot dependencies
8:18:57 PM: Finished saving boot dependencies
8:18:57 PM: Started saving go dependencies
8:18:58 PM: Finished saving go dependencies
8:19:02 PM: ​
8:19:02 PM: ┌─────────────────────────────┐
8:19:02 PM: │ “build.command” failed │
8:19:02 PM: └─────────────────────────────┘
8:19:02 PM: ​
8:19:02 PM: Error message
8:19:02 PM: Command failed with exit code 127: build staging
8:19:02 PM: ​
8:19:02 PM: Error location
8:19:02 PM: In Build command from Netlify app:
8:19:02 PM: build staging
8:19:02 PM: ​
8:19:02 PM: Resolved config
8:19:02 PM: build:
8:19:02 PM: command: build staging
8:19:02 PM: commandOrigin: ui
8:19:02 PM: publish: /opt/build/repo
8:19:02 PM: Caching artifacts
8:19:02 PM: chmod: cannot access ‘/opt/buildhome/.gimme_cache’: No such file or directory
8:19:02 PM: Error running command: Build script returned non-zero exit code: 1
8:19:02 PM: Failing build: Failed to build site
8:19:02 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
8:19:02 PM: Finished processing build request in 29.544495114s

Have you seen our frequently encountered build problems guide? It’s worth checking out!

There’s also this issue which is identical to the error message you’re seeing :slight_smile:

I’m sorry, but I’m still very confused. I don’t see the resemblance between the issue you noted compared with my own. And compared to other code 127’s in the community, my website isn’t using any node.js or anything on npm? It’s pure HTML, CSS, and JS. Giving the community another sweep right now, but I would appreciate more explicit help

This was a successful build back in April.
Since then I’ve changed 2 lines of HTML, that’s it.

10:32:34 PM: Build ready to start

10:32:36 PM: build-image version: 2dbd444fcdce00cf06325060a8238d5ae3e86774
10:32:36 PM: build-image tag: v3.3.7
10:32:36 PM: buildbot version: ed44b74dccd74a30dec84aacc6e49a3511498577
10:32:36 PM: Fetching cached dependencies
10:32:36 PM: Starting to download cache of 230.0MB
10:32:37 PM: Finished downloading cache in 1.022202018s
10:32:37 PM: Starting to extract cache
10:32:44 PM: Finished extracting cache in 7.410807893s
10:32:44 PM: Finished fetching cache in 8.487354332s
10:32:44 PM: Starting to prepare the repo for build
10:32:45 PM: Preparing Git Reference refs/heads/staging
10:32:46 PM: Starting build script
10:32:46 PM: Installing dependencies
10:32:46 PM: Started restoring cached node version
10:32:53 PM: Finished restoring cached node version
10:32:54 PM: v10.20.1 is already installed.
10:32:55 PM: Now using node v10.20.1 (npm v6.14.4)
10:32:55 PM: Attempting ruby version 2.6.2, read from environment
10:32:56 PM: Using ruby version 2.6.2
10:32:57 PM: Using PHP version 5.6
10:32:57 PM: Started restoring cached go cache
10:32:57 PM: Finished restoring cached go cache
10:32:57 PM: unset GOOS;
10:32:57 PM: unset GOARCH;
10:32:57 PM: export GOROOT=’/opt/buildhome/.gimme/versions/go1.12.linux.amd64’;
10:32:57 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:{PATH}"; 10:32:57 PM: go version >&2; 10:32:57 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env'; 10:32:57 PM: go version go1.12 linux/amd64 10:32:57 PM: Installing missing commands 10:32:57 PM: Verify run directory 10:32:57 PM: Executing user command: build staging 10:32:57 PM: /usr/local/bin/build: line 26: cd: staging: No such file or directory 10:32:57 PM: Installing dependencies 10:32:58 PM: Started restoring cached node version 10:33:04 PM: Finished restoring cached node version 10:33:05 PM: v10.20.1 is already installed. 10:33:05 PM: Now using node v10.20.1 (npm v6.14.4) 10:33:05 PM: Attempting ruby version 2.6.2, read from environment 10:33:07 PM: Using ruby version 2.6.2 10:33:07 PM: Using PHP version 5.6 10:33:07 PM: Started restoring cached go cache 10:33:07 PM: Finished restoring cached go cache 10:33:07 PM: unset GOOS; 10:33:07 PM: unset GOARCH; 10:33:07 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64'; 10:33:07 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:{PATH}";
10:33:07 PM: go version >&2;
10:33:07 PM: export GIMME_ENV=’/opt/buildhome/.gimme/env/go1.12.linux.amd64.env’;
10:33:07 PM: go version go1.12 linux/amd64
10:33:07 PM: Installing missing commands
10:33:07 PM: Verify run directory
10:33:07 PM: /usr/local/bin/build: line 39: [: ==: unary operator expected
10:33:07 PM: Executing user command:
10:33:07 PM: /usr/local/bin/build: line 50: [: ==: unary operator expected
10:33:07 PM: Caching artifacts
10:33:07 PM: Started saving pip cache
10:33:07 PM: Finished saving pip cache
10:33:07 PM: Started saving emacs cask dependencies
10:33:07 PM: Finished saving emacs cask dependencies
10:33:07 PM: Started saving maven dependencies
10:33:07 PM: Finished saving maven dependencies
10:33:07 PM: Started saving boot dependencies
10:33:07 PM: Finished saving boot dependencies
10:33:07 PM: Started saving go dependencies
10:33:07 PM: Finished saving go dependencies
10:33:07 PM: Skipping functions preparation step: no functions directory set
10:33:07 PM: Caching artifacts
10:33:07 PM: chmod: cannot access ‘/opt/buildhome/.gimme_cache’
10:33:07 PM: : No such file or directory
10:33:07 PM: Build script success
10:33:07 PM: Starting to deploy site from ‘/’
10:33:07 PM: Creating deploy tree
10:33:07 PM: Creating deploy upload records
10:33:07 PM: 1 new files to upload
10:33:07 PM: 0 new functions to upload
10:33:08 PM: Starting post processing
10:33:08 PM: Post processing done
10:33:08 PM: Site is live
10:33:41 PM: Finished processing build request in 1m5.109831713s


This makes me this that when a build file/directory, it would just check ‘/’ where my index.html lives

But something about the deployer has changed on Netlify’s end?
I tried adding a forward slash in the settings/deploys Continuous Deployment Build Settings Base directory & Publish directory, but build still fails. It’s ignoring the Netlify UI.
Tried just putting a forward slash in the publish directory, still failed


8:03:10 PM: Build ready to start

8:03:12 PM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
8:03:12 PM: build-image tag: v3.3.20
8:03:12 PM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
8:03:12 PM: Fetching cached dependencies
8:03:12 PM: Starting to download cache of 254.8KB
8:03:12 PM: Finished downloading cache in 62.280222ms
8:03:12 PM: Starting to extract cache
8:03:12 PM: Failed to fetch cache, continuing with build
8:03:12 PM: Starting to prepare the repo for build
8:03:13 PM: No cached dependencies found. Cloning fresh repo
8:03:13 PM: git clone https://github.com/scofp/scofp
8:03:14 PM: Preparing Git Reference refs/heads/staging
8:03:16 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: ‘’ versus ‘/’ in the Netlify UI
8:03:16 PM: Starting build script
8:03:16 PM: Installing dependencies
8:03:16 PM: Python version set to 2.7
8:03:17 PM: Downloading and installing node v10.21.0…
8:03:17 PM: Downloading https://nodejs.org/dist/v10.21.0/node-v10.21.0-linux-x64.tar.xz
8:03:17 PM: Computing checksum with sha256sum
8:03:17 PM: Checksums matched!
8:03:20 PM: Now using node v10.21.0 (npm v6.14.4)
8:03:20 PM: Started restoring cached build plugins
8:03:20 PM: Finished restoring cached build plugins
8:03:20 PM: Attempting ruby version 2.6.2, read from environment
8:03:21 PM: Using ruby version 2.6.2
8:03:21 PM: Using PHP version 5.6
8:03:22 PM: 5.2 is already installed.
8:03:22 PM: Using Swift version 5.2
8:03:22 PM: Started restoring cached go cache
8:03:22 PM: Finished restoring cached go cache
8:03:22 PM: Installing Go version 1.12
8:03:27 PM: unset GOOS;
8:03:27 PM: unset GOARCH;
8:03:27 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
8:03:27 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:{PATH}"; 8:03:27 PM: go version >&2; 8:03:27 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env" 8:03:27 PM: go version go1.12 linux/amd64 8:03:27 PM: Installing missing commands 8:03:27 PM: Verify run directory 8:03:29 PM: ​ 8:03:29 PM: ┌─────────────────────────────┐ 8:03:29 PM: │ Netlify Build │ 8:03:29 PM: └─────────────────────────────┘ 8:03:29 PM: ​ 8:03:29 PM: ❯ Version 8:03:29 PM: @netlify/build 2.0.27 8:03:29 PM: ​ 8:03:29 PM: ❯ Flags 8:03:29 PM: deployId: 5f092bee4f8200a373cfec48 8:03:29 PM: mode: buildbot 8:03:29 PM: ​ 8:03:29 PM: ❯ Current directory 8:03:29 PM: /opt/build/repo 8:03:29 PM: ​ 8:03:29 PM: ❯ Config file 8:03:29 PM: No config file was defined: using default values. 8:03:29 PM: ​ 8:03:29 PM: ❯ Context 8:03:29 PM: production 8:03:29 PM: ​ 8:03:29 PM: ┌───────────────────────────────────┐ 8:03:29 PM: │ 1. Build command from Netlify app │ 8:03:29 PM: └───────────────────────────────────┘ 8:03:29 PM: ​ 8:03:29 PM: build staging
8:03:29 PM: /usr/local/bin/build: line 24: cd: staging: No such file or directory
8:03:29 PM: Installing dependencies
8:03:29 PM: Python version set to 2.7
8:03:30 PM: v10.21.0 is already installed.
8:03:30 PM: Now using node v10.21.0 (npm v6.14.4)
8:03:30 PM: Started restoring cached build plugins
8:03:30 PM: Finished restoring cached build plugins
8:03:31 PM: Attempting ruby version 2.6.2, read from environment
8:03:32 PM: Using ruby version 2.6.2
8:03:32 PM: Using PHP version 5.6
8:03:32 PM: 5.2 is already installed.
8:03:32 PM: Using Swift version 5.2
8:03:32 PM: Started restoring cached go cache
8:03:33 PM: Finished restoring cached go cache
8:03:33 PM: Installing Go version 1.12
8:03:37 PM: unset GOOS;
8:03:37 PM: unset GOARCH;
8:03:37 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
8:03:37 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
8:03:37 PM: go version >&2;
8:03:37 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
8:03:37 PM: go version go1.12 linux/amd64
8:03:37 PM: Installing missing commands
8:03:37 PM: Verify run directory
8:03:37 PM: /usr/local/bin/build: line 42: : command not found
8:03:37 PM: Caching artifacts
8:03:37 PM: Started saving build plugins
8:03:37 PM: Finished saving build plugins
8:03:37 PM: Started saving pip cache
8:03:37 PM: Finished saving pip cache
8:03:37 PM: Started saving emacs cask dependencies
8:03:37 PM: Finished saving emacs cask dependencies
8:03:37 PM: Started saving maven dependencies
8:03:37 PM: Finished saving maven dependencies
8:03:37 PM: Started saving boot dependencies
8:03:37 PM: Finished saving boot dependencies
8:03:37 PM: Started saving go dependencies
8:03:39 PM: Finished saving go dependencies
8:03:42 PM: ​
8:03:42 PM: ┌─────────────────────────────┐
8:03:42 PM: │ “build.command” failed │
8:03:42 PM: └─────────────────────────────┘
8:03:42 PM: ​
8:03:42 PM: Error message
8:03:42 PM: Command failed with exit code 127: build staging
8:03:42 PM: ​
8:03:42 PM: Error location
8:03:42 PM: In Build command from Netlify app:
8:03:42 PM: build staging
8:03:42 PM: ​
8:03:42 PM: Resolved config
8:03:42 PM: build:
8:03:42 PM: base: /opt/build/repo
8:03:42 PM: command: build staging
8:03:42 PM: commandOrigin: ui
8:03:42 PM: publish: /opt/build/repo
8:03:42 PM: Caching artifacts
8:03:42 PM: chmod: cannot access ‘/opt/buildhome/.gimme_cache’: No such file or directory
8:03:42 PM: Error running command: Build script returned non-zero exit code: 1
8:03:42 PM: Failing build: Failed to build site
8:03:42 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
8:03:43 PM: Finished processing build request in 30.285640333s

Hey there,

Sorry, I thought that the .gimme_cache was the issue at hand. I looked a bit higher up the build command and found:

8:18:48 PM: build staging
8:18:48 PM: /usr/local/bin/build: line 24: cd: staging: No such file or directory

It could be related to this or it could be because there’s no path called staging in your root.

I’ve found a way to get the website to deploy.
In:
Settings > Build & deploy > Build image selection
I changed the option from the default Ubuntu Xenial 16.04 to Ubuntu Trusty 14.04
I tried making a small change in another website being hosted on Netlify, and it built with no issue. Compared deployment setting differences and this was the only one. I feel like that setting really shouldn’t have effected deployment, but it worked :man_shrugging:

All that to say, my latest changes are live :tada:

hi there, maybe this contains some relevant information for you: