Problem building balena-sense for open-balena

Hi all,

I’m trying to build the balena-sense example to deploy to an open-balena instance

https://github.com/balena-io-projects/balena-sense

Command line is

DEBUG=1 balena deploy does-rpi3-mqtt --logs --source . --emulated

I get this error

ajlennon@ajlennon-VirtualBox:~/git/balena-sense$ DEBUG=1 balena deploy does-rpi3-mqtt --logs --source . --emulated --build
[Debug]   Parsing input...
[Debug]   Loading project...
[Debug]   Resolving project...
[Info]    Compose file detected
[Debug]   Creating project...
[Info]    Building for armv7hf/raspberrypi3
[Build]   Building services...
[Build]   influxdb Preparing...
[Build]   grafana  Preparing...
[Build]   sensor   Preparing...
[Info]    Emulation is enabled
[Debug]   Found build tasks:
[Debug]       influxdb: build [./influxdb]
[Debug]       grafana: build [./grafana]
[Debug]       sensor: build [./sensor]
[Debug]   Resolving services with [raspberrypi3|armv7hf]
[Debug]   Found project types:
[Debug]       influxdb: Dockerfile.template
[Debug]       grafana: Dockerfile.template
[Debug]       sensor: Dockerfile.template
[Debug]   Prepared tasks; building...
[Build]   influxdb Step 1/5 : FROM balenalib/raspberrypi3-alpine
[Build]   influxdb  ---> 0c148310ed5a
[Build]   influxdb Step 2/5 : COPY [".balena/qemu-execve","/tmp/qemu-execve"]
[Build]   sensor   Step 1/12 : FROM balenalib/raspberrypi3-python:build
[Build]   sensor    ---> b8d123de94cf
[Build]   influxdb  ---> Using cache
[Build]   influxdb  ---> 875155da79e4
[Build]   influxdb Step 3/5 : RUN ["/tmp/qemu-execve","-execve","/bin/sh","-c","apk add influxdb"]
[Build]   influxdb  ---> Using cache
[Build]   influxdb  ---> 23bf7abc4911
[Build]   influxdb Step 4/5 : RUN ["/tmp/qemu-execve","-execve","/bin/sh","-c","sed -i 's|/var/lib/influxdb|/data/influxdb|g' /etc/influxdb/influxdb.conf"]
[Build]   influxdb  ---> Using cache
[Build]   sensor   Step 2/12 : COPY [".balena/qemu-execve","/tmp/qemu-execve"]
[Build]   sensor    ---> Using cache
[Build]   sensor    ---> 364fe82f9fa8
[Build]   sensor   Step 3/12 : WORKDIR /tmp
[Build]   sensor    ---> Using cache
[Build]   sensor    ---> 22bf5d20b72c
[Build]   sensor   Step 4/12 : RUN ["/tmp/qemu-execve","-execve","/bin/sh","-c","git clone https://github.com/RPi-Distro/RTIMULib/ RTIMU"]
[Build]   sensor    ---> Using cache
[Build]   sensor    ---> 80ecf9993a3b
[Build]   sensor   Step 5/12 : WORKDIR /tmp/RTIMU/Linux/python
[Build]   sensor    ---> Using cache
[Build]   influxdb  ---> 6d888e810b15
[Build]   influxdb Step 5/5 : CMD influxd
[Build]   influxdb  ---> Using cache
[Build]   influxdb  ---> ba960b9b11e6
[Build]   influxdb Successfully built ba960b9b11e6
[Build]   influxdb Successfully tagged balena-sense_influxdb:latest
[Error]   Deploy failed
Error: (HTTP code 400) unexpected - Dockerfile parse error line 8: unknown instruction: CURL 
    at /usr/lib/node_modules/balena-cli/node_modules/docker-modem/lib/modem.js:257:17
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/balena-cli/node_modules/docker-modem/lib/modem.js:284:9)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)

If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/

Can anybody help?

Thanks!

Alex

Hello @ajlennon, I managed to reproduce with CLI v9.9.0 and it seems unrelated to openBalena. I’ll dig into this a bit more and see what’s wrong. It’s a mammoth project to build and under emulation many things can go wrong but I’ll know more soon and let you know.

In the meantimeI think it might be this comment line that is causing issues in some cases, can you try to remove this line and retry balena deploy?

That might unblock you at the moment, while we are working on the issue.

Will do. Thanks guys. Wasn’t too sure where to post this one as it felt like it might be a wider thing. Thanks for picking it up.

(I’d be everlastingly grateful if you could give me some tips on what’s going wrong with the dashboard example I posted on a few days ago!)

OK that seems to fix it thanks guys! Problem parsing comments then?

Exactly, this is an issue on the Dockerfile parser we use to determine the RUN steps and inject qemu. I’ve merged a workaround on the balena-sense repository, so if you pull master you shouldn’t need to run a modified checkout. Thanks for reaching out!

1 Like

Forgot to mention – I’ve also pinged a couple of colleagues to look into the other issue you have in the other thread. We’ll get back to you there as soon as we make progress.

1 Like

Great stuff. Had some success with the containers running on an RPi. here I’m modifying the Balena example code to run a Mosquitto container and to store MQtt messages to InfluxDB. We’ve instrumented a load of machines here @DoESLiverpool with Sonoff Pow R2 WiFi devices to monitor power consumption and the plan is to persist and analyse the data.

Repo is getting built up here

Thanks for the help!

1 Like

Thanks on the dashboard thing. If/when I get that going we’ll have the Grafana stuff displaying on an LCD on the RPi in our workspace :wink: