Vagrant up fails on executing landrush-ip on M1 Mac

Hi!

I’m trying to set up trellis on my M1 macbook pro but it fails during the vagrant up process.

The full error message is as follows:

DEBUG ssh: stderr: bash: line 4: /usr/local/bin/landrush-ip: No such file or directory

Without running vagrant using --debug it simply returns “Unsupported architecture”

My setup is as follows:

  • Fresh clone of trellis (v1.12.0-13-g1387834)
  • Ansible 2.10.16
  • Vagrant 2.2.18

Vagrant plugins:

  • landrush 1.3.2
  • vagrant-parallels 2.2.4
  • vagrant-bindfs 1.1.9
  • vagrant-hostmanager 1.8.9
  • vagrant-vbguest 0.30.0

Using parallels trial version and the recommended box jeffnoxon/ubuntu-20.04-arm64

What am I missing here?

I’ve never used landrush not sure how much help I can be.

Maybe try to force the landrush-ip install? Example: GitHub - vagrant-landrush/landrush-ip: Landrush IP resolver

No luck but thanks for the tip! I’ll keep digging.

Hi @Branch, did you find a solution for this in the end? Having the exact same problem…
Looks like landrush doesn’t support ARM based architecture?

This basically means that you can’t run a multisite locally (yet) with a M1 Macbook Pro…

Also vagrant trellis-cert trust won’t work when ssl is set to self-signed in dev, since it can’t resolve the host:

getaddrinfo: nodename nor servname provided, or not known

This kinda sucks… is there an alternative we can use for vagrant-landrush?

landrush-ip supports ARM, but not entirely properly looks like: https://github.com/vagrant-landrush/landrush-ip/blob/e4de811cd0f8b2f07be18767042450e0b386132a/lib/landrush-ip/cap/linux/landrush_ip_install.rb#L10-L11

I think Ubuntu ARM64 might return aarch64 as the architecture which wouldn’t be matched. That repo hasn’t been touched in forever but it’s worth opening an issue/PR.

Hi thanks,
running arch returns arm64 so it should match landrush-ip-linux_arm right?

EDIT: Ah wait no, when I debug landrush-ip with: puts uname it does return aarch64 @swalkinshaw, you’re right!

Hi @Twansparant - sorry for my late reply.

I never solved the problem. I’ve now got multisite disabled for my local environment and instead testing anything multi site related in our stage env.

It works but it’s not ideal.

If I change line 10 to:

elsif uname =~ /(arm|aarch64)/i

I get the following error on trellis up:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/usr/local/bin/landrush-ip -yaml
Stdout from the command:
Stderr from the command:
bash: line 4: /usr/local/bin/landrush-ip: cannot execute binary file: Exec format error
exit status 1

Not sure what else to try?

I opened an issue on the landrush-ip repo for this:

1 Like

:+1: I don’t use Landrush so I can’t really be of more help, but yeah that error message is obviously due to an architecture mismatch.

Ah, fairly positive the arm build of that binary is not 64bit: https://github.com/vagrant-landrush/landrush-ip/blob/e4de811cd0f8b2f07be18767042450e0b386132a/util/Makefile#L10-L36

So yeah that maintainer would need to update their Makefile to actually build the arm64 binary and adjust the logic to pick which binary to install. It wouldn’t be hard to fork.

1 Like

Thanks for your reply!

I don’t really ‘use’ Landrush either, but since Trellis kinda makes me use it for multisites, I need a fix for my existing projects.

I’m not that familiar with Ruby and it’s gems though, but I’m a little bit confused; when I install the plugin with:

vagrant plugin install landrush

It also installs landrush-ip-0.2.5 into my folder:

~/.vagrant.d/gems/2.7.4/gems/landrush-ip-0.2.5/

But in that folder there’s no:

/util/Makefile

But in the repo the file does exist?
How would I be able to test this locally first?

I think landrush-ip uses Gox to build the binary and I found this issue regarding arm64, but not sure how to proceed to be honest…

Thanks!

Distributed packages in most programming languages often don’t include all files in the repo (like tests for one) and that goes for Ruby Gems too. Here’s the gemspec where it includes utils/dist (where the compiled binaries are outputted): https://github.com/vagrant-landrush/landrush-ip/blob/e4de811cd0f8b2f07be18767042450e0b386132a/landrush-ip.gemspec#L20

So I think the process might look like:

  1. clone the repo locally
  2. edit Makefile
  3. use Docker/Gox to build the binaries locally
  4. update that conditional logic
  5. copy the edited files + new binary into ~/.vagrant.d/gems/2.7.4/gems/landrush-ip-0.2.5/
2 Likes

Thanks @swalkinshaw, I’ll have a go at it tomorrow and report back here!

Well that was an interesting side-project :slight_smile:
I managed to build the linux_arm64 locally with gox and add the logic to the landrush_ip_install.rb and Makefile files.

When copying the landrush_ip_install.rb file and the landrush-ip-linux_arm64 build to my local dist, it works:

==> default: Automatic installation for Landrush IP not enabled
==> default: [landrush] Using eth1 (192.168.50.5)
==> default: [landrush] Adding 'mydomain.test => 192.168.50.5' to /Users/username/.vagrant.d/data/landrush/hosts.json
    default: [landrush] starting DNS server: '/opt/vagrant/embedded/bin/ruby /Users/username/.vagrant.d/gems/2.7.4/gems/landrush-1.3.2/lib/landrush/start_server.rb 10053 /Users/username/.vagrant.d/data/landrush /Users/username/.vagrant.d/gems/2.7.4/gems'
==> default: [landrush] Using eth1 (192.168.50.5)
[landrush] Host DNS resolver config for TLD 'mydomain.test' looks good.

My subdomain works now on my multisite, even with SSL enabled!
So I made a PR for this:

I guess the dependency also needs to be updated in landrush itself?

Thanks for your help!

2 Likes

Awesome job!

Yeah the dependency is here: https://github.com/vagrant-landrush/landrush/blob/bfef5eb61773c0fdc7041402653288396957af99/landrush.gemspec#L31

Unfortunately neither project is maintained :frowning_face:

That’s unfortunate….:sob:

@Twansparant Any chance you can drop in your compiled gem here that is working for you? I’ve been trying to get the landrush-ip bundle installed and then compiled with your updates and it’s just not working for me unfortunately.

Sure thing!
I’m a Ruby noob, so don’t have a clue where to host a compiled gem, so I added a .zip file containing the compiled gem (with the /util/dist/landrush-ip-linux_arm64 file) to our landrush-ip fork.
Hope it helps you!

3 Likes

Thanks a ton! This got me a lot closer to getting everything back up locally. Running into some Installing NFS client... issues, but I’m not entirely sure if that is related to landrush_ip. Going to dig into that a bit and see what I find. Thanks again :slight_smile: