Build getting failed in balena-os / balena-raspberrypi

Getting compilation failed on Balena-os/Balena-raspberrypi.

while executing below command

  • Running the build script: ./balena-yocto-scripts/build/barys

Resin specific images available:
balena-image

Balena Fin (CM3) : $ MACHINE=fincm3 bitbake balena-image
NPE X500 M3 : $ MACHINE=npe-x500-m3 bitbake balena-image
Raspberry Pi Zero 2 W (64bit) : $ MACHINE=raspberrypi0-2w-64 bitbake balena-image
Raspberry Pi 2 : $ MACHINE=raspberrypi2 bitbake balena-image
Raspberry Pi 3 (using 64bit OS) : $ MACHINE=raspberrypi3-64 bitbake balena-image
Raspberry Pi 3 : $ MACHINE=raspberrypi3 bitbake balena-image
UniPi Neuron (Raspberry Pi 3) (NEW) : $ MACHINE=raspberrypi3-unipi-neuron bitbake balena-image
Raspberry Pi 400 (NEW) : $ MACHINE=raspberrypi400-64 bitbake balena-image
Raspberry Pi 4 : $ MACHINE=raspberrypi4-64 bitbake balena-image
UniPi Neuron (Raspberry Pi 4) (NEW) : $ MACHINE=raspberrypi4-unipi-neuron bitbake balena-image
Raspberry Pi CM4 IO Board (NEW) : $ MACHINE=raspberrypicm4-ioboard bitbake balena-image
Raspberry Pi (v1 / Zero / Zero W) : $ MACHINE=raspberrypi bitbake balena-image
Revolution Pi Connect (NEW) : $ MACHINE=revpi-connect bitbake balena-image
Revolution Pi Core 3 : $ MACHINE=revpi-core-3 bitbake balena-image
Rocktech-RPI-300 (NEW) : $ MACHINE=rt-rpi-300 bitbake balena-image

[000000004][LOG]Release kirkstone already supported by device integration layer, will not revert meta-balena-common syntax.
[000000004][LOG]BalenaOS build initialized in directory: build.
[000000004][LOG]Run build for fincm3: MACHINE=fincm3 bitbake balena-image
[000000004][LOG]This might take a while …
Loading cache: 100% |#######################################################################################################################################################################| Time: 0:00:00
Loaded 2943 entries from dependency cache.
ERROR: /keus_base/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-containers/docker-disk/docker-disk.bb: docker-disk: Docker needs to run on your host and current user must be able to use it.
ERROR: Parsing halted due to errors, see error messages above#### | ETA: 0:00:07

Summary: There were 2 ERROR messages, returning a non-zero exit code.
[000000010][LOG]Build for fincm3 failed. Check failed log in build/tmp/log/cooker/fincm3 .
[000000010][LOG]Run build for npe-x500-m3: MACHINE=npe-x500-m3 bitbake balena-image
[000000010][LOG]This might take a while …
Loading cache: 100% |#######################################################################################################################################################################| Time: 0:00:00
Loaded 1227 entries from dependency cache.
ERROR: /keus_base/balena-raspberrypi/build/…/layers/meta-balena/meta-balena-common/recipes-containers/docker-disk/docker-disk.bb: docker-disk: Docker needs to run on your host and current user must be able to use it.
ERROR: Parsing halted due to errors, see error messages above

Hi Varma,

As the errors says, the build is not able to find a docker engine installed.

Docker needs to run on your host and current user must be able to use it.

So please install docker as explained in Install Docker Engine

Hi Alex,

I have already installed Docker in Linux machine and inside docker image i am running raspberrypi project.

varma@dockerid:/base/balena-raspberrypi$ ./balena-yocto-scripts/build/barys

I’ve had similar issues trying to build in a container using host docker. Is your docker socket volume bound into the container, and do the IDs match for the docker group inside the container and on your host?

I’m also interested to see if once you get past this issue you run into where I’m stuck.

@Alex I have installed Docker Engine still i am facing the same issue.

DEBUG: Executing shell function do_compile
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 219B done
#2 DONE 0.0s

#3 [internal] load metadata for Docker
#3 ERROR: failed to authorize: failed to fetch anonymous token: Get “https://auth.docker.io/token?scope=repository%3Alibrary%2Fdebian%3Apull&service=registry.docker.io”: dial tcp: lookup auth.docker.io on 192.168.123.1:53: dial udp 192.168.123.1:53: connect: network is unreachable

[internal] load metadata for Docker


Dockerfile:1

1 | >>> FROM debian:stretch
2 |
3 | VOLUME /mnt/sysroot/inactive

ERROR: failed to solve: failed to fetch anonymous token: Get “https://auth.docker.io/token?scope=repository%3Alibrary%2Fdebian%3Apull&service=registry.docker.io”: dial tcp: lookup auth.docker.io on 192.168.123.1:53: dial udp 192.168.123.1:53: connect: network is unreachable
Error response from daemon: invalid reference format
WARNING: /home/balena-raspberrypi/build/tmp/work/x86_64-linux/mkfs-hostapp-native/1.0-r0/temp/run.do_compile.19123:153 exit 1 from ‘DOCKER_API_VERSION=1.22 docker save “$IMAGE_ID” > /home/balena-raspberrypi/build/tmp/work/x86_64-linux/mkfs-hostapp-native/1.0-r0/work/mkfs-hostapp-image.tar’
WARNING: Backtrace (BB generated script):
#1: do_compile, /home/balena-raspberrypi/build/tmp/work/x86_64-linux/mkfs-hostapp-native/1.0-r0/temp/run.do_compile.19123, line 153
#2: main, /home/balena-raspberrypi/build/tmp/work/x86_64-linux/mkfs-hostapp-native/1.0-r0/temp/run.do_compile.19123, line 160
~

Hi, that’s not the same problem. The docker engine is now installed, bu the network seems to be unreachable:

tcp: lookup auth.docker.io on 192.168.123.1:53: dial udp 192.168.123.1:53: connect: network is unreachable

Please make sure you are not behind a firewall or proxy that blocks internet access (note that building balenaOS is not supported behind a proxy)

192.168.123.1:53 is a local IP address, that’s why I mention the proxy.

Make sure your host is able to pull docker images docker pull debian:strech

ERROR: os-helpers-1.0-r0 do_test_api: os-helpers: API request failed

@alexgg

Have you found a solution? @varma

This is the build system testing a function that is then used in the target balenaOS - it actually fails the build if it can’t access the API which was a wrong decision that has been corrected in os-helpers: do not fail build if API tests fail · balena-os/meta-balena@933f265 · GitHub.
Anyway, just making sure you can access api.balena-cloud.com and rebuilding should work.