hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.02k stars 4.42k forks source link

"vagrant box outdated" and "vagrant box outdated --force" do not show any updates but `vagrant box outdated --global` does #13345

Open ddribin opened 5 months ago

ddribin commented 5 months ago

vagrant box outdated and vagrant box outdated --force do not show any updates but vagrant box outdated --global does. This is for ubuntu/jammy64: https://app.vagrantup.com/ubuntu/boxes/jammy64

Debug output

https://gist.github.com/ddribin/0552ec395103d449c0d526b48588ccdb

Expected behavior

vagrant box outdated should show that version 20231012.0.0 is out of date, since the current version is 20240126.0.0.

Actual behavior

> vagrant box outdated
Checking if box 'ubuntu/jammy64' version '20231012.0.0' is up to date...
> vagrant box outdated --force
Checking if box 'ubuntu/jammy64' version '20231012.0.0' is up to date...
> vagrant box outdated --global
* 'ubuntu/jammy64' for 'virtualbox' is outdated! Current: 20231012.0.0. Latest: 20240126.0.0
* 'ubuntu/jammy64' for 'virtualbox' is outdated! Current: 20230914.0.0. Latest: 20240126.0.0
* 'ubuntu/jammy64' for 'virtualbox' is outdated! Current: 20230616.0.0. Latest: 20240126.0.0
> vagrant box update
==> minecraft: Checking for updates to 'ubuntu/jammy64'
    minecraft: Latest installed version: 20231012.0.0
    minecraft: Version constraints:
    minecraft: Provider: virtualbox
    minecraft: Architecture: "amd64"
==> minecraft: Box 'ubuntu/jammy64' (v20231012.0.0) is running the latest version.

Reproduction information

Vagrant version

Vagrant 2.4.1 (installed via Homebrew)

Host operating system

macOS Ventura 13.6.3

Guest operating system

Ubuntu Jammy 22.04

Steps to reproduce

  1. Run vagrant box outdated

Vagrantfile

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

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/jammy64"

  # General VirtualBox VM configuration.
  config.vm.provider :virtualbox do |v|
    v.memory = 512
    v.cpus = 1
    v.linked_clone = true
  end

  config.vm.define "minecraft" do |minecraft|
    minecraft.vm.hostname = "minecraft.test"
    minecraft.vm.network :private_network, ip: "192.168.56.3"
  end

  # Ansible provisioner.
  config.vm.provision :ansible do |ansible|
    ansible.compatibility_mode = "2.0"
    ansible.playbook = "provision.yml"
    ansible.inventory_path = "inventories/development.yml"
  end
end

References

Similar to #11228 but I still hit the issue with --force.

wysiayg commented 4 months ago

I noticed the same issue. It applies both for HashiCorps' cloud (tested with ubuntu/noble64) and a local Artifactory repository. Applying the --global flag results in the expected behaviour for both cases.

Edit vagrant box update seems to have the same issue, with the exception that there's no --global flag, so updating a box is currently no possible.

ddribin commented 4 months ago

I ended up destroying all my boxes and starting over fresh, and it pulled the most current versions.,

ps-mattstuart commented 3 months ago

This is still an issue and annoying. Currently using bento/ubuntu-22.04-arm64 and was at 20230630 version and update / outdated was showing it's current version. Doing the curl command manually would show the new versions but the parsing engine obviously wouldn't pick it up.

My two work arounds:

  1. Remove the box and let it get readded.
  2. Outside of my vagrant path run vagrant box update --box bento/ubuntu-22.04-arm64 and it would update correctly (because it's a global box maybe?)

Edit: Only thing I can think of for me, the box version I was stuck on used an "unknown" architecture where the newer versions were tagged wth "arm64". My update would show:

==> dev-vagrant: Checking for updates to 'bento/ubuntu-22.04-arm64'
    ps-dev-vagrant: Latest installed version: 202306.28.0
    ps-dev-vagrant: Version constraints:
    ps-dev-vagrant: Provider: parallels
    ps-dev-vagrant: Architecture: "arm64"
==> dev-vagrant: Box 'bento/ubuntu-22.04-arm64' (v202306.28.0) is running the latest version.

Which you'd tihnk would check for the arch but I'm wondering if it won't use a different arch than the existing image