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

vagrant 2.2.19 nfs folders uninitialized constant error on Mac OS #12583

Closed
stolowski opened this issue Nov 9, 2021 · 27 comments
Closed

vagrant 2.2.19 nfs folders uninitialized constant error on Mac OS #12583

stolowski opened this issue Nov 9, 2021 · 27 comments

Comments

@stolowski
Copy link

stolowski commented Nov 9, 2021

Vagrant version

Vagrant 2.2.19
vagrant-vmware-desktop (3.0.1, global)

Host operating system

Mac OS 11.6

Guest operating system

Ubuntu Linux

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-20.04"
  config.vm.hostname = "focal"
  config.vm.define "ubuntu-focal" 
  config.vm.network "public_network"
  config.vm.synced_folder "/Users/pawel/go/src", "/home/vagrant/go/src", type: "nfs", nfs_export: true
  config.vm.provision "shell", path: "snapd-prep.sh"
  config.vm.provision "file", source: "~/.config/gcloud", destination: "$HOME/.config/gcloud"
  config.vm.provider "vmware_desktop" do |v|
    v.vmx["memsize"] = "16384"
    v.vmx["numvcpus"] = "4"
    v.vmx["mks.enable3d"] = false
    v.ssh_info_public = true
  end
end

Actual behavior

vagrant up fails with a traceback right after "Exporting NFS shared folders...". The last line of the traceback is:
/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb:20:in `resolve_host_path': uninitialized constant VagrantPlugins::HostDarwin::Cap::Version (NameError)

Full traceback: https://gist.github.com/stolowski/bc2e8e0d96540047c575e6c78e5fd530

@nlemoine
Copy link

nlemoine commented Nov 9, 2021

Same here

@AntonioMeireles
Copy link

well,
given that #12581 was already merged upstream until a new release is issued hotfix for those of us affected is just to replace /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb by full contents of https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb ...

hope this helps.

@stolowski
Copy link
Author

Ah, it's great the fix already landed, I missed the first report about this problem because it got addressed so fast and closed... Might make sense to keep this issue open until the fix gets released to avoid more reports of this problem. Thank you for pointing at the hotfix.

@nlemoine
Copy link

nlemoine commented Nov 9, 2021

thanks @AntonioMeireles! I finally stumbled upon the fix and applied it. Works fine now!

@drfuzetto
Copy link

#12583 (comment) worked great for me! Thank you.

@christopher-hopper
Copy link

christopher-hopper commented Nov 22, 2021

One-liner to apply #12581

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb 

@kojoidrissa
Copy link

@christopher-hopper
I'm trying the fix in #12583 (comment) from Mac OS 11.6, Vagrant 2.2.19 and I'm getting a no such file or directory error.

❯ sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb \
 https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb
curl: (3) URL using bad/illegal format or missing URL
zsh: no such file or directory: https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb

Do I need to be on Mac OS 12.0.1 for this to work? I may try to just manually replace the file after lunch. 🤔

@kojoidrissa
Copy link

kojoidrissa commented Dec 3, 2021

@christopher-hopper Nvmdn, I forgot to adjust for the line break character. So:

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb

worked just fine.
👍🏾

@switch120
Copy link

As usual a MacOs upgrade caused a Vagrant issue for me - this one specifically - and also as usual someone within the community came through and figured out how to fix it. Thanks @AntonioMeireles and @kojoidrissa , this fixed my issue updating to Monterey. 👍

@mfn
Copy link

mfn commented Jan 4, 2022

I was aware of this issue and did not upgrade to Monterey yet (besides other problems).

I'm still on 10.15.7 macOS Catalina and today I was also hit by this?!

+ $ vagrant --version
Vagrant 2.2.19
+ $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-18.04' version '202110.25.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
Traceback (most recent call last):
	106: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
…
	  1: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/capability_host.rb:111:in `call'
/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb:20:in `resolve_host_path': uninitialized constant VagrantPlugins::HostDarwin::Cap::Version (NameError)

Before blindly running curl commands I checked the diff and it looks sane:

+ $ diff -u /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb.backup-20220104 path.rb
--- /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb.backup-20220104	2022-01-04 12:35:09.000000000 +0100
+++ path.rb	2022-01-04 12:35:21.000000000 +0100
@@ -17,7 +17,8 @@
         def self.resolve_host_path(env, path)
           path = File.expand_path(path)
           # Only expand firmlink paths on Catalina
-          return path if !CATALINA_CONSTRAINT.satisfied_by?(Cap::Version.version(env))
+          host_version = env.host.capability(:version)
+          return path if !CATALINA_CONSTRAINT.satisfied_by?(host_version)

           firmlink = firmlink_map.detect do |mount_path, data_path|
             path.start_with?(mount_path)

TL;DR: like for many others before here, this change worked for me!

Still unclear why my system on Catalina was subject to this problem 😞

@andronocean
Copy link

I can confirm that this affects Catalina, too, as I'm on 10.15.7 and experienced the same problem. The patch worked perfectly.

@mspacemedia
Copy link

It doesn't appear to fix Bg Sur - any ideas?

@develth
Copy link

develth commented Jan 13, 2022

@mspacemedia the replace of path.rb fixed it for me on Big Sur 11.6.1

@5zurcaledgj
Copy link

well, given that #12581 was already merged upstream until a new release is issued hotfix for those of us affected is just to replace /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb by full contents of https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb ...

hope this helps.

This works. I am on macOS Monterey and using Vagrant 2.2.19

@D3strukt0r
Copy link

D3strukt0r commented Feb 7, 2022

Considering the fix has already been merged, how long will it take for this to be released? It's been months now since the fix.

@jayakrishnanj
Copy link

jayakrishnanj commented Feb 9, 2022

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb \ 

Thanks @kojoidrissa it worked for me!.

@samheuck
Copy link

One-liner to apply #12581

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb 

Worked for me on Big Sur (Mac OS 11.6.4) and Vagrant v2.2.19. Thanks!

@bvdputte
Copy link

bvdputte commented Mar 8, 2022

Thanks @kojoidrissa

Worked for me on Monterey + Vagrant 2.2.19

@sanjibnarzary
Copy link

One-liner to apply #12581

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb 

Thanks works for me MacOS Monterey

@zdennis
Copy link

zdennis commented Apr 30, 2022

How is this not released yet? This issue was opened six months ago.

@astratto-agency
Copy link

astratto-agency commented May 14, 2022

One-liner da applicare #12581

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb https://raw.githubusercontent.com/hashicorp/vagrant/ 42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb

Ha funzionato per me su Big Sur (Mac OS 11.6.4) e Vagrant v2.2.19. Grazie!

I have the same problem with Big Sur and 2.2.19, the command executed from the terminal, executed correctly but continues to give me the same error. could you tell me the correct file that I try to modify it manually?

@astratto-agency
Copy link

astratto-agency commented May 14, 2022

i just upgraded to Monterey but even with this upgrade it doesn't work.
Checking Trellis requirements...
Required:
[✓] Python [>= 3.8.0]: 3.10.0
Optional:
[✓] Vagrant [>= 2.1.0]: 2.2.19
[✓] VirtualBox [>= 4.3.10]: 6.1.34r150636

@christopher-hopper
Copy link

@astratto-agency said:

have the same problem with Big Sur and 2.2.19, the command executed from the terminal, executed correctly but continues to give me the same error. could you tell me the correct file that I try to modify it manually?

see the diff at #12581

@felixstoessel
Copy link

felixstoessel commented May 29, 2022

The one-line fix by @christopher-hopper worked great on macOS Catalina. Why is this not in the release?

@g-brizolier
Copy link

Please release this I just wasted days of my life trying to figure out what was going on. Fixed the issue on Monterey.

@andronocean
Copy link

@chrisroberts Apologies for the direct ping, but it looks like you're the Hashicorp team member who's been most actively contributing to Vagrant lately. Is there any way a patch release could be made in the near future, so this bug stops biting people? The fix for it was merged back in November and has been proven to work — so it really is just a matter of getting a new release out. We'd all really appreciate it!

@soapy1
Copy link
Contributor

soapy1 commented Feb 27, 2023

Hey there, this fix has been shipped with Vagrant 2.3.0 🎉

@soapy1 soapy1 closed this as completed Feb 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests