Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 847 forks source link

Error Occurs When Mounting SMB Shares with Vagrant #2446

Closed davidshq closed 1 year ago

davidshq commented 3 years ago

Expected Behavior

vagrant up --provider=hyperv should launch an instance of VVV.

Current Behavior

Initial stages of launch are successful. Requests domain username/password. Begins setting up SMB shares and then throws an error regarding "`mount_name': wrong number of arguments (given 2, expected 3) (ArgumentError0", full traceback below.

Possible Solution

Seems like somewhere a necessary argument is not being passed.

Steps to Reproduce (for bugs)

  1. Install Hyper-V on Windows
  2. Install Vagrant on Windows
  3. Git clone VVV
  4. Run vagrant up --provider=hyperv

This occurs on both the stable and develop branches.

Your Environment

Platform: platform-mingw32 windows
HyperV-Admin HasWinAdminPriv
vagrant-goodhosts vagrant-vbguest monochrome-terminal shared_db_folder_disabled, VVV Path: "C:/vvv"
Vagrant: v2.2.15, VirtualBox: vN/A

Logs

C:\vvv>vagrant up --provider=hyperv
__ __ __ __
\ V\ V\ V / Varying Vagrant Vagrants
 \_/\_/\_/  v3.6.2-git::develop(62c5796)

Platform: platform-mingw32 windows  HyperV-Admin  HasWinAdminPriv  vagrant-goodhosts vagrant-vbguest monochrome-terminal shared_db_folder_disabled, VVV Path: "C:/vvv"                                                                          Vagrant: v2.2.15, VirtualBox: vN/A                                                                                                                                                                                                              Docs:       https://varyingvagrantvagrants.org/                                                                         Contribute: https://github.com/varying-vagrant-vagrants/vvv                                                             Dashboard:  http://vvv.test

Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Verifying Hyper-V is accessible...
==> default: [vagrant-goodhosts] Checking for host entries
==> default: Importing a Hyper-V instance
    default: Creating and registering the VM...
    default: Successfully imported VM
    default: Please choose a switch to attach to your Hyper-V instance.
    default: If none of these are appropriate, please open the Hyper-V manager
    default: to create a new virtual switch.
    default:
    default: 1) Default Switch
    default: 2) WSL
    default:
    default: What switch would you like to use? 1
    default: Configuring the VM...
    default: Setting VM Enhanced session transport type to disabled/default (VMBus)
==> default: Starting the machine...
==> default: Waiting for the machine to report its IP address...
    default: Timeout: 120 seconds
    default: IP: fe80::215:5dff:fe38:105
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 172.25.91.193:22
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Preparing SMB shared folders...
    default: You will be asked for the username and password to use for the SMB
    default: folders shortly. Please use the proper username/password of your
    default: account.
    default:
    default: Username (user[@domain]): *****@*******.***
    default: Password (will be hidden):

Vagrant requires administrator access to create SMB shares and
may request access to complete setup of configured shares.
==> default: Setting hostname...
==> default: Mounting SMB shared folders...
    default: C:/vvv/database/sql => /srv/database
Traceback (most recent call last):
        93: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
        92: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/machine.rb:201:in `action'
        91: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/machine.rb:201:in `call'
        90: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/environment.rb:614:in `lock'
        89: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/machine.rb:215:in `block in action'
        88: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/machine.rb:246:in `action_raw'
        87: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `run'
        86: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/util/busy.rb:19:in `busy'
        85: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `block in run'
        84: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builder.rb:149:in `call'
        83: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        82: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/delayed.rb:19:in `call'
        81: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        80: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/check_enabled.rb:18:in `call'
        79: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        78: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/check_access.rb:19:in `call'
        77: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        76: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
        75: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        74: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        73: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        72: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/call.rb:53:in `call'
        71: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `run'
        70: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/util/busy.rb:19:in `busy'
        69: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `block in run'
        68: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builder.rb:149:in `call'
        67: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        66: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
        65: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        64: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/import.rb:78:in `call'
        63: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        62: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/call.rb:53:in `call'
        61: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `run'
        60: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/util/busy.rb:19:in `busy'
        59: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `block in run'
        58: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builder.rb:149:in `call'
        57: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        56: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
        55: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        54: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/call.rb:53:in `call'
        53: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `run'
        52: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/util/busy.rb:19:in `busy'
        51: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `block in run'
        50: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builder.rb:149:in `call'
        49: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        48: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
        47: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        46: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/call.rb:53:in `call'
        45: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `run'
        44: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/util/busy.rb:19:in `busy'
        43: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/runner.rb:89:in `block in run'
        42: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builder.rb:149:in `call'
        41: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        40: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
        39: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        38: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/provision.rb:80:in `call'
        37: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        36: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/configure.rb:108:in `call'
        35: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        34: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/set_name.rb:38:in `call'
        33: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        32: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/net_set_vlan.rb:15:in `call'
        31: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        30: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/net_set_mac.rb:15:in `call'
        29: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        28: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/cleanup_disks.rb:30:in `call'
        27: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        26: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/disk.rb:30:in `call'
        25: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        24: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/synced_folders/nfs/action_cleanup.rb:14:in `call'
        23: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        22: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
        21: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        20: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/start_instance.rb:12:in `call'
        19: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        18: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/providers/hyperv/action/wait_for_ip_address.rb:52:in `call'
        17: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        16: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/wait_for_communicator.rb:71:in `call'
        15: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        14: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/delayed.rb:19:in `call'
        13: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/warden.rb:48:in `call'
        12: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/synced_folders.rb:90:in `call'
        11: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/synced_folders.rb:90:in `each'
        10: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/action/builtin/synced_folders.rb:93:in `block in call'
         9: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/synced_folders/smb/synced_folder.rb:142:in `enable'
         8: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/synced_folders/smb/synced_folder.rb:142:in `each'
         7: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/synced_folders/smb/synced_folder.rb:153:in `block in enable'
         6: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/guest.rb:43:in `capability'
         5: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/capability_host.rb:111:in `capability'
         4: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/capability_host.rb:111:in `call'
         3: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/guests/linux/cap/mount_smb_shared_folder.rb:23:in `mount_smb_shared_folder'
         2: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/capability_host.rb:111:in `capability'
         1: from C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/lib/vagrant/capability_host.rb:111:in `call'
C:/HashiCorp/Vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/plugins/synced_folders/smb/cap/mount_options.rb:48:in `mount_name': wrong number of arguments (given 2, expected 3) (ArgumentError)
tomjn commented 3 years ago

That's an error in vagrant itself, not sure what can be done from our end at the moment 🤔

davidshq commented 3 years ago

Yeah...Looks like it is a known issue:

https://github.com/hashicorp/vagrant/issues/12277

And a fix has been merged...

https://github.com/hashicorp/vagrant/pull/12281

I'll see if I can figure out why I'm still seeing the issue...this will be an issue for anyone using latest Vagrant and Hyper-V I think.

tomjn commented 3 years ago

When .16 comes out so will the fix, it's just a waiting game

davidshq commented 3 years ago

Or...if you are impatient and don't want to downgrade you can edit:

C:\HashiCorp\Vagrant\embedded\gems\2.2.15\gems\vagrant-2.2.15\plugins\guests\linux\cap\mount_smb_shared_folder.rb

Line 23: From: mount_device = options[:plugin].capability(:mount_name, options) To: mount_device = options[:plugin].capability(:mount_name, name, options)

ghost commented 3 years ago

@davidshq If you are on Hyper-V on WIndows 10 Pro.

Please download Vagrant 2.2.14. do not use Vagrant 2.2.15. There's a problem with the 2.2.15 that's making the SMB stop working for some reason.

There's no need to change the mount options.

ghost commented 3 years ago

@davidshq

ohh i didn't see the last comment u you mention. i had a good feeling that they change the parameters from two to three in 2.2.15.

tomjn commented 1 year ago

@benlumia007 @davidshq is this change still necessary for Hyper-V users? I haven't encountered this in my tests in the last year but I haven't been hyper vigilant on that front.

ghost commented 1 year ago

@tomjn Yea i haven't been either, it has been a while since vagrant version has change. so I don't know if this still irrevlant anymore.

tomjn commented 1 year ago

did we make the change to the parameter count?

ghost commented 1 year ago

i don't remember, sorry

davidshq commented 1 year ago

It's been quite a while since I've used Vagrant on Windows. If I did use it again Hyper-V wouldn't be installed. Hyper-V was only installed so I could use WSL and WSL2 no longer utilizes Hyper-V. Sorry.

ghost commented 1 year ago

I think we should just close this issue for now and if other people still have issues, we can always reopen.

tomjn commented 1 year ago

agreed!