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 Box Outdated not showing latest version of box from locally hosted versions file #13376

Open
wfuzzer opened this issue Apr 4, 2024 · 0 comments

Comments

@wfuzzer
Copy link

wfuzzer commented Apr 4, 2024

Debug output

https://gist.github.com/wfuzzer/1532a7a966ada228a828d2f7d9fab9ea

Expected behavior

It should have found an updated box version.

Actual behavior

It did not detect an updated box version.

Reproduction information

Vagrant version

2.4.0

Host operating system

RHEL8

Guest operating system

RHEL8

Steps to reproduce

  1. First remove the .vagrant.d/boxes/mybox2/3.1.175/virtualbox/box_update_check file (if this is not removed, it will always skip the version check. Tested this over the course of many days - this parenthetical may be a separate bug because the throttle is only supposed to be something like 1 hour (according to "Vagrant box outdated" and "vagrant up" both are not showing latest version of box from locally hosted catalog file #11228), but in my case, it always skips unless I manually remove this file).
  2. Run the "vagrant box outdated mymachine3" command
  3. The only output is, "Checking if box 'mybox2' version '3.1.175' is up to date..." with nothing after that.

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'yaml'

servers = YAML.load_file('servers.yml')

servers.each do |opts|
   if opts["name"].nil? or
      opts["enable"].nil? or
      opts["box"].nil? or
      opts["mem"].nil? or
      opts["vram"].nil? or
      opts["cpus"].nil?
      print "Error: malformed servers.yml file\n\n"
      exit 1
   end
end

VAGRANT_API_VERSION = 2
Vagrant.configure("#{VAGRANT_API_VERSION}") do |config|
   servers.each_with_index do |opts, iServer|
      if not opts["enable"]
         next
      end
      
      config.vm.define opts["name"], autostart:false, primary:false do |server|
         server.vm.box = opts["box"]
         server.vm.box_url = "file:///mydir/vagrant/#{opts["box"]}.json"

         # SSH configuration
         server.ssh.username = "myusername"
         server.ssh.password = "mypassword"
      end
   end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant