Can't complete push due to a non-zero code


I found the office lock project and wanted to build it myself. So I got all the parts listed, followed the instructions, but when I try to push the code with Git Bash, I get an error (see log below). I already tried pushing example projects, which worked fine. Can someone tell me how I could fix this?

XXX@DESKTOP-PT5CEMU MINGW64 ~/office-lock (master)
$ git push resin master
Enter passphrase for key ‘/c/Users/XXX/.ssh/id_rsa’:
Enumerating objects: 57, done.
Counting objects: 100% (57/57), done.
Delta compression using up to 4 threads
Compressing objects: 100% (53/53), done.
Writing objects: 100% (57/57), 1.72 MiB | 9.08 MiB/s, done.
Total 57 (delta 23), reused 0 (delta 0)

[Info] Starting build for deurslot, user gh_MYGITHUB
[Info] Dashboard link:
[Info] Building on arm03
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images
[main] Step 1/10 : FROM resin/raspberrypi3-python
[main] —> dfb9f19a0cc0
[main] Step 2/10 : RUN apt-get update && apt-get install -yq build-essential python-dev git scons swig && apt-get clean && rm -rf /var/lib/apt/lists/*
[main] —> Running in a2da5dbfe719
[main] Get:1 jessie InRelease [22.9 kB]
[main] Get:2 jessie/updates InRelease [44.9 kB]
[main] Get:3 jessie InRelease [14.9 kB]
[main] Ign jessie InRelease
[main] Get:4 jessie-updates InRelease [145 kB]
[main] Get:5 jessie Release.gpg [2420 B]
[main] Get:6 jessie Release [148 kB]
[main] Get:7 jessie/updates/main armhf Packages [640 kB]
[main] Get:8 jessie/main armhf Packages [13.3 MB]
[main] Get:9 jessie/main armhf Packages [171 kB]
[main] Get:10 jessie/contrib armhf Packages [49.5 kB]
[main] Get:11 jessie/non-free armhf Packages [101 kB]
[main] Get:12 jessie/rpi armhf Packages [1297 B]
[main] Get:13 jessie/firmware armhf Packages [1208 B]
[main] Get:14 jessie-updates/main armhf Packages [23.1 kB]
[main] Get:15 jessie/main armhf Packages [8898 kB]
[main] Fetched 23.6 MB in 10s (2210 kB/s)
[main] Reading package lists…
[main] Reading package lists…
[main] Building dependency tree…
[main] Reading state information…
[main] build-essential is already the newest version.
[main] git is already the newest version.
[main] The following extra packages will be installed:
[main] libexpat1-dev libpython-dev libpython2.7 libpython2.7-dev python2.7-dev
[main] swig2.0
[main] Suggested packages:
[main] swig-doc swig-examples swig2.0-examples swig2.0-doc
[main] The following NEW packages will be installed:
[main] libexpat1-dev libpython-dev libpython2.7 libpython2.7-dev python-dev
[main] python2.7-dev scons swig swig2.0
[main] 0 upgraded, 9 newly installed, 0 to remove and 11 not upgraded.
[main] Need to get 21.2 MB of archives.
[main] After this operation, 34.4 MB of additional disk space will be used.
[main] Get:1 jessie/updates/main libpython2.7 armhf 2.7.9-2+deb8u2 [950 kB]
[main] Get:2 jessie/updates/main libpython2.7-dev armhf 2.7.9-2+deb8u2 [18.0 MB]
[main] Get:3 jessie/updates/main python2.7-dev armhf 2.7.9-2+deb8u2 [284 kB]
[main] Get:4 jessie/main libexpat1-dev armhf 2.1.0-6+deb8u4 [115 kB]
[main] Get:5 jessie/main libpython-dev armhf 2.7.9-1 [19.7 kB]
[main] Get:6 jessie/main python-dev armhf 2.7.9-1 [1180 B]
[main] Get:7 jessie/main scons all 2.3.1-2 [518 kB]
[main] Get:8 jessie/main swig2.0 armhf 2.0.12-1 [1077 kB]
[main] Get:9 jessie/main swig armhf 2.0.12-1 [285 kB]
[main] debconf: delaying package configuration, since apt-utils is not installed
[main] Fetched 21.2 MB in 1s (18.7 MB/s)
[main] Selecting previously unselected package libpython2.7:armhf.
[main] (Reading database …
(Reading database … 50%ase … 5%
(Reading database … 70%ase … 55%
[main] (Reading database … 75%
[main] (Reading database … 80%
[main] (Reading database … 85%
[main] (Reading database … 90%
[main] (Reading database … 95%
(Reading database … 18339 files and directories currently installed.)
[main] Preparing to unpack …/libpython2.7_2.7.9-2+deb8u2_armhf.deb …
[main] Unpacking libpython2.7:armhf (2.7.9-2+deb8u2) …
[main] Selecting previously unselected package libexpat1-dev:armhf.
[main] Preparing to unpack …/libexpat1-dev_2.1.0-6+deb8u4_armhf.deb …
[main] Unpacking libexpat1-dev:armhf (2.1.0-6+deb8u4) …
[main] Selecting previously unselected package libpython2.7-dev:armhf.
[main] Preparing to unpack …/libpython2.7-dev_2.7.9-2+deb8u2_armhf.deb …
[main] Unpacking libpython2.7-dev:armhf (2.7.9-2+deb8u2) …
[main] Selecting previously unselected package libpython-dev:armhf.
[main] Preparing to unpack …/libpython-dev_2.7.9-1_armhf.deb …
[main] Unpacking libpython-dev:armhf (2.7.9-1) …
[main] Selecting previously unselected package python2.7-dev.
[main] Preparing to unpack …/python2.7-dev_2.7.9-2+deb8u2_armhf.deb …
[main] Unpacking python2.7-dev (2.7.9-2+deb8u2) …
[main] Selecting previously unselected package python-dev.
[main] Preparing to unpack …/python-dev_2.7.9-1_armhf.deb …
[main] Unpacking python-dev (2.7.9-1) …
[main] Selecting previously unselected package scons.
[main] Preparing to unpack …/archives/scons_2.3.1-2_all.deb …
[main] Unpacking scons (2.3.1-2) …
[main] Selecting previously unselected package swig2.0.
[main] Preparing to unpack …/swig2.0_2.0.12-1_armhf.deb …
[main] Unpacking swig2.0 (2.0.12-1) …
[main] Selecting previously unselected package swig.
[main] Preparing to unpack …/swig_2.0.12-1_armhf.deb …
[main] Unpacking swig (2.0.12-1) …
[main] Setting up libpython2.7:armhf (2.7.9-2+deb8u2) …
[main] Setting up libexpat1-dev:armhf (2.1.0-6+deb8u4) …
[main] Setting up libpython2.7-dev:armhf (2.7.9-2+deb8u2) …
[main] Setting up libpython-dev:armhf (2.7.9-1) …
[main] Setting up python2.7-dev (2.7.9-2+deb8u2) …
[main] Setting up python-dev (2.7.9-1) …
[main] Setting up scons (2.3.1-2) …
[main] Setting up swig2.0 (2.0.12-1) …
[main] Setting up swig (2.0.12-1) …
[main] Processing triggers for libc-bin (2.19-18+deb8u10) …
[main] —> a31870ea717c
[main] Removing intermediate container a2da5dbfe719
[main] Step 3/10 : WORKDIR /usr/src/app
[main] —> b71b22adde1b
[main] Removing intermediate container d8a00a6b759e
[main] Step 4/10 : RUN git clone && cd rpi_ws281x && scons && cd python && python install
[main] —> Running in 43031e5ce588
[main] Cloning into ‘rpi_ws281x’…
[main] scons: Reading SConscript files …
[main] scons: done reading SConscript files.
[main] scons: Building targets …
[main] Version version.h
[main] CC main.o
[main] CC mailbox.o
[main] CC ws2811.o
[main] CC pwm.o
[main] CC pcm.o
[main] CC dma.o
[main] CC rpihw.o
[main] AR libws2811.a
[main] RANLIB libws2811.a
[main] LINK test
[main] scons: done building targets.
[main] Downloading
[main] Extracting in /tmp/tmpnvKGDR
[main] Traceback (most recent call last):
[main] File “”, line 4, in
[main] use_setuptools()
[main] File “/usr/src/app/rpi_ws281x/python/”, line 140, in use_setuptools
[main] return _do_download(version, download_base, to_dir, download_delay)
[main] File “/usr/src/app/rpi_ws281x/python/”, line 120, in _do_download
[main] _build_egg(egg, archive, to_dir)
[main] File “/usr/src/app/rpi_ws281x/python/”, line 62, in _build_egg
[main] with archive_context(archive_filename):
[main] File “/usr/local/lib/python2.7/”, line 17, in enter
[main] return
[main] File “/usr/src/app/rpi_ws281x/python/”, line 100, in archive_context
[main] with ContextualZipFile(filename) as archive:
[main] File “/usr/src/app/rpi_ws281x/python/”, line 88, in new
[main] return zipfile.ZipFile(*args, **kwargs)
[main] File “/usr/local/lib/python2.7/”, line 770, in init
[main] self._RealGetContents()
[main] File “/usr/local/lib/python2.7/”, line 811, in _RealGetContents
[main] raise BadZipfile, “File is not a zip file”
[main] zipfile.BadZipfile: File is not a zip file
[main] Removing intermediate container 43031e5ce588
[main] The command ‘/bin/sh -c git clone && cd rpi_ws281x && scons && cd python && python install’ returned a non-zero code: 1
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command ‘/bin/sh -c git clone && cd rpi_ws281x && scons && cd python && python install’ returned a non-zero code: 1
[Error] Not deploying release.

remote: error: hook declined to update refs/heads/master
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to ‘’


Hi @NLHansGunther, welcome to the forums!

In the Dockerfile.template for this project, try changing the line from:
FROM resin/%%RESIN_MACHINE_NAME%%-python to FROM resin/%%RESIN_MACHINE_NAME%%-python:wheezy and try the push again.

Let us know how you get on.


Yes, this solved the problem!

Thanks for looking into this and providing a solution!