Vagrant: mount_nfs: can't mount: Stale NFS file handle

Created on 18 Oct 2019  路  4Comments  路  Source: hashicorp/vagrant

Vagrant version

$ vagrant --version
Vagrant 2.2.6

Host operating system

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.15 (19A602)
      Kernel Version: Darwin 19.0.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: sycorax
      User Name: Nathan Fiscaletti (nathanf)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 20:31

Guest operating system

mtchavez/macos-10.13-xcode-9.4

Vagrantfile

My Vagrantfile is riddled with sensitive data, so I'm only pasting the relevant section:

cf.vm.synced_folder hostpath, "/" + guestpath, type: "nfs"
  • hostpath is /Volumes/ExternalDrive/git-repos/comp/android-client
  • guestpath is android-client

Debug output

https://gist.github.com/nathan-fiscaletti/74e68a5e524582a9908a4da5985b8308

Expected behavior

The shares should be mounted properly.

Actual behavior

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

/sbin/mount -t nfs -o 'nfsv3,mntudp' 172.30.0.1:/System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/android-client /android-client

Stdout from the command:



Stderr from the command:

mount_nfs: option nfsv3 deprecated, use vers=#
mount_nfs: can't mount /System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/android-client from 172.30.0.1 onto /android-client: Stale NFS file handle

I believe this may be related to the use of an external drive, however I cannot conclusively say that.

Here is the contents of my /etc/exports file after running vagrant up:

/Volumes/ExternalDrive/git-repos/comp/android-client -alldirs -mapall=501:20 172.30.0.12
# VAGRANT-BEGIN: 501 690bf06c-0d58-45e9-9f6e-37e6072743c5
/System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/android-client -alldirs -mapall=501:20 172.30.0.12
/System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/ios-client /System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/ios-client/corelib/vcb /System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/ios-client/corelib/vagrant /System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/ios-client/corelib/host-toolchain -alldirs -mapall=501:20 172.30.0.12
/System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/linux-ui -alldirs -mapall=501:20 172.30.0.12
/System/Volumes/Data/Volumes/ExternalDrive/git-repos/comp/windows-client -alldirs -mapall=501:20 172.30.0.12
# VAGRANT-END: 501 690bf06c-0d58-45e9-9f6e-37e6072743c5
guesdarwin hosdarwin needs-repro synced-foldernfs

Most helpful comment

It looks like doing what @vintagesucks suggested here (https://github.com/laravel/homestead/issues/1304#issuecomment-545391163) seems to have resolved my problem.

I just needed to grant Full Disk Access to /sbin/nfsd in my macs settings. However I feel like this error message could be caught by Vagrant and a more descriptive error message could perhaps be displayed.

Or perhaps this is indicative of a deeper issue in Vagrant that needs to be resolved.

All 4 comments

Got kind of the same problem (NFS mounting an external drive on Catalina) and commented my setup/problem in #8704

It looks like doing what @vintagesucks suggested here (https://github.com/laravel/homestead/issues/1304#issuecomment-545391163) seems to have resolved my problem.

I just needed to grant Full Disk Access to /sbin/nfsd in my macs settings. However I feel like this error message could be caught by Vagrant and a more descriptive error message could perhaps be displayed.

Or perhaps this is indicative of a deeper issue in Vagrant that needs to be resolved.

@nathan-fiscaletti Confirmed that this workaround works. However, are there any security issues that we should be aware of?

Was this page helpful?
0 / 5 - 0 ratings