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

[BUG] 1.6.4 broke private networking for RedHat guests #4438

Closed
Sharpie opened this issue Sep 2, 2014 · 11 comments
Closed

[BUG] 1.6.4 broke private networking for RedHat guests #4438

Sharpie opened this issue Sep 2, 2014 · 11 comments

Comments

@Sharpie
Copy link
Contributor

Sharpie commented Sep 2, 2014

Using a simple Vagrantfile with a private network and CentOS 6.5 guest:

VAGRANTFILE_API_VERSION = "2"


Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "puppetlabs/centos-6.5-64-nocm"

  config.vm.network "private_network", ip: "10.20.1.42"
end

vagrant up dies when configuring private networks:

➜  vagrant-network-test  vagrant --version
Vagrant 1.6.4

➜  vagrant-network-test  vagrant up --provider=virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'puppetlabs/centos-6.5-64-nocm'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'puppetlabs/centos-6.5-64-nocm' is up to date...
==> default: Setting the name of the VM: vagrant-network-test_default_1409700341646_24161
==> 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 => 2222 (adapter 1)
==> 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: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/guests/redhat/cap/configure_networks.rb:31:in `configure_networks_default': wrong number of arguments (1 for 2) (ArgumentError)
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/guests/redhat/cap/configure_networks.rb:19:in `configure_networks'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/capability_host.rb:111:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/capability_host.rb:111:in `capability'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/guest.rb:43:in `capability'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/network.rb:132:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/clear_network_interfaces.rb:26:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:15:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/synced_folders.rb:84:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/synced_folders/nfs/action_cleanup.rb:25:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:160:in `handle'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:42:in `block in call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/environment.rb:474:in `lock'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:41:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/env_set.rb:19:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/provision.rb:80:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/set_name.rb:50:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/box_check_outdated.rb:68:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/match_mac_address.rb:16:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/import.rb:32:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/customize.rb:40:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/action/runner.rb:66:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/machine.rb:196:in `action_raw'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/machine.rb:173:in `block in action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/environment.rb:474:in `lock'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/machine.rb:161:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/machine.rb:161:in `action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.4/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

The backtrace points to plugins/guests/redhat/cap/configure_networks.rb:19 which was changed in commit f4ee476. The problem appears to be that the manditory networks argument is not passed to configure_networks_rhel7 or configure_networks_default.

The following patch resolves the issue:

diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb
index a9e6e03..b9c0dbe 100644
--- a/plugins/guests/redhat/cap/configure_networks.rb
+++ b/plugins/guests/redhat/cap/configure_networks.rb
@@ -14,9 +14,9 @@ module VagrantPlugins
         def self.configure_networks(machine, networks)
           case machine.guest.capability("flavor")
           when :rhel_7
-            configure_networks_rhel7(machine)
+            configure_networks_rhel7(machine, networks)
           else
-            configure_networks_default(machine)
+            configure_networks_default(machine, networks)
           end
         end

I would submit a pull request, but I don't have time tonight to write the necessary unit tests.

@peternijssen
Copy link

I can confirm this issue regarding CentOS 6.5.

@detailyang
Copy link

Me to 👍

@jayjanssen
Copy link

+1

@simonweil
Copy link

+1
I wasted a few hours on a fresh installation today due to this issue :(

@nZac
Copy link

nZac commented Sep 3, 2014

+1

1 similar comment
@maxbucknell
Copy link

+1

@Narven
Copy link

Narven commented Sep 3, 2014

+1 Centos 6.5

@andytson
Copy link
Contributor

andytson commented Sep 3, 2014

Ignore the first one, the 2nd one is in PR #4446

@mitchellh
Copy link
Contributor

Fixed, sorry about that!

mitchellh added a commit that referenced this issue Sep 3, 2014
guests/redhat: Fixes #4438 typo missing sending networks param for rhel guest network
@Sharpie
Copy link
Contributor Author

Sharpie commented Sep 3, 2014

Looked over tests this morning, it seems like this should have been flagged by:

https://github.com/mitchellh/vagrant-spec/blob/master/acceptance/provider/network_private_network_spec.rb

@mitchellh Are you running acceptance tests against CentOS?

@bcomnes
Copy link

bcomnes commented Sep 3, 2014

Ran into this bug when trying to configure chef/centos-6.5 when running vagrant 1.6.4 today.

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