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 Up fails at is_env_set #12522

Closed
kpd31768 opened this issue Sep 15, 2021 · 6 comments
Closed

Vagrant Up fails at is_env_set #12522

kpd31768 opened this issue Sep 15, 2021 · 6 comments

Comments

@kpd31768
Copy link

Please note that the Vagrant issue tracker is in priority reserved for bug reports and enhancements. For general usage questions, please use
HashiCorp Discuss: https://discuss.hashicorp.com/c/vagrant/24 Thank you!

When submitting a bug report, please provide the minimal configuration and required information necessary to reliably reproduce the issue. It
should include a basic Vagrantfile that only contains settings to reproduce the described behavior.

Tip: Before submitting your issue, don't hesitate to remove the above introductory text, possible empty sections (e.g. References), and this tip.

Vagrant version

Vagrant 2.2.18

Host operating system

MacOS 11.5.2

Guest operating system

CentOS 8 v2011.0

Vagrantfile

$script = <<-SCRIPT
sudo -u vagrant cat /vagrant/*.pub >> /home/vagrant/.ssh/authorized_keys
cat /vagrant/criblHosts.txt >> /etc/hosts
SCRIPT

Vagrant.configure("2") do |config|
  config.vm.define "criblmaster01" do |criblmaster01|
    criblmaster01.vm.box = "centos/8"
    criblmaster01.vm.network "private_network", ip: "192.168.100.60"
    criblmaster01.vm.hostname = "criblmaster01.newco.net"
    criblmaster01.vm.provider "virtualbox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
      vb.customize ["modifyvm", :id, "--cpuexecutioncap", "25"]  # Limit to VM to 25% of available CPU
    end
    criblmaster01.vm.provision :shell, inline: $script
  end
  config.vm.define "criblworker01" do |criblworker01|
    criblworker01.vm.box = "centos/8"
    criblworker01.vm.network "private_network", ip: "192.168.100.61"
    criblworker01.vm.hostname = "criblworker01.newco.net"
    criblworker01.vm.provider "virtualbox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
      vb.customize ["modifyvm", :id, "--cpuexecutioncap", "25"]  # Limit to VM to 25% of available CPU
    end
    criblworker01.vm.provision :shell, inline: $script
  end
  config.vm.define "criblworker02" do |criblworker02|
    criblworker02.vm.box = "centos/8"
    criblworker02.vm.network "private_network", ip: "192.168.100.62"
    criblworker02.vm.hostname = "criblworker02.newco.net"
    criblworker02.vm.provider "virtualbox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
      vb.customize ["modifyvm", :id, "--cpuexecutioncap", "25"]  # Limit to VM to 25% of available CPU
    end
    criblworker02.vm.provision :shell, inline: $script
  end
  config.vm.define "criblworker03" do |criblworker03|
    criblworker03.vm.box = "centos/8"
    criblworker03.vm.network "private_network", ip: "192.168.100.63"
    criblworker03.vm.hostname = "criblworker03.newco.net"
    criblworker03.vm.provider "virtualbox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
      vb.customize ["modifyvm", :id, "--cpuexecutioncap", "25"]  # Limit to VM to 25% of available CPU
    end
    criblworker03.vm.provision :shell, inline: $script
  end
end

Debug output

<script src="https://gist.github.com/kpd31768/51077f83ca3cff8a7455213b17a9dd60.js"></script>

Expected behavior

The virtual machine should have been started and configured with a NAT interface port mapped for SSH on the first NIC and a hostonly interface on the second NIC.

Actual behavior

Environment is discovered and a solution set is defined and stored
Solution set is activated
Plugins are loaded and registered
Determine version of VBoxManage
Load provider driver for VirtualBox version: 6.1.26
Run action: environment_plugins_loaded
Run action: environment_load
Box found: centos/8 (Virtualbox)
Initializing machine: criblworker01
Bringing machine 'criblmaster01' up with 'virtualbox' provider...
==> criblmaster01: Importing base box 'centos/8'...
Bringing machine 'criblworker01' up with 'virtualbox' provider...
==> criblworker01: Importing base box 'centos/8'...
Bringing machine 'criblworker02' up with 'virtualbox' provider...
==> criblworker02: Importing base box 'centos/8'...
Bringing machine 'criblworker03' up with 'virtualbox' provider...
==> criblworker03: Importing base box 'centos/8'...
Detecting any forwarded port collisions...
Clearing any previously set network interfaces...
Determining network adapters required for high-level configuration...
Determining adapters and compiling network configuration...
Searching for matching hostonly network: 192.168.100.60
Network not found. Creating if we can.
Created network: vboxnet0
Enabling adapters...
Preparing network interfaces based on configuration...
Forwarding ports...
22 (guest) => 2222 (host) (adapter 1)
Automatically figuring out whether to enable/disable NAT DNS proxy...
Checking if env is set: 'cloud_init'

  • Result: true
    Writing box metadata file...
    Error occurred: undefined method `old_compare' for nil:NilClass
    Beginning recovery process...

Steps to reproduce

  1. Create basic Vagrant init file
  2. Execute vagrant up
  3. Process gets all the way through checking if env is set: 'cloud_init' and then fails

References

None

@kpd31768
Copy link
Author

I've reproduced the same error with several different guest images.
I've also verified that I can launch all of the VM images successfully in VirtualBox directly.

@chrisroberts
Copy link
Member

chrisroberts commented Nov 1, 2021

Hi there,

The source of the error you are encountering is originating from a dependency of the hostmanager RubyGem which you have installed. Removing that will resolve the issues you are encountering:

vagrant plugin uninstall hostmanager

Cheers

@kpd31768
Copy link
Author

kpd31768 commented Nov 1, 2021 via email

@chrisroberts
Copy link
Member

@kpd31768 Yes, that is what I meant but I guess my fingers had a different idea 🙂 I updated my comment to the correct name. You have two hostmanager gems installed. hostmanager and vagrant-hostmanager. The former is causing the problems (and is not a vagrant plugin) and the latter is the vagrant plugin I'm sure you were expecting.

@kpd31768
Copy link
Author

kpd31768 commented Nov 1, 2021 via email

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2021
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

2 participants