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

Homestead Box Settler v13.0.0 can't be detected/found by Vagrant Box Add or Update #1907

Closed
skeeith opened this issue Nov 3, 2023 · 19 comments

Comments

@skeeith
Copy link
Contributor

skeeith commented Nov 3, 2023

Please note that the Homestead issue tracker is reserved for bug reports and enhancements. We are not always able to debug Vagrant, Provider or Operating System issues, but will do our best to help. Thank you!

Versions

  • Vagrant: v2.4.0
  • Provider: Virtualbox v6.1.48
  • Homestead: release v14.5.0 (fully updated)

Host operating system

Windows 11 fully updated

Vagrant destroy & up output

vagrant up output - https://gist.github.com/skeeith/4a1232f4e1a9e79daed3365cec553b82

Expected behavior

What should have happened? Please include as much detail as possible.
Vagrant should be able to find laravel/homestead box v13.0.0

Actual behavior

What actually happened? Please include as much detail as possible.

it just fails saying...

"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."

listing the available versions including v13.0.0

Steps to reproduce

  1. Run vagrant up

References

Is it me or laravel/homestead box version v13.0.0 does not support Virtual Box provider? I found this changes here on Vagrant file laravel/settler@v12.2.0...v13.0.0 from virtualbox to parallels

Other information

I tried running vagrant box update, this also has this output, it can't find v13.0.0

$ vagrant box update
==> homestead: Checking for updates to 'laravel/homestead'
    homestead: Latest installed version: 12.2.0
    homestead: Version constraints: >= 13.0.0, < 14.0.0
    homestead: Provider: virtualbox
    homestead: Architecture: "x64"
==> homestead: Box 'laravel/homestead' (v12.2.0) is running the latest version.
@JustinRR
Copy link

JustinRR commented Nov 3, 2023

Can you try this command to add a box...

vagrant box add laravel/homestead https://app.vagrantup.com/laravel/boxes/homestead

@skeeith
Copy link
Contributor Author

skeeith commented Nov 4, 2023

@JustinRR the command works, any idea how we can fix this when running vagrant up or vagrant box update or vagrant box add laravel/homestead?

@skeeith
Copy link
Contributor Author

skeeith commented Nov 5, 2023

@JustinRR FYI, after running vagrant up for the first time, when I ssh into the server it's asking me for password

$ homestead ssh
vagrant@127.0.0.1's password:

too weird, well the password is still the same but still

@ducconit
Copy link

ducconit commented Nov 5, 2023

@skeeith I think it's due to the version of Vagrant you are using. If you use vagrant 2.3.7 or an earlier version, I believe the version not found error should not occur.
The solution has already been suggested by @JustinRR , so I have nothing more to say :v

@skeeith
Copy link
Contributor Author

skeeith commented Nov 7, 2023

@ducconit apparently, it's still the same with vagrant version 2.3.7 though. any other ideas as to why that's the issue?

@ducconit
Copy link

ducconit commented Nov 7, 2023

@ducconit apparently, it's still the same with vagrant version 2.3.7 though. any other ideas as to why that's the issue?

You're talking about which error? Homestead not found? Well, I noticed the error was due to Vagrant's API v2 not finding information about the box. I encountered this issue when using Vagrant version 2.4.x. I reinstalled Vagrant 2.3.x, and the error disappeared. The approach JustinRR mentioned is to specify the exact path to retrieve Homestead information.

Still an issue with entering the password. I believe the SSH key hasn't been added to the Vagrant box, so you're required to enter a password to log in. By adding the public key to the authorized_keys, you may not need to enter a password anymore.

@skeeith
Copy link
Contributor Author

skeeith commented Nov 7, 2023

@ducconit already done it, double checked the keys and everything else. even setup openssh manually like any other ubuntu servers on the cloud, it's having issue I can't seem to figure it out, I even checked the firewalls and ports too.

also when you said Vagrant 4.x you're referring to Vagrant v2.4.0 right? and Vagrant 3.x is Vagrant v2.3.X right? just clarifying it cause I'm confused on the versions you mentioned

@ducconit
Copy link

ducconit commented Nov 7, 2023

@ducconit already done it, double checked the keys and everything else. even setup openssh manually like any other ubuntu servers on the cloud, it's having issue I can't seem to figure it out, I even checked the firewalls and ports too.

also when you said Vagrant 4.x you're referring to Vagrant v2.4.0 right? and Vagrant 3.x is Vagrant v2.3.X right? just clarifying it cause I'm confused on the versions you mentioned

Sorry, a typing error. It's 2.4.x and 2.3.x. I fixed it.
Can you show me its content: cat /etc/sudoers.d/vagrant

@skeeith
Copy link
Contributor Author

skeeith commented Nov 7, 2023

@ducconit sorry I just destroyed the box, will try again with a clean slate maybe that would fix things, but there's something I noticed when I tried to ssh into the vm

when I tried to run this ssh -i "~/.ssh/id_rsa" vagrant@192.168.56.56 it worked perfectly fine and I'm able to ssh normally, but when I tried just the vagrant ssh it's asking me for password saying vagrant@127.0.0.1's password.

maybe you would encounter this issue also if you would try v2.4.0

if I still get the same errors, I'll downgrade to v2.3.7 for the mean time, until someone can figure things out

@andrewvink
Copy link

andrewvink commented Nov 7, 2023

Also encountered this, installed Vagrant v2.4.0 - had the password prompt when trying ssh in. Plus had PHP Bad Gateway issues.

What worked for me:

  • Delete all vagrant boxes
  • Uninstall Vagrant v2.4.0
  • Downgrade to Vagrant v2.3.7
  • Trashed my /Homestead/ folder
  • Cloned Homestead Repo and Init
  • $ vagrant box add laravel/homestead https://app.vagrantup.com/laravel/boxes/homestead
  • $ vagrant up --provision

Everything is working normally, no PHP Gateway issues and no password prompts with ssh

@skeeith
Copy link
Contributor Author

skeeith commented Nov 7, 2023

@andrewvink I forgot to mention, I had the same issue with PHP Bad Gateway too, it's like Vagrant v2.4.0 completely breaks Homestead.

  • SSH not working, even with manually settings up everything to work correctly
  • PHP Bad Gateway issue
  • Laravel/Homestead box not found

pretty sure there's more issue we haven't found with v2.4.0

I also did what you did just a few hours ago, everything is back to normal with v2.3.7.

@skeeith
Copy link
Contributor Author

skeeith commented Nov 7, 2023

@svpernova09 hey Joe, maybe you can give me a hint or a guide on where to look for these issues? I would be willing to patch it up for others, but I don't know where to look regarding this issues

@ducconit
Copy link

ducconit commented Nov 8, 2023

I've figured out the reason for being prompted for a password when using vagrant ssh. Starting from version 2.3.8, Vagrant will use a different private_key, so what we need to do is replace the private_key of Homestead in the path/to/homestead/.vagrant\machines\homestead\virtualbox directory. Please replace it with the private_key here and reload Homestead. I've tried it, and it works on vagrant 2.4.0 @skeeith

@skeeith
Copy link
Contributor Author

skeeith commented Nov 8, 2023

@ducconit I don't know what keys to copy, I'm assuming it's all with the Add ed25519 insecure private key tags on the commit.
I noticed this ed25519 keys somewhere, but didn't bother with it lol.

how about the PHP Bad Gateway issue, did you found anything about it? the stack (nginx, php8.2, mysql, etc) seems to be running normally last time I checked before I destroyed the box

@svpernova09
Copy link
Contributor

Vagrant changing the private key will be fixed with a new base box release. I've been preparing for a new base box to be released later this month once PHP 8.3 has been released to the PPA.

@svpernova09
Copy link
Contributor

A way around the vagrant key being incorrect in the base box would be to point this configuration in your Homestead.yaml to valid SSH keys and Vagrant will add them to the user.

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

@skeeith
Copy link
Contributor Author

skeeith commented Nov 9, 2023

@svpernova09 oh man, thank you for this good news. do let me know if you need any help on upgrading certain packages, or things or testing. I would be happy to help in any way. cheers

@svpernova09
Copy link
Contributor

I've confirmed Vagrant 2.4.0 vagrant ssh will work if you point the Homestead SSH keys to paths that exist. If you're unable to do this I would suggest downgrading to Vagrant 2.3.7 until the next base box is released.

@lihe6666
Copy link

Can you try this command to add a box...

vagrant box add laravel/homestead https://app.vagrantup.com/laravel/boxes/homestead

You are right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants