"Illegal instruction" when running balena-engine commands

Hello everyone.

I am trying to run balena engine on regular raspbian system on RaspberryPi 3B. Everything is up to date. Balena engine was installed using the script from home page, it’s the latest version v20.10.19. Script has finished successfully.

curl -sfL https://balena.io/engine/install.sh | sh

Running the balena-engine and the daemon results in error Illegal instruction. It’s the only message I get. Bunch of other executables were introduced during install, but all of them result with the same message.

I am running it on

   Static hostname: raspberrypi
         Icon name: computer
        Machine ID: 4b06a14f329b4ca8979a71d2551fc7ba
           Boot ID: 5fe3017947554928ae812a9eeeb345ba
  Operating System: Raspbian GNU/Linux 11 (bullseye)
            Kernel: Linux 6.1.21-v7+
      Architecture: arm

I have not idea how to move further with this. Are there some dependencies I am missing or else?

Thanks in advance!

Hello @Rafal first of all welcome to the balena community! This is great that you are trying to run balenaEngine on your raspbian system!

When you installed balenaEngine did you get the message Installation successful!? Did you follow these instructions?

To use balenaEngine you need to start balena-engine-daemon as a background process.
This can be done manually or using the init system scripts provided here:

    https://github.com/balena-os/balena-engine/tree/$tag/contrib/init

This requires adding a \"balena-engine\" group for the daemon to run under:

    sudo groupadd -r balena-engine

If you want to allow non-root users to run containers they can be added to this group
with something like:

    sudo usermod -aG balena-engine <user>

WARNING: Adding a user to the \"balena-engine\" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
         for more information.

Please, let us know the step-by-step that you did please to have more information!

@mpous Thanks for quick reply :slight_smile:

Yes, the installation was successful. I did follow those steps, however I don’t think it matters much, since .service tries to run executable, which fails even when ran manually. System was not modified in any way and can be considered clear install + update of apt-get packages.

@Rafal i pinged internally the balenaEngine team and let’s see if they can help you more :slight_smile:

Feel free to keep documenting what do you do!

Thank you very much :slight_smile:

Yeah, I will update this thread if I find a solution.

1 Like

Hi @rafal ! Thanks for reporting this – and sorry that you are going through this issue!

I’d say this is a bug in our installation script. In summary, the installer is downloading the armv7 version of balenaEngine (because that’s what uname -m reports), but everything in Raspberry Pi OS is set up for running software compiled for armv6. I created a GitHub issue to track this.

As a workaround, please go to the balena releases page on GitHub and download a release for armv6l. Then replace /usr/local/bin/balena-engine-dev with the one from the armv6l package you downloaded. This shall get rid of the Illegal Instruction error.

Also, there’s one more hiccup you’ll probably find next: the current version of balenaEngine do not yet support cgroups v2, so you’ll need to configure Raspberry Pi OS to use cgroups v1. To do that, just append systemd.unified_cgroup_hierarchy=0 to the end of the /boot/cmdline.txt in your Pi and reboot.

I did a quick test here and these steps worked for me. Please let us know if they work for you too, or if you need any further help. And again, apologies for the trouble!

Leandro

1 Like

@lmbarros It worked! Thank you very much for such a quick help :slight_smile:

Yay! Glad it worked, @rafal!

Mind to share a little bit about what you are doing and why you chose to use balenaEngine? I don’t see many people using balenaEngine outside of balenaOS. Would love to hear about your use case or experiments you are doing!

Sure. Long story short: I am exploring containers and orchestration (balena engine and k3s) in IoT. Bascially what you’re doing in Balena, but for educational purposes :slight_smile:

2 Likes

Hello @Rafal did you check this balenaRancher project? I know it’s not 100% what you asked but maybe can give some ideas and interesting plugs!

Let us know your next steps!