Influxdb fails to build while pushing balena-sense-master project to raspberrypi 2

Hi guys, i am quite a noob when it comes to this kind of programming…
But i want to give it a try to ask for help, otherwise i have to give up because i am struggling for days allready.

My setup: Raspberry pi 2 model B V1.1, with connected BME680 sensor.
I am working on a windows machine, and am using the standard windows CMD.exe command prompt…

i have been following the website steps:

i got stuck at step 3; for pushing the balena-sense-master to the device.
When i push the software i got the error “Some services failed to build: Service: influxdb”
“Error: The command ‘/bin/sh -c sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb/influxdb.conf’ returned a non-zero code: 1”

what i have tried for now:
within the balena-sense-master project code folder there is another folder with the name “influxdb”, within this folder there are two documents “Dockerfile.aarch64” and “Dockerfile.template”.

  • i have tried to run “balena push -application name- --nocache”
  • i have tried to change “RUN sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb/influxdb.conf” to “RUN sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb.conf”.
  • i have tried to change “FROM balenalib/raspberrypi3-alpine” to “FROM balenalib/raspberrypi2-alpine”
  • i have tried to change “CMD [“influxd”]” to “CMD [“influxdb”]”
  • i have tried to search within my raspberry pi 2 for the “influxdb.conf” file by logging in to an HOST OS (via the Balena cloud) online terminal. it seems to be that also i can not find this config file for influxdb… but i am a noob so maybe at this point, these file does not suppose to be there yet?!

Please help me with this, i would like to get this project working…

Logging code after i push the software:
[Info] Starting build for AQ_Monitor_V1, user **********
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/1570376/devices
[Info] Building on arm03
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images
[influxdb] Step 1/4 : FROM balenalib/raspberry-pi2-alpine
[telegraf] Step 1/8 : FROM balenalib/raspberry-pi2:buster
[sensor] Step 1/18 : FROM balenalib/raspberry-pi2-python:3-build
[grafana] Step 1/9 : FROM balenalib/raspberry-pi2:buster
[telegraf] —> 912f56bad60b
[telegraf] Step 2/8 : COPY ./.sh /usr/src/app/
[influxdb] —> 9efd08105586
[influxdb] Step 2/4 : RUN apk add influxdb
[sensor] —> e8d7752240b1
[sensor] Step 2/18 : ARG BSEC_FILENAME=BSEC_1.4.7.4_Generic_Release.zip
[grafana] —> 912f56bad60b
[grafana] Step 2/9 : COPY ./grafana.ini /usr/share/grafana/conf/custom.ini
[influxdb] —> Running in eebe620c9a96
[sensor] —> Running in 475dfefa2ed7
[sensor] Removing intermediate container 475dfefa2ed7
[sensor] —> ffc880556a44
[sensor] Step 3/18 : RUN install_packages unzip
[grafana] —> 03a65f6ff3c0
[grafana] Step 3/9 : COPY ./provisioning /usr/src/app/provisioning
[telegraf] —> 939e399c8395
[telegraf] Step 3/8 : RUN chmod +x /usr/src/app/
.sh
[sensor] —> Running in 1da12e213c5c
[telegraf] —> Running in a8d09a50715d
[influxdb] fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/armv7/APKINDEX.tar.gz
[influxdb] fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/armv7/APKINDEX.tar.gz
[grafana] —> 64f586b0262c
[grafana] Step 4/9 : COPY ./.sh /usr/src/app/
[influxdb] (1/1) Installing influxdb (1.7.7-r0)
[influxdb] Executing influxdb-1.7.7-r0.pre-install
[influxdb] Executing busybox-1.31.1-r9.trigger
[influxdb] OK: 201 MiB in 74 packages
[grafana] —> 924e4f24aa60
[grafana] Step 5/9 : RUN chmod +x /usr/src/app/
.sh
[grafana] —> Running in 46c9bfbd4e1e
[telegraf] Removing intermediate container a8d09a50715d
[telegraf] —> 6f4349849537
[telegraf] Step 4/8 : RUN install_packages wget
[telegraf] —> Running in dcdeb3739ff8
[influxdb] Removing intermediate container eebe620c9a96
[influxdb] —> 5c6b539474c9
[influxdb] Step 3/4 : RUN sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb/influxdb.conf
[influxdb] —> Running in 41ef11bad15e
[grafana] Removing intermediate container 46c9bfbd4e1e
[grafana] —> 6ec2c297c5d5
[grafana] Step 6/9 : RUN install_packages fontconfig-config fonts-dejavu-core libfontconfig1 ucf jq wget
[grafana] —> Running in c9e7897d7fe5
[influxdb] sed: /etc/influxdb/influxdb.conf: No such file or directory
[influxdb]
[influxdb] Removing intermediate container 41ef11bad15e
[influxdb] The command ‘/bin/sh -c sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb/influxdb.conf’ returned a non-zero code: 1

and the logging ends by:
[Error] Some services failed to build:
[Error] Service: influxdb
[Error] Error: The command ‘/bin/sh -c sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb/influxdb.conf’ returned a non-zero code: 1
[Info] Built on arm03
[Error] Not deploying release.

Hello Ben, I am sorry to hear about the trouble you are having deploying balenaSense. I attempted to build this project myself just now, and it seemed to work properly, although admittedly my build environment is slightly different than yours. I was using an Ubuntu Linux machine, and a Raspberry Pi 3 target device.

However, with that said, can you try undoing any changes you have made to your local copy of balenaSense, and start with a freshly cloned project from GitHub? I do realize that you are using a RaspPi2, and the Dockerfile that is downloaded from GitHub specifically identifies a container name that includes Raspberry Pi 3, but both of those devices share a similar processor, so I’d like to see if you are successful when trying a fresh, unaltered copy of the project. Let us know how that goes, thanks!

1 Like

Hi David, thank you for your reply. i just downloaded a fresh copy of the project from Github, and it seems to be the error’s are now different…

first error messages i see, are the following:
[sensor] 91mGnuTLS: Error in the pull function.
[sensor]91mUnable to establish SSL connection.
[Success]39m Successfully uploaded images
[Error]39m Some services failed to build:
[Error]39m Service: sensor
[Error]39m Error: The command ‘/bin/sh -c wget https://ae-bst.resource.bosch.com/media/_tech/media/bsec/$BSEC_FILENAME’ returned a non-zero code: 4
[Info]39m Built on arm03
[Error]39m Not deploying release.

[sensor] debconf: delaying package configuration, since apt-utils is not installed
[sensor] WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.

at the end:
[sensor] Removing intermediate container aef10f0cd692
[sensor] —> 65b57390ebf3
[sensor] Successfully built 65b57390ebf3
[Info] Uploading images
[Error] An error occured: (HTTP code 404) no such image - no such image: arm32v6/eclipse-mosquitto:latest: No such image: arm32v6/eclipse-mosquitto:latest
[Info] Built on arm03
[Error] Not deploying release.
[======================> ] 44%Remote build failed

(node:14752) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

The build log of balena-cloud is showing the following:
[Info] Building on arm03
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images
[Info] Starting to build influxdb
[Info] Starting to build sensor
[Info] Starting to build grafana
[Info] Starting to build telegraf
[Success] Successfully built service influxdb
[Success] Successfully built service telegraf
[Success] Successfully built service grafana
[Success] Successfully built service sensor
[Info] Uploading images
[Error] An error occured: (HTTP code 404) no such image - no such image: arm32v6/eclipse-mosquitto:latest: No such image: arm32v6/eclipse-mosquitto:latest

Allready while writing an Update:

after 3 attempts, pushing the code; now it worked surprisingly…
1st time i tried: balena push project --nocache (there was to much CMD output that the first output got overwritten, so i was not able to lookup the first error info)
2nd time i tried: balena push project --nocache > C:\Users\Projects\OUTPUT.txt | type C:\Users\Projects\OUTPUT.txt
3rd time i tried to update pip, based on the warning messages;
pip install --upgrade pip
python -m pip install -U pip
balena push project --nocache

during the final push, i tried to scroll back to the first messages and with this it seemd to be that the push got delaid by doing this… i scrolled back a few times.

at the end i got the succedeed message!
now it works at the moment.
i hope i can repeat this step the next time.

thanks for the help for now!!

Hello @bendonders, glad you got it working. Just for future reference, it looks like you were experiencing an issue where your project gets converted to Windows line endings when using Git on Windows. You can instead download the zip file and once expanded, push those files, or see more options in the comments of this thread: piHole webinterface not reachable

1 Like

Hi Alan, thanks for your respond and your additional advice for the future… that was also the question that i had left… so thanks a lot for the support!

Hi @bennos, just a quick note that we merged the fix to balena-cli addressing the line ending conversion on Windows: https://github.com/balena-io/balena-cli/pull/1583

Thanks for reporting it.

Cheers…

1 Like

Thank you very much, my compliments for the outstanding support quality! :pray:t3::grin:

Hi there,

Seems I have a similar issue - Influxdb fails to build when pushing balena-sense to a raspberry pi zero w. Although I have read through this thread and tried to fix it, I am using OSX, so perhaps the fix is different?

The crux seems to be:

[Error] Some services failed to build:
[Error] Service: influxdb
[Error] Error: The command ‘/bin/sh -c apk add influxdb’ returned a non-zero code: 1
[Error] Service: sensor
[Error] Error: The command ‘/bin/sh -c pip install smbus w1thermsensor enviroplus RPi.GPIO’ returned a non-zero code: 2

The sensor error only appeared after I re-downloaded the balena-sense files, which is really strange, since it was the same zip file that I downloaded both times.

There is also another message: “WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.”

I tried re-downloading balena-sense but didn’t fix it.
I tried changing from zsh to shell but didn’t fix it.
I tried installing homebrew but didn’t fix it.
I tried installing “Oh my zsh” but didn’t fix it.
This is my first project of this type so even using Github is new for me, and I also wasn’t able to figure out how to add Oh my zsh to to the path permanently.

Any pointers in the right direction for how to fix this so that I can compile would be greatly appreciated.

I have also attached a full log of what happened… balena push balena-sense-enviropi-1 --nocache.log (258.6 KB)

Hi @metho

Thanks for your query! To enable us to better assist you in this matter, can you please send us the following information as well:

  • The OSX version on your local machine.
  • The version of balena-clithat you’re running.
  • The exact push command that produced the error messages.
  • The version of the balena-sense project that you’re running (as found in the VERSION file in the root directory of the cloned repository).

Thank you!

Kind regards
Alida

Hi Alida,

Thanks so much for your fast reply and assistance with this! Very much appreciated.

The OSX version on your local machine.

OSX Catalina 10.15.5

The version of balena-clithat you’re running.

11.35.20

The exact push command that produced the error messages.

balena push balena-sense-enviropi-1

then I also tried this which failed:
balena push balena-sense-enviropi-1 --nocache

The version of the balena-sense project that you’re running (as found in the VERSION file in the root directory of the cloned repository).

There was no file called “VERSION” in the root directory - only one called “os-release” containing:

ID="balena-os"
NAME="balenaOS"
VERSION="2.48.0+rev1"
VERSION_ID="2.48.0+rev1"
PRETTY_NAME="balenaOS 2.48.0+rev1"
MACHINE="raspberrypi"
VARIANT="Development"
VARIANT_ID="dev"
META_BALENA_VERSION="2.48.0"

One more thing which is perplexing me… Initially, I thought that the cloned repository contained the balena-sense project (based on the instructions at: Build an air quality monitor with InfluxDB, Grafana, and Docker on a Raspberry Pi
(re-reading it again, there is no mention of any need to compile any code on your local machine), but then again, none of the services loaded (grafana, influxdb, sensor). Since I couldn’t see any of the apps running, I did further research which had me conclude that I may have only created an empty Balena OS on the target device and that I needed to download balena-sense to my computer, and use Balena CLI to compile and push it to the device (as shown in this video: https://www.youtube.com/watch?v=3ByplV6IYUw&t=2321s). Now I have no idea which is correct (and whether my device already has the services on it or not.) Here is a screenshot of the root directory:

Hi

Thanks for the additional information.

  • Looks like you have a recent cli version, so that’s good.
  • The root directory seems good as well. Looks like you have balenaOS on the card alright.
  • About the process - you have to clone the repo or download the zip. Once you are inside the folder, you type in balena push NameOfYourApp. The balena cli will look at the folder, and see a docker compose file. That will help the cli to push the right folders to the balena cloud which will then build the services, and send them over to your device.
  • Now if your device is online on the balena cloud dashboard, and you don’t see any services on it, that means that it is running balenaOS just fine - but it doesn’t have any application on it. That means that any previous balena push command that you might have ran, has failed.

It looks like you have correctly ran the the balena push command from the right directory. And the chances that the directory you unzipped has something missing are very slim.
Can you share support access to the device? Once you enable it, please share the UUID of the device with me as a private message so that I can take a look at the device and see if there’s something else that’s wrong.