Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalina filesystem changes appear to introduce NFS sync issues #10961

Closed
bjfresh opened this issue Jul 10, 2019 · 85 comments
Closed

Catalina filesystem changes appear to introduce NFS sync issues #10961

bjfresh opened this issue Jul 10, 2019 · 85 comments

Comments

@bjfresh
Copy link

bjfresh commented Jul 10, 2019

Vagrant version

2.2.5

Host operating system

Mac OS X Catalina Public Beta 2

Guest operating system

Ubuntu 16.04.1 LTS

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

ANSIBLE_PATH = __dir__ # absolute path to Ansible directory on host machine
ANSIBLE_PATH_ON_VM = '/home/vagrant/trellis'.freeze # absolute path to Ansible directory on virtual machine

require File.join(ANSIBLE_PATH, 'lib', 'trellis', 'vagrant')
require File.join(ANSIBLE_PATH, 'lib', 'trellis', 'config')
require 'yaml'

vconfig = YAML.load_file("#{ANSIBLE_PATH}/vagrant.default.yml")

if File.exist?("#{ANSIBLE_PATH}/vagrant.local.yml")
  local_config = YAML.load_file("#{ANSIBLE_PATH}/vagrant.local.yml")
  vconfig.merge!(local_config) if local_config
end

ensure_plugins(vconfig.fetch('vagrant_plugins')) if vconfig.fetch('vagrant_install_plugins')

trellis_config = Trellis::Config.new(root_path: ANSIBLE_PATH)

Vagrant.require_version '>= 2.0.1'

Vagrant.configure('2') do |config|
  config.vm.box = vconfig.fetch('vagrant_box')
  config.vm.box_version = vconfig.fetch('vagrant_box_version')
  config.ssh.forward_agent = true
  config.vm.post_up_message = post_up_message

  # Fix for: "stdin: is not a tty"
  # https://github.com/mitchellh/vagrant/issues/1673#issuecomment-28288042
  config.ssh.shell = %(bash -c 'BASH_ENV=/etc/profile exec bash')

  # Required for NFS to work
  if vconfig.fetch('vagrant_ip') == 'dhcp'
    config.vm.network :private_network, type: 'dhcp', hostsupdater: 'skip'

    cached_addresses = {}
    config.hostmanager.ip_resolver = proc do |vm, _resolving_vm|
      if cached_addresses[vm.name].nil?
        if vm.communicate.ready?
          vm.communicate.execute("hostname -I | cut -d ' ' -f 2") do |_type, contents|
            cached_addresses[vm.name] = contents.split("\n").first[/(\d+\.\d+\.\d+\.\d+)/, 1]
          end
        end
      end
      cached_addresses[vm.name]
    end
  else
    config.vm.network :private_network, ip: vconfig.fetch('vagrant_ip'), hostsupdater: 'skip'
  end

  main_hostname, *hostnames = trellis_config.site_hosts_canonical
  config.vm.hostname = main_hostname

  if Vagrant.has_plugin?('vagrant-hostmanager') && !trellis_config.multisite_subdomains?
    redirects = trellis_config.site_hosts_redirects

    config.hostmanager.enabled = true
    config.hostmanager.manage_host = true
    config.hostmanager.aliases = hostnames + redirects
  elsif Vagrant.has_plugin?('landrush') && trellis_config.multisite_subdomains?
    config.landrush.enabled = true
    config.landrush.tld = config.vm.hostname
    hostnames.each { |host| config.landrush.host host, vconfig.fetch('vagrant_ip') }
  else
    fail_with_message "vagrant-hostmanager missing, please install the plugin with this command:\nvagrant plugin install vagrant-hostmanager\n\nOr install landrush for multisite subdomains:\nvagrant plugin install landrush"
  end

  bin_path = File.join(ANSIBLE_PATH_ON_VM, 'bin')

  vagrant_mount_type = vconfig.fetch('vagrant_mount_type')

  if vagrant_mount_type != 'nfs' || Vagrant::Util::Platform.wsl? || (Vagrant::Util::Platform.windows? && !Vagrant.has_plugin?('vagrant-winnfsd'))
    vagrant_mount_type = nil if vagrant_mount_type == 'nfs'
    trellis_config.wordpress_sites.each_pair do |name, site|
      config.vm.synced_folder local_site_path(site), remote_site_path(name, site), owner: 'vagrant', group: 'www-data', mount_options: ['dmode=776', 'fmode=775'], type: vagrant_mount_type
    end

    config.vm.synced_folder ANSIBLE_PATH, ANSIBLE_PATH_ON_VM, mount_options: ['dmode=755', 'fmode=644'], type: vagrant_mount_type
    config.vm.synced_folder File.join(ANSIBLE_PATH, 'bin'), bin_path, mount_options: ['dmode=755', 'fmode=755'], type: vagrant_mount_type
  elsif !Vagrant.has_plugin?('vagrant-bindfs')
    fail_with_message "vagrant-bindfs missing, please install the plugin with this command:\nvagrant plugin install vagrant-bindfs"
  else
    trellis_config.wordpress_sites.each_pair do |name, site|
      config.vm.synced_folder local_site_path(site), nfs_path(name), type: 'nfs', nfs_version: 4, nfs_udp: false
      config.bindfs.bind_folder nfs_path(name), remote_site_path(name, site), u: 'vagrant', g: 'www-data', o: 'nonempty'
    end

    config.vm.synced_folder ANSIBLE_PATH, '/ansible-nfs', type: 'nfs', nfs_version: 4, nfs_udp: false
    config.bindfs.bind_folder '/ansible-nfs', ANSIBLE_PATH_ON_VM, o: 'nonempty', p: '0644,a+D'
    config.bindfs.bind_folder bin_path, bin_path, perms: '0755'
  end

  vconfig.fetch('vagrant_synced_folders', []).each do |folder|
    options = {
      type: folder.fetch('type', 'nfs'),
      create: folder.fetch('create', false),
      mount_options: folder.fetch('mount_options', [])
    }

    destination_folder = folder.fetch('bindfs', true) ? nfs_path(folder['destination']) : folder['destination']

    config.vm.synced_folder folder['local_path'], destination_folder, options

    if folder.fetch('bindfs', true)
      config.bindfs.bind_folder destination_folder, folder['destination'], folder.fetch('bindfs_options', {})
    end
  end

  provisioner = local_provisioning? ? :ansible_local : :ansible
  provisioning_path = local_provisioning? ? ANSIBLE_PATH_ON_VM : ANSIBLE_PATH

  config.vm.provision provisioner do |ansible|
    if local_provisioning?
      ansible.install_mode = 'pip'
      ansible.provisioning_path = provisioning_path
      ansible.version = vconfig.fetch('vagrant_ansible_version')
    end

    ansible.compatibility_mode = '2.0'
    ansible.playbook = File.join(provisioning_path, 'dev.yml')
    ansible.galaxy_role_file = File.join(provisioning_path, 'requirements.yml') unless vconfig.fetch('vagrant_skip_galaxy') || ENV['SKIP_GALAXY']
    ansible.galaxy_roles_path = File.join(provisioning_path, 'vendor/roles')

    ansible.groups = {
      'web' => ['default'],
      'development' => ['default']
    }

    ansible.tags = ENV['ANSIBLE_TAGS']
    ansible.extra_vars = { 'vagrant_version' => Vagrant::VERSION }

    if (vars = ENV['ANSIBLE_VARS'])
      extra_vars = Hash[vars.split(',').map { |pair| pair.split('=') }]
      ansible.extra_vars.merge!(extra_vars)
    end
  end

  # Virtualbox settings
  config.vm.provider 'virtualbox' do |vb|
    vb.name = config.vm.hostname
    vb.customize ['modifyvm', :id, '--cpus', vconfig.fetch('vagrant_cpus')]
    vb.customize ['modifyvm', :id, '--memory', vconfig.fetch('vagrant_memory')]
    vb.customize ['modifyvm', :id, '--ioapic', vconfig.fetch('vagrant_ioapic', 'on')]

    # Fix for slow external network connections
    vb.customize ['modifyvm', :id, '--natdnshostresolver1', vconfig.fetch('vagrant_natdnshostresolver', 'on')]
    vb.customize ['modifyvm', :id, '--natdnsproxy1', vconfig.fetch('vagrant_natdnsproxy', 'on')]
  end

  # VMware Workstation/Fusion settings
  %w(vmware_fusion vmware_workstation).each do |provider|
    config.vm.provider provider do |vmw, _override|
      vmw.name = config.vm.hostname
      vmw.vmx['numvcpus'] = vconfig.fetch('vagrant_cpus')
      vmw.vmx['memsize'] = vconfig.fetch('vagrant_memory')
    end
  end

  # Parallels settings
  config.vm.provider 'parallels' do |prl, _override|
    prl.name = config.vm.hostname
    prl.cpus = vconfig.fetch('vagrant_cpus')
    prl.memory = vconfig.fetch('vagrant_memory')
    prl.update_guest_tools = true
  end
end

Debug output

https://gist.github.com/bjfresh/673d66b9ab814e6ca66404ca6755a885

Expected behavior

NFS syncs the folder

Actual behavior

Catalina introduces separate volumes for system and user data (Root changed from "/" to "System/Volumes/Data/" ), which appears to be the cause of this unexpected mismatch:

NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":

exports:2: exported dir/fs mismatch: /Users/bj/Sites/sitename.com/site /System/Volumes/Data
exports:3: exported dir/fs mismatch: /Users/bj/Sites/sitename.com/trellis /System/Volumes/Data

Steps to reproduce

  1. Install MacOS Catalina Public Beta 2
  2. Run 'vagrant up' on an existing Vagrant + Trellis installation using NFS

FWIW I've updated Virtualbox, Vagrant, and relevant plugins

@briancain
Copy link
Member

Quick question @bjfresh - Can you bring up new guests, or does this only affect guests that were created on a previous version of macOS? Thanks.

@briancain briancain added this to the 2.2.6 milestone Jul 10, 2019
@bjfresh
Copy link
Author

bjfresh commented Jul 11, 2019

@briancain seems a fresh, unmodified clone of the Roots Example Project is able to launch without issue for me.

@briancain
Copy link
Member

Interesting.... @bjfresh well that is good news. 🙏 We might be able to get some sort of handling around old guests on newer upgrades of macOS, but if fresh guests seem to work at least there's a path forward currently and isn't completely busted.

@musikov
Copy link

musikov commented Jul 15, 2019

It's not a vagrant issue but nfsd/macos issue.
If you add to /etc/exports line:
/Users/USERNAME/Documents
and then run nfsd checkexports, you'll receive:
exports:22: exported dir/fs mismatch: /Users/USERNAME/Documents /System/Volumes/Data

But if you explicitly add path to data volume to /etc/exports:
/System/Volumes/Data/Users/USERNAME/Documents
And run nfsd checkexports it will pass.

So i think it's wrong firmlink handling done by either macos of nfsd

@cyberkurumin
Copy link

I'm facing the same problem but I just can't make it work. Everything has been updated, but the mismatch message always come back.

Do you know if there is any solution or workaround?

@musikov
Copy link

musikov commented Aug 29, 2019

I'm facing the same problem but I just can't make it work. Everything has been updated, but the mismatch message always come back.

Do you know if there is any solution or workaround?

workaround is to add /System/Volumes/Data/... to your paths in VagrantFile and /etc/exports

@telcy
Copy link

telcy commented Sep 2, 2019

same problem here. not able to get around the mismatch, as vagrant up always adds it again

EDIT:
I have added /System/Volumes/Data to the ANSIBLE_PATH and now I stuck at:

==> default: Cannot create bind mount from '/vagrant-nfs-project1' to '/srv/www/project1/current': Source path '/vagrant-nfs-project1' doesn't exist
==> default: Cannot create bind mount from '/vagrant-nfs-project2' to '/srv/www/project2/current': Source path '/vagrant-nfs-project2' doesn't exist

@RawDawg
Copy link

RawDawg commented Oct 5, 2019

workaround is to add /System/Volumes/Data/... to your paths in VagrantFile and /etc/exports

Where exactly would I add this to Vagrantfile? I have added it to my etc/exports but it keeps changing back with every vagrant up.

Another option might be to use nfs_export: false but I can’t figure out where to put it in my Vagrantfile or vagrant.default.yml.

@musikov
Copy link

musikov commented Oct 7, 2019

Where exactly would I add this to Vagrantfile? I have added it to my etc/exports but it keeps changing back with every vagrant up.

Where you describe path to source folder:

vms.vm.synced_folder "~/dev/myproject/", "/src/myproject", type: "nfs"

change to:

vms.vm.synced_folder "/System/Volumes/Data/Users/USERNAME/dev/myproject/", "/src/myproject", type: "nfs"

but, if you commit this file, this will crash vagrant for all other users.

Another option might be to use nfs_export: false but I can’t figure out where to put it in my Vagrantfile or vagrant.default.yml.

Here:

vms.vm.synced_folder "~/dev/myproject/", "/src/myproject", type: "nfs", nfs_export: false

@brablc
Copy link

brablc commented Oct 8, 2019

I have tried rather naive:

  nfsPath = "/System/Volumes/Data" + Dir.pwd

  config.vm.synced_folder nfsPath + "../src",   "/vagrant-src", :nfs => !RUBY_PLATFORM.downcase.include?("w32"), :linux__nfs_options => ["async,rw,no_subtree_check,all_squash"]

Which seems to construct correct path. Before running vagrant up again, please remove lines added by vagrant to /etc/exports.

Btw, the template that is used to write to the exports file is located in /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/templates/nfs/exports_bsd.erb and the file which reads it is /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/hosts/bsd/cap/nfs.rb.

@ryscript
Copy link

ryscript commented Oct 8, 2019

There's even a much simpler approach, make sure the vagrant is up

  1. Open VirtualBox
  2. Click on "Shared Folders" Tab
  3. on Machine Folders list view, double click/tap the configuration
  4. Navigate to the new Catalina path

restart vagrant and you're done.

@slkxmail
Copy link

slkxmail commented Oct 8, 2019

resolving this problem https://stackoverflow.com/questions/20726248/vagrant-error-nfs-is-reporting-that-your-exports-file-is-invalid

@bobbytables
Copy link

If you're here like I was because of Docker For Mac and NFS, I've got you: https://www.firehydrant.io/blog/nfs-with-docker-on-macos-catalina/

@pingram3030
Copy link

pingram3030 commented Oct 8, 2019

edited to make the config backwards compatible

@brablc, try this, it worked for us:

  config.vm.synced_folder "/System/Volumes/Data/Users/#{ENV['USER']}/dev/myproject", '/src/myproject',
    id: 'myproject',
    type: 'nfs',
    nfs_version: 3,
    nfs_udp: false
  • Vagrantfile is Ruby
  • Ruby, like Bash, can expand variables within double quotes, but not within single quotes.
  • Any Env var is accessible in Ruby with ENV['VARIABLE_NAME'], or within double quotes as "#{ENV['VARIABLE_NAME']}"
  • nfs_udp: false forces TCP to be used which will reduce failures when dealing with thousands of files.
  • You will need to halt all VMs and remove all offending entries from /etc/exports by hand before executing vagrant up with this work-around.
  • Variablising:
    • NFSv4 is not supported on MacOS, so to make your config Linux compatible, you will need to variablise nfs_verison.
    • To make your config backwards compat, you need to change the base depending on MacOS version
    case RUBY_PLATFORM
    when 'x86_64-linux'
      export_base = '/opt'
      nfs_version = 4.1
    when 'x86_64-darwin13'
      case %x('uname' '-r').split('.').first
      when '18'
        export_base = ENV['HOME']
        nfs_version = 3
      when '19'
        export_base = "/System/Volumes/Data/Users/#{ENV['USER']}"
        nfs_version = 3
      else
        fail("Unsupported version of MacOS")
      end
    else
      fail("Unsupported RUBY_PLATFORM '#{RUBY_PLATFORM}'")
    end
    ...
    config.vm.synced_folder "#{export_base}/dev/myproject"...
      nfs_version: nfs_version,
      linux__nfs_options: ['crossmnt', 'rw', 'no_subtree_check', 'all_squash']
      ...
    

@jeroenmoons
Copy link

jeroenmoons commented Oct 9, 2019

For me the workaround looks like this now, since my Vagrantfile uses "." to mount the current working directory:

nfsPath = "."
if Dir.exist?("/System/Volumes/Data")
    nfsPath = "/System/Volumes/Data" + Dir.pwd
end
config.vm.synced_folder nfsPath, "/vagrant", type: "nfs"

This provides a workaround without breaking the config for non-Catalina hosts. (This still needs existing exports in /etc/exports to be removed first or vagrant will complain about a path mismatch.)

@mmoollllee
Copy link

For me the workaround looks like this now, since my Vagrantfile uses "." to mount the current working directory:

nfsPath = "."
if Dir.exist?("/System/Volumes/Data")
    nfsPath = "/System/Volumes/Data" + Dir.pwd
end
config.vm.synced_folder nfsPath, "/vagrant", type: "nfs"

This provides a workaround without breaking the config for non-Catalina hosts. (This still needs existing exports in /etc/exports to be removed first or vagrant will complain about a path mismatch.)

Great! Do you know how to implement this in the Trellis Vagrantfile?

@deb1990
Copy link

deb1990 commented Oct 10, 2019

The above solutions work to start the vagrant box, but when I do vagrant ssh and try to access the shared folder , I get cannot open directory '.': Stale file handle error.
Any one faced this issue?

@aglarsson
Copy link

After som hours of struggling I found out that you can not have your vagrant projects in the Documents folder anymore, because nfs reports "stale file" when trying to access the nfs mount.

Solutiuon: create a new folder in your home directory, ie. /Users/[user]/Development and move your projects there. Delete your cached server: rm -rf .vagrant. Then your can start your vagrant server without problem.

I do not know what happened with the Documents folder when upgrading to OS X Catalina.

@venanciorodrigo
Copy link

venanciorodrigo commented Oct 10, 2019

The temporary solution for my case was to change the sync from NFS to native VirtualBox.

config.vm.synced_folder ".", "/vagrant", type: "virtualbox"

Also as people described above you have to change the folder map to "map" => "/System/Volumes/Data/Users/{username}/Documents/{project-folder}"

@mmoollllee
Copy link

mmoollllee commented Oct 10, 2019

For me the workaround looks like this now, since my Vagrantfile uses "." to mount the current working directory:

nfsPath = "."
if Dir.exist?("/System/Volumes/Data")
    nfsPath = "/System/Volumes/Data" + Dir.pwd
end
config.vm.synced_folder nfsPath, "/vagrant", type: "nfs"

This provides a workaround without breaking the config for non-Catalina hosts. (This still needs existing exports in /etc/exports to be removed first or vagrant will complain about a path mismatch.)

Great! Do you know how to implement this in the Trellis Vagrantfile?

Okay, found it out for the trellis Vagrantfile!
It's as easy as changing the first line of the trellis Vagrantfile. With backwarts compatibility it looks like this:

if Dir.exist?("/System/Volumes/Data")
    ANSIBLE_PATH = "/System/Volumes/Data" + __dir__ # absolute path to Ansible directory on host machine for macos Catalina
else
    ANSIBLE_PATH = __dir__ # absolute path to Ansible directory on host machine
end

@venanciorodrigo
Copy link

venanciorodrigo commented Oct 10, 2019

After som hours of struggling I found out that you can not have your vagrant projects in the Documents folder anymore, because nfs reports "stale file" when trying to access the nfs mount.

Solutiuon: create a new folder in your home directory, ie. /Users/[user]/Development and move your projects there. Delete your cached server: rm -rf .vagrant. Then your can start your vagrant server without problem.

I do not know what happened with the Documents folder when upgrading to OS X Catalina.

Had the same issue as you described here, the solution to make NFS work again was the combination of @jeroenmoons and yours (Moving the project outside the Documents folder) otherwise I'll have the cannot open directory '.': Stale file handle error.

@ErwinSteffens
Copy link

ErwinSteffens commented Nov 7, 2019

Same here on macOS 10.15.1. Getting a mount time-out.

Seems like the nfsd is crashing:

default	19:40:02.928287+0100	nfsd	open(/etc/exports): No such file or directory (2)
default	19:40:06.133783+0100	sudo	    root : TTY=ttys003 ; PWD=/Users/erwin/Workspace/devvm ; USER=root ; COMMAND=/sbin/nfsd restart
default	19:40:13.609863+0100	ReportCrash	Parsing corpse data for process nfsd [pid 46376]
default	19:40:15.009535+0100	ReportCrash	Saved crash report for nfsd[46376] version 136.40.2 to nfsd_2019-11-07-194015_Erwins-MacBook-Pro.crash
default	19:40:15.013571+0100	ReportCrash	Removing excessive log: nfsd_2019-11-07-104554_Erwins-MacBook-Pro.crash

Any ideas on a workaround?

@lbabayigit
Copy link

i manage to fix this issue @ErwinSteffens can you post your mount section of your Vagrantfile?

@naprirfan
Copy link

Hello @lbabayigit , I also have this mount time-out problem. How did you solve it?

This is my mount section:

# Project root
vagrant_root = File.dirname(__FILE__)

# Mount
$mount_type = 'nfs'
if OS.linux?
  $mount_options = %w(rw vers=4 tcp noacl nolock actimeo=1)
  if OS.wsl?
    $mount_type = 'virtualbox'
    $mount_options = []
  end
else
  $mount_options = %w(rw vers=3 tcp actimeo=1)
end

# Folders
  config.vm.synced_folder "#{vagrant_root}", "/vagrant", type: $mount_type, mount_options: $mount_options, automount: true
  config.vm.synced_folder "#{vagrant_root}/../projectA", "/ww-shop", type: $mount_type, mount_options: $mount_options, automount: true 
  config.vm.synced_folder "#{vagrant_root}/..", "/projectB", type: $mount_type, mount_options: $mount_options

@kwn
Copy link

kwn commented Nov 7, 2019

@lbabayigit

Any hints?

@paco3346
Copy link

paco3346 commented Nov 7, 2019

I too am having the timeout issue on Catalina with 2.2.6

If I SSH into my VM I can run

sudo mount 192.168.99.1:/System/Volumes/Data/Volumes... /some/local/path

and it works perfectly. It appears that the core of NFS works but there's some other detail vagrant must add to the mount command.

@ErwinSteffens
Copy link

ErwinSteffens commented Nov 7, 2019

@lbabayigit Here it is. No special config I think:

  config.vm.synced_folder ".", "/vagrant", type: "nfs"
  config.vm.synced_folder "../com.folder1", "/opt/folder1", type: "nfs"
  config.vm.synced_folder "../com.folder1", "/var/www/folder2", type: "nfs"
  config.vm.synced_folder "../com.folder3", "/var/www/folder3", type: "nfs"
  config.vm.synced_folder "..", "/workspace", type: "nfs"

I have updated the logs in my post above as I copied/pasted the wrong nfsd logs.

@lbabayigit
Copy link

@ErwinSteffens you first need to change your folder structure to /System/Volumes/Data/
i.e.
config.vm.synced_folder ".", " /System/Volumes/Data/vagrant", type: "nfs"

@kenji21
Copy link

kenji21 commented Nov 8, 2019

@lbabayigit Here it is. No special config I think:

  config.vm.synced_folder ".", "/vagrant", type: "nfs"
  config.vm.synced_folder "../com.folder1", "/opt/folder1", type: "nfs"
  config.vm.synced_folder "../com.folder1", "/var/www/folder2", type: "nfs"
  config.vm.synced_folder "../com.folder3", "/var/www/folder3", type: "nfs"
  config.vm.synced_folder "..", "/workspace", type: "nfs"

I have updated the logs in my post above as I copied/pasted the wrong nfsd logs.

Have you tried with a single nfs mount ? maybe having multiple ones can cause the issue

@ErwinSteffens
Copy link

ErwinSteffens commented Nov 8, 2019

@kenji21 Tried a single NFS mount and this works.

Hmm, is there a way to work around this?

@OZZlE
Copy link

OZZlE commented Nov 8, 2019

It seems like restarting your mac installs patches ( https://semver.org/ ) without even informing us about it. So what I did was. 1) vagrant up => if fail 2) restart Mac and over again during a couple of days. One day it finally worked with nfs, I haven't restarted my computer since and I don't dare :D

It is now working without the prefix /System/Volumes/Data/, it wasn't allowing this prefix.

I have:

$ system_profiler SPSoftwareDataType
System Version: macOS 10.15 (19A602)

It's Apple's fault but why the heck is this issue closed here? Shouldn't the maintainers try to talk with Apple that they have destroyed Vagrant and that this is still an issue depending on which patch version of Catalina you use?

@ErwinSteffens
Copy link

ErwinSteffens commented Nov 8, 2019

@OZZlE I think the original problem was that absolute paths should be used /etc/exports on macOS 10.15. This was fixed in vagrant 2.2.6, so the issue was closed.

The issue with the time-outs is only occurring for us on macOS 10.15.1 (19B88).

@OZZlE
Copy link

OZZlE commented Nov 8, 2019

@ErwinSteffens alright but in 19A602 using the absolute path /System/Volumes/Data/[something] doesn't work, it refuses to mount then even when I try manually, when I removed this prefix/absolut path it works fine. So I had to use vagrant version 2.2.5 for vagrant to work at all for me in Catalina.

Probably Apple doesn't push out system updates to all users in the world at the same time. So even when I though I had the latest Catalina due to accepting all updates, I did infact not have it and no possibility to get it other than wait. Meanwhile this was fixed in vagrant 2.2.6 for the latest Catalina but not backward compatible with the latest Catalina that I could actually install..... or that some users had installed...

@Nilz11
Copy link

Nilz11 commented Nov 11, 2019

For me it works when i have one NFS mount, but if I have two mounts it hangs at "Mounting nfs folders"

@kwn
Copy link

kwn commented Nov 12, 2019

Thanks @Nilz11. This temporarily solved the issue. We used NFS for mounting multiple directories that were not performance critical (ansible scripts etc.). We removed them the NFS option, so now they use the native VirtualBox folder share capability. We use NFS to keep the performance high for the application code only.

@rfay
Copy link

rfay commented Nov 12, 2019

Just an extreme oddity of macOS Catalina: It seems that the ~/Documents directory cannot work with NFS, even though any other directory works (assuming homedir shared). It always shows as a stale filehandle. I have no idea why this would be.

Edit: The ~/Documents NFS problem
is solved by #10961 (comment) - You have to grant "Full Disk Access" to /sbin/nfsd

Security___Privacy

@mpukit
Copy link

mpukit commented Nov 12, 2019

I fought this for over a week and in the end the only solid solution was downgrading my OS from Catalina. She's a real nuisance.

@ErwinSteffens
Copy link

ErwinSteffens commented Nov 14, 2019

What is the process to get this fixed? Is there anything vagrant can do to work around this?

Should we file a bug report at Apple (https://developer.apple.com/bug-reporting/)?

@kwn
Copy link

kwn commented Nov 15, 2019

@ErwinSteffens

I already did (FB7433067) however my report doesn't explain that the issue occurs only when there are multiple NFS mounts. It would be great if you could also report it. More reports they get - higher chance they will fix it.

BTW - 2 days ago they announced 10.15.2 (19C39d) release, but they didn't mention NFS problem.

@JensBourgeois
Copy link

JensBourgeois commented Nov 20, 2019

I can confirm the multiple NFS mounts problem.

I managed to fix it by manually changing the mapping in the /etc/exports file.
The cause seems to be by 2 exports on the same line
"/System/Volumes/Data/Users/xxx/Documents/Vagrant/xxx-shop-m2-vagrant/data/web/magento2 /System/Volumes/Data/Users/xxx/Documents/Vagrant/xxx-shop-m2-vagrant/data/web/magento2/config/nginx -alldirs -mapall=501:20 172.28.128.3"

I removed the nginx mapping part and now it's working again.
So multiple NFS exports seem to work, but not when they are combined on 1 line.

FIXED

# VAGRANT-BEGIN: 501 41963a7b-784f-435c-8669-8709e7ccf0eb
/System/Volumes/Data/Users/xxx/.composer -alldirs -mapall=501:20 172.28.128.3
/System/Volumes/Data/Users/xxx/Documents/Vagrant/xxx-shop-m2-vagrant/data/web/magento2 -alldirs -mapall=501:20 172.28.128.3
# VAGRANT-END: 501 41963a7b-784f-435c-8669-8709e7ccf0eb

BEFORE (BROKEN)

# VAGRANT-BEGIN: 501 432726b2-afcf-4aad-b58c-aa7c17a1d797
/System/Volumes/Data/Users/xxx/.composer -alldirs -mapall=501:20 172.28.128.3
/System/Volumes/Data/Users/xxx/Documents/Vagrant/xxx-shop-m2-vagrant/data/web/magento2 /System/Volumes/Data/Users/xxx/Documents/Vagrant/xxx-shop-m2-vagrant/data/web/magento2/config/nginx -alldirs -mapall=501:20 172.28.128.3
# VAGRANT-END: 501 432726b2-afcf-4aad-b58c-aa7c17a1d797

@OZZlE
Copy link

OZZlE commented Nov 20, 2019

I was getting stuck with Inappropriate ioctl for device now instead after my Mac crashed,

this fixed it! #1941 (comment)

@findthebug
Copy link

Just an extreme oddity of macOS Catalina: It seems that the ~/Documents directory cannot work with NFS, even though any other directory works (assuming homedir shared). It always shows as a stale filehandle. I have no idea why this would be.

Edit: The ~/Documents NFS problem
is solved by #10961 (comment) - You have to grant "Full Disk Access" to /sbin/nfsd

Security___Privacy

this solves my issue in Catalina 10.15.1

@alextsoi
Copy link

Just an extreme oddity of macOS Catalina: It seems that the ~/Documents directory cannot work with NFS, even though any other directory works (assuming homedir shared). It always shows as a stale filehandle. I have no idea why this would be.
Edit: The ~/Documents NFS problem
is solved by #10961 (comment) - You have to grant "Full Disk Access" to /sbin/nfsd
Security___Privacy

this solves my issue in Catalina 10.15.1

Yes I added full disk access on both Virtual box and nfsd

@mfn
Copy link

mfn commented Dec 19, 2019

A co-worker tried thus but then ran into troubles with our setting for nfs, e.g. locking didn't work.

In the end we advised everyone not to use those suddenly special folders for vagrant machines anymore 🤷‍♀️

@TVLester98
Copy link

TVLester98 commented Jan 21, 2020

Schermafbeelding 2020-01-21 om 20 46 20

The Full Disk Access for nfsd did the trick for me! My vagrant environment is now running.
I still have an issue with the Latte (template engine) cache. There is an filemtime() error, maybe because of the NFS paths?

@toabi
Copy link

toabi commented Jan 23, 2020

If you get locking issues, try moving your vagrant project to some folder like ~/code and not have it in ~/Documents or ~/Desktop. That solved some locking issue for us.

@TVLester98
Copy link

If you get locking issues, try moving your vagrant project to some folder like ~/code and not have it in ~/Documents or ~/Desktop. That solved some locking issue for us.

Thanks!

@ghost
Copy link

ghost commented Jan 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.