'Stale file handle' error with Vagrant on macOS Catalina

Viewed 2719

After updating macOS to Catalina, Vagrant projects on the external SSD stopped working. Trying access file list in mounted folder gives an error - 'Stale file handle'. At the same time, projects located on the local disk work after adding to the mount path /System/Volumes/Data/. Can anybody help?

2 Answers

I was able to make work by doing:

1 - sudo rm /etc/exports

2 - On the Vagrantfile change the configuration on synced_folder to use the absolute path in Catalina's new pattern.

ex.: directory = "<project_path>" config.vm.synced_folder "/System/Volumes/Data#{directory}", "/vagrant", :nfs => true, :mount_options => ['actimeo=2']

3 - Run vagrant destroy -f && vagrant up

And you are good to go!

Adding '/System/Volumes/Data' only helps for projects on the local file system. And this bug is fixed in last Vagrant version. But the problem is actual for projects on external drives.

I found a not very beautiful, but working solution:

  1. Remove old Vagrant lines from /etc/exports and add to /etc/exports:

/Volumes/SSD/DEV/dirname/www -alldirs -mapall=501:20 192.168.33.10

  1. sudo nfsd restart
  2. showmount -e

You must see correct mount list: /Volumes/SSD/DEV/dirname/www 192.168.33.10

  1. Edit Vagrantfile

config.vm.synced_folder "/Volumes/SSD/DEV/dirname/www", "/var/www", type: "nfs", nfs_export: false

By default vagrant mount your dir to /vagrant folder, but if you want mount in the other dir, add to provision section: sudo mount -o vers=3,udp 192.168.33.1:/Volumes/SSD/DEV/dirname/www /var/www

Related