laravel / homestead

MIT License
3.85k stars 1.45k forks source link

Version constraint error #1941

Closed colinhall17 closed 4 months ago

colinhall17 commented 5 months ago

Vagrant Version: 2.4.1 Virtualization: VirtualBox 7.0.14 OS: Windows 10

I have tried to update homestead to the latest version, as well as Vagrant and VirtualBox but when doing the 'vagrant up' I am getting a constraint error, even though 14.0.2 is in the list of available versions.

I get the following when trying to do a vagrant box update

$ client box update ==> client: Checking for updates to 'laravel/homestead' client: Latest installed version: 13.0.0 client: Version constraints: >= 14.0.2, < 15.0.0 client: Provider: virtualbox client: Architecture: "i386" ==> client: Box 'laravel/homestead' (v13.0.0) is running the latest version.

And this when doing vagrant up

Bringing machine 'client' up with 'virtualbox' provider... ==> client: Box 'laravel/homestead' could not be found. Attempting to find and install... client: Box Provider: virtualbox client: Box Version: >= 14.0.2, < 15.0.0 ==> client: Loading metadata for box 'laravel/homestead' client: URL: https://vagrantcloud.com/api/v2/vagrant/laravel/homestead The box you're attempting to add has no available version that matches the constraints you requested. Please double-check your settings. Also verify that if you specified version constraints, that the provider you wish to use is available for these constraints.

Box: laravel/homestead Address: https://vagrantcloud.com/api/v2/vagrant/laravel/homestead Constraints: >= 14.0.2, < 15.0.0 Available versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.3.0, 0.3.3, 0.4.0, 0.4.1, 0.4.2, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 1.0.0, 1.0.1, 1.1.0, 2.0.0, 2.1.0, 2.2.0, 3.0.0, 3.1.0, 4.0.0, 5.0.1, 5.1.0, 5.2.0, 6.0.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0, 7.0.0, 7.1.0, 7.2.1, 8.0.0.pre.alpha1, 8.0.0.pre.alpha2, 8.0.0.pre.alpha3, 8.0.0.pre.alpha4, 8.0.0.pre.beta, 8.0.0, 8.0.1, 8.1.0, 8.2.0, 8.2.1, 9.0.0, 9.0.1, 9.1.0, 9.1.1, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.5.1, 9.6.0, 9.6.1, 9.7.2, 10.0.0, 10.1.0, 10.1.1, 11.0.0, 11.1.0, 11.3.0, 11.4.0, 11.5.0, 12.0.0, 12.1.0, 12.2.0, 13.0.0, 14.0.0, 14.0.1, 14.0.2

colinhall17 commented 5 months ago

If I set the constraint back to >= 13.0.0 < 14.0.0 it works with v13 - so not sure if its an issue with my setup not working with V 14

browner12 commented 5 months ago

can you post your Homestead.yaml, and confirm you are up-to-date with the release branch?

colinhall17 commented 5 months ago

YAML file below. Up to date on the release, I tried first to update and when that didn't work I did a fresh install

---
ip: "192.168.10.50"
memory: 2048
cpus: 2
provider: virtualbox
name: client

authorize: f:/.ssh/id_rsa.pub
ssl: true
keys:
    - f:/.ssh/id_rsa

folders:
    - map: f:/servers/Client/sites/ssl-course-signup
      to: /home/vagrant/ssl-course-signup

sites:
    - map: coursesignup.test
      to: /home/vagrant/ssl-course-signup/public
      schedule: true
      backup: true

databases:
    - coursesignup

features:
    - mysql: true
    - mariadb: false
    - postgresql: false
    - ohmyzsh: true
    - webdriver: false

services:
    - enabled:
          - "mysql"
#    - disabled:
#        - "postgresql@11-main"

ports:
    - send: 33100
      to: 3306

#ports:
#    - send: 33060 # MySQL/MariaDB
#      to: 3306
#    - send: 4040
#      to: 4040
#    - send: 54320 # PostgreSQL
#      to: 5432
#    - send: 8025 # Mailhog
#      to: 8025
#    - send: 9600
#      to: 9600
#    - send: 27017
#      to: 27017
svpernova09 commented 5 months ago

What confuses me is

client: Architecture: "i386"

Are you running a 64 bit CPU? I believe that's a requirement to be able to run x64 VMs.

colinhall17 commented 5 months ago

Yeah its 64 bit. Intel Core i7-6700K CPU @ 4.00GHz

Sn0wCrack commented 5 months ago

You can attempt to override the host architecture Vagrant detects by using the VAGRANT_HOST_ARCHITECTURE environment variable and setting it to a value of amd64.

Personally the only thing I've had success with in getting the latest version to download correctly is by running the following:

vagrant box add --box-version 14.0.2 --provider virtualbox laravel/homestead

On occasions colleagues of mine have had to reboot their host machines and run the above for it to work. I'm unsure why (perhaps cache on Vagrants end?), but it usually seems to resolve most issues.

mikeziri commented 5 months ago

I'm on arm and I'm having a not found error:

==> homestead: Checking for updates to 'laravel/homestead-arm'
    homestead: Latest installed version: 13.0.0
    homestead: Version constraints: >= 14.0.2, < 15.0.0
    homestead: Provider: parallels
    homestead: Architecture: "arm64"
There was an error while downloading the metadata for this box.
The error message is shown below:

The requested URL returned error: 404

But checking https://vagrantcloud.com/api/v2/vagrant/laravel/homestead it is downloadable at https://vagrantcloud.com/laravel/boxes/homestead/versions/14.0.2/providers/parallels/arm64/vagrant.box


PS:

I just noticed the laravel/homestead-arm no longer exists. You merged it under laravel/homestead with a different provider.

browner12 commented 5 months ago

@mikeziri we did drop laravel/homestead-arm, as Vagrant now allows you to have multiple architectures and providers under 1 "box". I'll admit, we didn't document that at all for the upgrade process.

You can drop the box customization in your Homestead.yaml, and just use the default now. It might not pick up on it automatically, though.

shawnlindstrom commented 5 months ago

This may not be helpful, but I ran into the same error on vagrant up with Vagrant 2.4.0. Suggestions above did not help. I upgraded Vagrant and VirtualBox, rebooted and the new box, 14.0.2, was added and downloaded without issue. Prior to the error, I was running box version 12.2.0 and had issued vagrant halt then went on to do a new per-project install. That is, this was a fresh installation and vagrant up.

Naitsirc01 commented 4 months ago

I solved it by downloading this way "vagrant box add laravel/homestead https://app.vagrantup.com/laravel/boxes/homestead/versions/14.0.2/providers/virtualbox/amd64/vagrant.box" the command only downloads the version 12.2.0, additionally I had to activate hyper-v, Before doing this, when using the command it did not add the machine because I also had to change the minimum version allowed in the file homestead/scripts/homestead.rb config.vm.box_version = settings['version'] ||= '> = 12.2.0, < 15.0.0'