Search code examples
macosvagrantnfsmacos-catalina

'Stale file handle' error with Vagrant on macOS Catalina


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?


Solution

  • 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