# Error on generating artifact Exec format error on Raspberry Pi 4

**URL:** <https://hub.mender.io/t/error-on-generating-artifact-exec-format-error-on-raspberry-pi-4/4256>\
**Category:** General Discussions\
**Created:** [October 30, 2021, 3:07pm UTC](https://hub.mender.io/t/error-on-generating-artifact-exec-format-error-on-raspberry-pi-4/4256 "2021-10-30T15:07:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicoCaldo](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/nicocaldo/32/1409_2.png) [@NicoCaldo](https://hub.mender.io/u/NicoCaldo)\
**Post date:** [October 30, 2021, 3:07pm UTC](https://hub.mender.io/t/error-on-generating-artifact-exec-format-error-on-raspberry-pi-4/4256/1 "2021-10-30T15:07:44Z")

</div>

I got a Raspberry Pi 4 with 4Gb of RAM,

I have correctly followed [this](https://docs.mender.io/development/get-started/deploy-a-container-update) tutorial but at the end, when I try to create the artifact with

```auto
./docker-artifact-gen \
    -n "hello-world-container-update" \
    -t "${DEVICE_TYPE}" \
    -o "hello-world-container-update.mender" \
    "hello-world"

```

I have the error  
`./docker-artifact-gen: line 137: /home/pi/bin/mender-artifact: cannot execute binary file: Exec format error`

EDIT I tried to change `#!/bin/bash` to `#!/bin/sh` but now it says `Artifact name not specified. Aborting.`

EDIT 2: I have tried to manually modify the fields inside the script with

```auto
device_types="raspberrypi4"
artifact_name="serial"
output_path="docker-artifact.mender"
meta_data_file="meta-data.json"
IMAGES="python:3.8-slim-buster"

```

but again, got `./docker-artifact-gen: 137: ./docker-artifact-gen: mender-artifact: Exec format error`

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [November 1, 2021, 7:55am UTC](https://hub.mender.io/t/error-on-generating-artifact-exec-format-error-on-raspberry-pi-4/4256/2 "2021-11-01T07:55:54Z")

</div>

There is unfortunately a chicken and egg problem when making docker updates for Raspberry Pi (or any ARM platform): Mender doesn’t offer ARM downloads of `mender-artifact`, and you can’t make Docker updates for Raspberry Pi using an x86 build host, since it would be the wrong architecture.

It should be relatively straightforward to compile it though. Just install the `golang` and `liblzma-dev` packages, git clone the [mender -artifact repository](https://github.com/mendersoftware/mender-artifact), and run `make` and `sudo make install`.

---

<div class="post-metadata">

**Author:** ![jetxe](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jetxe](https://hub.mender.io/u/jetxe)\
**Post date:** [April 4, 2022, 9:12am UTC](https://hub.mender.io/t/error-on-generating-artifact-exec-format-error-on-raspberry-pi-4/4256/3 "2022-04-04T09:12:47Z")

</div>

Running `make` just after cloning repo on an ARM device but even on an AMD device complains with:

```auto
go build -ldflags "-X github.com/mendersoftware/mender-artifact/cli.Version=a292a1a"  
main.go:21:2: cannot find package "github.com/mendersoftware/mender-artifact/cli" in any of:
	/usr/lib/go-1.10/src/github.com/mendersoftware/mender-artifact/cli (from $GOROOT)
	/home/$USER/go/src/github.com/mendersoftware/mender-artifact/cli (from $GOPATH)
Makefile:41: recipe for target 'build' failed
make: *** [build] Error 1

```

EDIT: Solved using latest version of GO (1.18)

mender-artifact for ARM successfully built
