Missing juju agent binary on M1 macOS

HI, I am trying to setup Juju test environment on my (M1) MacBook Pro. I have some LXD machines, MAAS server, LXD’s are registered in MAAS. But when I try to bootstrap juju agent on MAAS (or LXD), I am receiving following error:

ERROR failed to bootstrap model: cannot use agent built for "focal" using a machine running "OSX"

It looks like juju agent (controller) doesn’t support Apple Silicon (yet). How can I build and provide the agent to the local juju binary, so it will pick up and install on target cloud?

1 Like

Can you clarify the version of the juju client you are using? Did you snap install it? The error message you are seeing implies that no suitable published agent binaries can be found for the controller so juju is attempting to use the jujud agent from the snap instead. The error is unfortunate because the fact that the client is macos and the agent binary from the snap was compiled for focal should not matter if the controller is being created on a focal server.

Can you raise a bug for this with the details of your setup.

If the juju client is version 2.9.28 or earlier, I would have expected this to work as there would have been a suitable published jujud to use.

@jas02, this is a long standing known issue.

Developing juju on anything other than ubuntu is a challenge as the correct agent binaries are not built for bootstrap. As a juju developer using a Mac I’ve tried to get this working at various points. The sticking point for me was that I couldn’t get juju to cross compile for ubuntu while on osx correctly. There were compile issues with LXD.

You can bootstrap a released version of juju from the Mac. E.G. juju bootstrap aws --agent-version 2.9.28.

@wallyworld the Mac client we release is done via brew and not snap. We should look at what gets installed with it, which jujud.

1 Like

Hello,

my local juju version:

juju --version

2.9.28-osx-arm64

I was able to do bootstraping using Ubuntu VM and standard (snap provided) juju. It’s a workaround, but at least I didn’t get stuck.

@jas02, normally this would have worked. I think you got caught by an issue with our streams file in the 2.9.28 release process which has since been resolved. If you’d bootstrapped with aws, you wouldn’t have seen the issue.

juju was building an agent because it couldn’t find the correct ones in the streams.

Hi,

I am trying to bootstrap with aws and this happens as well

Creating Juju controller "test2" on aws/us-east-1
Looking for packaged Juju agent version 2.9.32 for arm64
ERROR failed to bootstrap model: cannot use agent built for "focal" using a machine running "OSX"

Hi, @dash3. You should be able to bootstrap by passing a constraint:

juju bootstrap aws --constraints arch=amd64

This is because Juju, for legacy reasons, assumes that your client and controller are using the same architecture. When there is a mismatch in arch, you need to specify that arch you want to use on the controller.

Nice, do we need to highlight this in the docs somewhere @tmihoc? :slight_smile:

Hi @pengale. I tried it with this constraint as well, as I had read from here earlier [discussion] Authoring charms using an ARM Box but it still does not proceed.

Hi @jnsgruk. Maybe here might be a good place to mention the small caveat of M1 macs? Juju | Get started with Juju .

P.S I have currently given up on M1 mac fearful of other small little issues that might pop up. Going with multipass instead for now.

Well darn.

Multipass works beautifully on my own M1, so that’s definitely a great alternative!

One caution: I have run into issues building charms with charmcraft on ARM boxen, regardless of OS, because there are not yet ARM builds of the charmcraft multipass images. You can work around this by running charmcraft with the --destructive flag. It’s a great idea to be in the safe little cocoon of a vm already when you do this, so that you don’t pollute the host system’s libraries :slight_smile:

1 Like