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


#1

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: https://dashboard.resin.io/apps/MYDASHBOARD/devices
[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 http://archive.raspberrypi.org jessie InRelease [22.9 kB]
[main] Get:2 http://security.debian.org jessie/updates InRelease [44.9 kB]
[main] Get:3 http://archive.raspbian.org jessie InRelease [14.9 kB]
[main] Ign http://deb.debian.org jessie InRelease
[main] Get:4 http://deb.debian.org jessie-updates InRelease [145 kB]
[main] Get:5 http://deb.debian.org jessie Release.gpg [2420 B]
[main] Get:6 http://deb.debian.org jessie Release [148 kB]
[main] Get:7 http://security.debian.org jessie/updates/main armhf Packages [640 kB]
[main] Get:8 http://archive.raspbian.org jessie/main armhf Packages [13.3 MB]
[main] Get:9 http://archive.raspberrypi.org jessie/main armhf Packages [171 kB]
[main] Get:10 http://archive.raspbian.org jessie/contrib armhf Packages [49.5 kB]
[main] Get:11 http://archive.raspbian.org jessie/non-free armhf Packages [101 kB]
[main] Get:12 http://archive.raspbian.org jessie/rpi armhf Packages [1297 B]
[main] Get:13 http://archive.raspbian.org jessie/firmware armhf Packages [1208 B]
[main] Get:14 http://deb.debian.org jessie-updates/main armhf Packages [23.1 kB]
[main] Get:15 http://deb.debian.org 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 http://security.debian.org/debian-security/ jessie/updates/main libpython2.7 armhf 2.7.9-2+deb8u2 [950 kB]
[main] Get:2 http://security.debian.org/debian-security/ jessie/updates/main libpython2.7-dev armhf 2.7.9-2+deb8u2 [18.0 MB]
[main] Get:3 http://security.debian.org/debian-security/ jessie/updates/main python2.7-dev armhf 2.7.9-2+deb8u2 [284 kB]
[main] Get:4 http://deb.debian.org/debian/ jessie/main libexpat1-dev armhf 2.1.0-6+deb8u4 [115 kB]
[main] Get:5 http://deb.debian.org/debian/ jessie/main libpython-dev armhf 2.7.9-1 [19.7 kB]
[main] Get:6 http://deb.debian.org/debian/ jessie/main python-dev armhf 2.7.9-1 [1180 B]
[main] Get:7 http://deb.debian.org/debian/ jessie/main scons all 2.3.1-2 [518 kB]
[main] Get:8 http://deb.debian.org/debian/ jessie/main swig2.0 armhf 2.0.12-1 [1077 kB]
[main] Get:9 http://deb.debian.org/debian/ jessie/main swig armhf 2.0.12-1 [285 kB]
[main] debconf: delaying package configuration, since apt-utils is not installed
[main]
[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 https://github.com/MYGITHUB/rpi_ws281x && cd rpi_ws281x && scons && cd python && python setup.py install
[main] —> Running in 43031e5ce588
[main] Cloning into ‘rpi_ws281x’…
[main]
[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 https://pypi.python.org/packages/source/s/setuptools/setuptools-40.4.3.zip
[main]
[main] Extracting in /tmp/tmpnvKGDR
[main]
[main] Traceback (most recent call last):
[main] File “setup.py”, line 4, in
[main] use_setuptools()
[main] File “/usr/src/app/rpi_ws281x/python/ez_setup.py”, line 140, in use_setuptools
[main] return _do_download(version, download_base, to_dir, download_delay)
[main] File “/usr/src/app/rpi_ws281x/python/ez_setup.py”, line 120, in _do_download
[main] _build_egg(egg, archive, to_dir)
[main] File “/usr/src/app/rpi_ws281x/python/ez_setup.py”, line 62, in _build_egg
[main] with archive_context(archive_filename):
[main] File “/usr/local/lib/python2.7/contextlib.py”, line 17, in enter
[main] return self.gen.next()
[main] File “/usr/src/app/rpi_ws281x/python/ez_setup.py”, line 100, in archive_context
[main] with ContextualZipFile(filename) as archive:
[main] File “/usr/src/app/rpi_ws281x/python/ez_setup.py”, line 88, in new
[main] return zipfile.ZipFile(*args, **kwargs)
[main] File “/usr/local/lib/python2.7/zipfile.py”, line 770, in init
[main]
[main] self._RealGetContents()
[main] File “/usr/local/lib/python2.7/zipfile.py”, line 811, in _RealGetContents
[main]
[main] raise BadZipfile, “File is not a zip file”
[main] zipfile.BadZipfile: File is not a zip file
[main]
[main] Removing intermediate container 43031e5ce588
[main] The command ‘/bin/sh -c git clone https://github.com/MYGITHUB/rpi_ws281x && cd rpi_ws281x && scons && cd python && python setup.py 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 https://github.com/MYGITHUB/rpi_ws281x && cd rpi_ws281x && scons && cd python && python setup.py install’ returned a non-zero code: 1
[Error] Not deploying release.

remote: error: hook declined to update refs/heads/master
To git.resin.io:gh_MYGITHUB/deurslot.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to ‘gh_MYGITHUB@git.resin.io:gh_MYGITHUB/deurslot.git’


#4

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.


#5

Yes, this solved the problem!

Thanks for looking into this and providing a solution!