Vagrant up fails on executing landrush-ip on M1 Mac

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:

Have you checked these docs?

I think I also had to manually grant Full Disk Access privileges to /sbin/nfsd :

Hey @conrad – did you resolve your Installing NFS client... error?

This is the log I am getting with regards to the failed step (I can ping us.ports.ubuntu.com just fine):

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

apt-get -yqq update
apt-get -yqq install nfs-common portmap
exit $?


Stdout from the command:



Stderr from the command:

W: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/dists/focal/InRelease  Temporary failure resolving 'us.ports.ubuntu.com'
W: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/dists/focal-updates/InRelease  Temporary failure resolving 'us.ports.ubuntu.com'
W: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/dists/focal-backports/InRelease  Temporary failure resolving 'us.ports.ubuntu.com'
W: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/dists/focal-security/InRelease  Temporary failure resolving 'us.ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/libt/libtirpc/libtirpc-common_1.2.5-1_all.deb  Temporary failure resolving 'us.ports.ubuntu.com'
E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/libt/libtirpc/libtirpc3_1.2.5-1_arm64.deb  Temporary failure resolving 'us.ports.ubuntu.com'
E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/r/rpcbind/rpcbind_1.2.5-8_arm64.deb  Temporary failure resolving 'us.ports.ubuntu.com'
E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/k/keyutils/keyutils_1.6-6ubuntu1_arm64.deb  Temporary failure resolving 'us.ports.ubuntu.com'
E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/libn/libnfsidmap/libnfsidmap2_0.25-5.1ubuntu1_arm64.deb  Temporary failure resolving 'us.ports.ubuntu.com'
E: Failed to fetch http://us.ports.ubuntu.com/ubuntu-ports/pool/main/n/nfs-utils/nfs-common_1.3.4-2.5ubuntu3.4_arm64.deb  Temporary failure resolving 'us.ports.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Hi @evance! Unfortunately I was unable to resolve the issue. I ended up having to dig out an intel mac and just fire up everything on that box. From what I recall with where I was with troubleshooting, it has to do with the way landrush seems to alter the DNS resolver of the Vagrant box. While the pings work, the actual way it grabs those packages seems to not be able to resolve. Since the DNS resolve conf is dynamically set, there wasn’t an easy way that I found to be able to work around it. I didn’t go down the path to try and fix it due to time constraints on the project, but I where I was going to start digging next was on hosts and iptables just to see if there was something there I missed. Our conclusion is that multisite with Roots is currently bricked for M1 architecture and that an alternative to landrush needs to be found or created to utilize it properly. Unfortunately, my team and I are not Python devs and wouldn’t know where to start.

1 Like

This landrush-ip pr just got merged and vagrant plugin install landrush will now install the new landrush-ip-0.2.7 gem with Arm64 support :tada:

4 Likes

For anyone who comes here in the future, with multisite issues on an m1 mac, see: No DNS Resolution in development vm (vagrant, parallels, multisite, landrush) - #15 by craigpearson

cc @conrad @evance @Branch

1 Like