Balena CLI suddenly fail: "The requested image's platform (linux/amd64) does not match the detected host platform"

@sophiahaoui did you then update your original Dockerfile to point to your new image? It sounds like it’s still pulling the old image if it’s saying it’s linux/amd64, as I agree, your new one looks correct and is showing linux/arm64. Alternatively share your Dockerfile as my esteemed colleague suggested above :slight_smile:

Hi,
Here are the logs from the attempted build

| Packaging the project source...[Warn]     
[Warn]    -----------------------------------------------------------------------------------------
[Warn]    The following .dockerignore file(s) will not be used:
[Warn]    * /Users/sophiahaoui/NewSunRoad/Solsense/balena/solmon/node_modules/sqlite3/.dockerignore
[Warn]    When --multi-dockerignore (-m) is used, only .dockerignore files at the
[Warn]    root of each service's build context (in a microservices/multicontainer
[Warn]    fleet), plus a .dockerignore file at the overall project root, are used.
[Warn]    See "balena help push" for more details.
[Warn]    -----------------------------------------------------------------------------------------
[Info]     Starting build for customers_gen25, user shaoui
[Info]     Dashboard link: https://dashboard.balena-cloud.com/apps/1811933/devices
[Info]     Building on arm01
[Info]     Pulling previous images for caching purposes...
[Success]  Successfully pulled cache images
[solmon]   Step 1/30 : FROM sophiahaoui/raspberrypi4-64-ubuntu-python:3-bionic-build-20200915 as build
[solmon]    ---> 17ea33c69306
[solmon]   Step 2/30 : WORKDIR /usr/src/app
[solmon]   Using cache
[solmon]    ---> 9fbae44e7414
[solmon]   Step 3/30 : COPY /lib/requirements3.txt /lib/requirements3.txt
[solmon]   failed to get destination image "sha256:9fbae44e7414963313d4a0f2ba517eecfe9b39289e5526afebf6d50e79d43b62": image with reference sha256:9fbae44e7414963313d4a0f2ba517eecfe9b39289e5526afebf6d50e79d43b62 was found but does not match the specified platform: wanted linux/arm64/v8, actual: linux/amd64
[Info]     Uploading images
[Success]  Successfully uploaded images
[Error]    Some services failed to build:
[Error]      Service: solmon
[Error]        Error: failed to get destination image "sha256:9fbae44e7414963313d4a0f2ba517eecfe9b39289e5526afebf6d50e79d43b62": image with reference sha256:9fbae44e7414963313d4a0f2ba517eecfe9b39289e5526afebf6d50e79d43b62 was found but does not match the specified platform: wanted linux/arm64/v8, actual: linux/amd64
[Info]     Built on arm01
[Error]    Not deploying release.
Remote build failed

And here are the Dockerfile lines for those first steps that get through:

FROM sophiahaoui/raspberrypi4-64-ubuntu-python:3-bionic-build-20200915 as build
WORKDIR /usr/src/app

COPY /lib/requirements3.txt /lib/requirements3.txt
RUN pip3 install -r /lib/requirements3.txt

Let me know what else would be helpful!
Thanks,
Sophia

@klutchell I did end up creating a new fleet using RPI 3, 32 bit OS. Just to recap, the actual device is a RPI 4 (64 bit).

I was able to push a 32 bit app, but was running into application errors because the container appears to be running as a 64 bit app.

When I started an SSH session in the service and ran uname -a I got the following output:

Linux 57f8136 5.15.34-v8 #1 SMP PREEMPT Tue Apr 19 19:21:26 UTC 2022 aarch64 GNU/Linux

The name of the docker file: Dockerfile.armv7hf

The FROM line: FROM balenalib/raspberrypi3

Hopefully this helps!

Hey @jpayne0061, what were the application errors you were getting at runtime? It’s expected that uname would show the actual architecture of the device, but the armv7 image should have no issues running on aarch64.

Thank you @sophiahaoui, this is very helpful. I’ve been able to reproduce it locally and on our remote builders, and I’m investigating possible solutions. I hope to have more to share soon!

1 Like

@klutchell I am trying to get a camera working, using the picamera package.

The error I get is this: OSError: libbcm_host.so: cannot open shared object file: No such file or directory

After a quick google search, it sounds like this error occurs when trying to use the picamera package on a 64 bit system.

1 Like

Here’s another failing Dockerfile (stripped down from my original but still failing). I had previously been using golang:1.15, but getting this error made me upgrade. Unfortunately, there’s still an error.

FROM --platform=linux/arm64 balenalib/raspberrypi4-64-golang:1.19 as builder
RUN go install -v github.com/mozz100/tohora@v0.3.2
FROM  bh.cr/balenalabs/browser-aarch64
RUN install_packages cec-utils
COPY --from=builder /go/bin/tohora /home/chromium/tohora

Here is how the logs end:

[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: kiosk
[Error] Error: failed to get destination image “sha256:3d5a94136dbf7f4a051c26c37fc56d644152b80809daf306cae51c95be20c272”: image with reference sha256:3d5a94136dbf7f4a051c26c37fc56d644152b80809daf306cae51c95be20c272 was found but does not match the specified platform: wanted linux/arm64/v8, actual: linux/amd64
[Info] Built on arm01
[Error] Not deploying release.
Remote build failed

Hey all, we just released a new version of the remote builders to production that should have addressed all of these issues.

Please let us know if you are still encountering errors like those mentioned above!

We are still having the same issue as @jpayne0061, when trying to use the picamera module.

The error I get is this: OSError: libbcm_host.so: cannot open shared object file: No such file or directory

We are using the image:
FROM balenalib/raspberrypi4-64-debian:latest