The command returned a non-zero code 1

We’ve done nothing special to change this behaviour. There’s no reason for Netlify to trigger a change that would specifically affect a minor x.x.1 update in Node.js and break so many builds.

I’ve always used the NODE_VERSION as node in my Site Settings. So I have been using version 16.5.1+ much before it went into the “latest LTS” stage a few days ago and I’m having this issue since then.

To be clear, we’re not doing anything special with building packages or installing Node Modules. We’re simply calling npm install:

github.com

netlify/build-image/blob/focal/run-build-functions.sh#L209

      
        
  1. echo "Error installing NPM"
  2. exit 1
  3. fi
  4. fi
  5. fi
  6. if install_deps package.json $NODE_VERSION $NETLIFY_CACHE_DIR/package-sha
  7. then
  8. echo "Installing NPM modules using NPM version $(npm --version)"
  9. run_npm_set_temp
  10. if npm install ${NPM_FLAGS:+$NPM_FLAGS}
  11. then
  12. echo "NPM modules installed"
  13. else
  14. echo "Error during NPM install"
  15. exit 1
  16. fi
  17. echo "$(shasum package.json)-$NODE_VERSION" > $NETLIFY_CACHE_DIR/package-sha
  18. fi
  19. export PATH=$(npm bin):$PATH

Now why that breaks, especially due to a change of version with Node.js? I think that’s a question for the variable that’s changing here.

I have a trained custom vision model. When export the model to a Dockerfile, that file will fail the build.

I am building this on a Raspberry Pi 4GB running:
Ubuntu 20.04
Ubuntu 22.04

I downloaded both t he "Linux" and "ARM" version of the Dockerfile. Pretty much the same result.

Here is a sample:

 ubuntu@demo-rpi:~$ cd custom_vision_linux/
 ubuntu@demo-rpi:~/custom_vision_linux$ ls
 Dockerfile  LICENSE  README.md  README.txt  app  azureml
 ubuntu@demo-rpi:~/custom_vision_linux$ docker build .
 Sending build context to Docker daemon  11.23MB
 Step 1/8 : FROM python:3.7-slim
  ---> 07ab5dfe81e0
 Step 2/8 : RUN pip install -U pip
  ---> Running in dbe0425cc9ef
 Requirement already satisfied: pip in /usr/local/lib/python3.7/site-packages (22.0.4)
 Collecting pip
   Downloading pip-22.1.2-py3-none-any.whl (2.1 MB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 4.1 MB/s eta 0:00:00
 Installing collected packages: pip
   Attempting uninstall: pip
     Found existing installation: pip 22.0.4
     Uninstalling pip-22.0.4:
       Successfully uninstalled pip-22.0.4
 Successfully installed pip-22.1.2

 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
 Removing intermediate container dbe0425cc9ef
  ---> a508ba7d0190
 Step 3/8 : RUN pip install --no-cache-dir numpy~=1.17.5 tensorflow~=2.0.2 flask~=2.1.2 pillow~=7.2.0
  ---> Running in 59edcb9abe7a
 Collecting numpy~=1.17.5
   Downloading numpy-1.17.5.zip (6.4 MB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 3.9 MB/s eta 0:00:00
   Preparing metadata (setup.py): started
   Preparing metadata (setup.py): finished with status 'done'
 ERROR: Ignored the following versions that require a different python version: 1.22.0 Requires-Python >=3.8; 1.22.0rc1 Requires-Python >=3.8; 1.22.0rc2 Requires-Python >=3.8; 1.22.0rc3 Requires-Python >=3.8; 1.22.1 Requires-Python >=3.8; 1.22.2 Requires-Python >=3.8; 1.22.3 Requires-Python >=3.8; 1.22.4 Requires-Python >=3.8; 1.23.0 Requires-Python >=3.8; 1.23.0rc1 Requires-Python >=3.8; 1.23.0rc2 Requires-Python >=3.8; 1.23.0rc3 Requires-Python >=3.8; 1.23.1 Requires-Python >=3.8
 ERROR: Could not find a version that satisfies the requirement tensorflow~=2.0.2 (from versions: none)
 ERROR: No matching distribution found for tensorflow~=2.0.2
 The command '/bin/sh -c pip install --no-cache-dir numpy~=1.17.5 tensorflow~=2.0.2 flask~=2.1.2 pillow~=7.2.0' returned a non-zero code: 1






I'm using Scala in some Docker containers. So, in my containers I have to install Sbt.

FROM colisweb/debian-oracle-java8
MAINTAINER Jules Ivanic

RUN \

  # Install sbt
  echo "deb http://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list \
  && apt-get update \
  && apt-get install -y --force-yes sbt \

  && sbt --version

At the end, I print the sbt version. 

If I let this last line my docker build fail with the following error : 

INFO[0061] The command [/bin/sh -c echo "deb http://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list   && apt-get update   && apt-get install -y --force-yes sbt   && sbt --version] returned a non-zero code: 1


If i remove this last line, my docker build is OK.


Why do "sbt --version" return a non-zero code ??

Jules

What is a non zero code?

Non-zero return codes are normally used for failure cases, with a zero return code used for a successful command, so this can give the impression that the command has failed when it has not.

How do I remove a docker image?

To remove the image, you first need to list all the images to get the Image IDs, Image name and other details. By running simple command docker images -a or docker images . After that you make sure which image want to remove, to do that executing this simple command docker rmi <your-image-id> .