Closed stblassitude closed 2 years ago
I have the exact same issue, in my case I'm trying to converge a box using the libvirt provider but seems that the syntax of the Vagrantfile is wrong.
I've also tried with kitchen-vagrant v1.7.0 getting the same result.
The (same) error I'm getting:
-----> Starting Test Kitchen (v2.7.2)
-----> Creating <default-server>...
/opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/plugins/kernel_v2/config/vm.rb:319:in `network': wrong number of arguments (given 2, expected 1) (ArgumentError)
from /home/dbuenoparedes/git-repos/infra-chef/cookbooks/fuze_proxmox/.kitchen/kitchen-vagrant/default-server/Vagrantfile:5:in `block in <top (required)>'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:119:in `each'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:119:in `block in load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:116:in `each'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:116:in `load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/vagrantfile.rb:29:in `initialize'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:793:in `new'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:793:in `vagrantfile'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:974:in `process_configured_plugins'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:178:in `initialize'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/bin/vagrant:194:in `new'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/bin/vagrant:194:in `<main>'
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider libvirt ----
STDOUT:
STDERR: /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/plugins/kernel_v2/config/vm.rb:319:in `network': wrong number of arguments (given 2, expected 1) (ArgumentError)
from /home/dbuenoparedes/git-repos/infra-chef/cookbooks/fuze_proxmox/.kitchen/kitchen-vagrant/default-server/Vagrantfile:5:in `block in <top (required)>'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:119:in `each'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:119:in `block in load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:116:in `each'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/config/loader.rb:116:in `load'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/vagrantfile.rb:29:in `initialize'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:793:in `new'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:793:in `vagrantfile'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:974:in `process_configured_plugins'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/lib/vagrant/environment.rb:178:in `initialize'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/bin/vagrant:194:in `new'
from /opt/vagrant/embedded/gems/2.2.17/gems/vagrant-2.2.17/bin/vagrant:194:in `<main>'
---- End output of vagrant up --no-provision --provider libvirt ----
Ran vagrant up --no-provision --provider libvirt returned 1] on default-server
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
My env:
$ ruby --version
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
$ bundle version
Bundler version 2.1.4 (2021-07-16 commit unknown)
$ vagrant --version
Vagrant 2.2.17
gem list --local | grep test-kitchen
test-kitchen (2.7.2)
$ gem list --local | grep vagrant
kitchen-vagrant (1.9.0, 1.7.0)
My kitchen.yml config:
driver:
name: vagrant
provider: libvirt
customize:
cpus: 2
memory: 2048
network:
- ["private_network", {libvirt__network_name: "vagrant-libvirt"}]
The resulting Vagrantfile config looks like:
Vagrant.configure("2") do |c|
c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
c.vm.network(:private_network, {:libvirt__network_name=>"vagrant-libvirt"})
c.vm.synced_folder ".", "/vagrant", disabled: true
c.vm.provider :libvirt do |p|
p.cpus = 2
p.memory = 2048
end
end
Whereas if I manually fix it to look like the following it works:
c.vm.network :private_network, :libvirt__network_name=>"vagrant-libvirt"
I've installed ruby 2.7.2 via rvm, but still get the same error.
Downgrading to vagrant 2.2.16 fixes it for me. I still believe the syntax currently used is undocumented and should be updated to the correct, documented syntax.
Neat, I knew it was working for me before but wasn't sure what changed, now we know it's a Vagrant version update what changed this behavior...
Same problem here
Hashi is going to back out the Ruby 3 bump in Vagrant that caused this: https://github.com/hashicorp/vagrant/issues/12448
I'd advise downgrading until then.
Hello,
I still have the problem with vagrant 2.2.19, downgrading to 2.2.16 worked.
I am also still getting the same error with vagrant 2.4.1 and Test kitchen version 3.0.0
@pkelly-mitre can you try latest version of vagrant(2.4.1), test-kitchen(3.6.0), and kitchen-vagrant(2.0.1)?
:speaking_head: Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
:ghost: Brief Description
When trying to configure a VB/Vagrant with a custom network, Vagrant reports an error.
Version
1.9.0
Environment
Scenario
Converge a box. The .kitchen.yml contains:
Steps to Reproduce
Expected Result
Box converges with custom network.
Actual Result
The generated Vagrantfile starts like this:
The network config should read
Manually correcting the Vagrantfile and running
vagrant up
in .kitchen/kitchen-vagrant/default-freebsd13 brings up the box.:heavy_plus_sign: Additional context
Add any other context about the problem here. e.g. related issues or existing pull requests.