roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.51k stars 607 forks source link

Bug: Fresh install fails on NFS mount on macOS (Intel machine) #1368

Closed coolamit closed 2 years ago

coolamit commented 2 years ago

Terms

Description

What's wrong?

Trying to do fresh install using trellis-cli. It fails on the NFS mount step.

This is the full log - https://gist.github.com/coolamit/a2766caeba25fd01080f8fef9f513484

Software Versions

What have you tried?

I was getting iTerm2 needs permission to manage the computer. In the macOS Security settings, I've granted iTerm2 permissions both in Accessibility and Full Disk Access.

What insights have you gained?

None so far

Possible solutions

None yet

Temporary workarounds

None yet

Steps To Reproduce

  1. Install trellis using trellis-cli on macOS Big Sur

Expected Behavior

It should mount the folder from host to the VM and successfully complete the trellis install.

Actual Behavior

Installation halts in an unfinished state when NFS mount fails and the VM is left in unusable state.

Relevant Log Output

This is the full log - https://gist.github.com/coolamit/a2766caeba25fd01080f8fef9f513484

Versions

1.14.0

swalkinshaw commented 2 years ago

From your log:

Stderr from the command: mount.nfs: mounting 192.168.56.1:/System/Volumes/Data/Users/amit/Desktop/dev/trellis-projects/wp-app.test/site failed, reason given by server: No such file or directory

Did you very this directory exists?

coolamit commented 2 years ago

From your log:

Stderr from the command: mount.nfs: mounting 192.168.56.1:/System/Volumes/Data/Users/amit/Desktop/dev/trellis-projects/wp-app.test/site failed, reason given by server: No such file or directory

Did you very this directory exists?

Yes I did. This is created by default when a new project is created using trellis.

robrecord commented 2 years ago

@coolamit Just an idea: To finish giving iTerm the correct permissions to let its processes access the directory, iTerm would need to be quit and restarted. Since this is 11 days ago you may well have done this by now. Is it still giving the same error?

coolamit commented 2 years ago

@coolamit Just an idea: To finish giving iTerm the correct permissions to let its processes access the directory, iTerm would need to be quit and restarted. Since this is 11 days ago you may well have done this by now. Is it still giving the same error?

iTerm has correct permissions - I've been using VVV & other vagrant & docker based dev environment setups for 10+ years now. At the moment I use both vagrant (VVV) & docker setups & they all work perfectly, no issues. Which is why this baffled me. :/

dalepgrant commented 2 years ago

@coolamit It's been a while but I remember really struggling with NFS mounting issues a few months ago. I ended up setting vagrant_mount_type: 'virtualbox' here. Might not solve your issue but at least it's another thing to try.

craigpearson commented 2 years ago

@coolamit Is the Desktop folder on your machine synced with iCloud? Or is it symlinked to a different drive? If so this will fail as when folders are synced with iCloud it creates a none standard symlink to another system folder and can be classed as encrypted which NFS sometimes doesn't play too nicely with: https://www.vagrantup.com/docs/synced-folders/nfs#troubleshooting-nfs-issues

Looking at your log vagrant is attempting to mount /System/Volumes/Data/Users/amit/Desktop/dev/trellis-projects/wp-app.test/site which differs from the trellis directory of /Users/amit/Desktop/dev/trellis-projects/wp-app.test/trellis.

If you manually view your /etc/exports file, do the trellis and site inclusions differ? One with /System/Volumes and one without?

You could try to clear your exports file mv /etc/exports /etc/exports.BAK && rm -rf /etc/exports && touch /etc/exports, move your code folder from the Desktop to the root of your users directory such as /Users/amit/dev and see if that resolves issues

Also in your logs your vagrant guest additions differ, which points in the direction of you recently updating vagrant / virtualbox. Having both of those inline may help: https://stackoverflow.com/a/35678489/1668614

swalkinshaw commented 2 years ago

NFS issues are hard to debug and often specific to individual computers/setups which is why I'm closing this. It's not clear at all what Trellis could do to fix this especially without further feedback and details. If there's updates on this specific issue, please still comment.

adleviton commented 2 years ago

In case it helps, here's how I solved my NFS mounting issues: https://discourse.roots.io/t/big-sur-update-vagrant-not-mounting-folders-on-external-drives/21020/3

update to the post above: after switching over Parallels, my exports file is now simply one line

"/System/Volumes/Data/Volumes/Storage" -alldirs -network 10.211.55.0 -mask 255.255.255.0 -mapall=502:20

Although, my error was specifically "access denied" and not "No such file or directory".

MikeiLL commented 1 year ago

So, as of today, looks like Lima is a great Trellis-supported alternative to Vagrant.