Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 847 forks source link

Can't access vvv.test, IP address not found #1749

Closed bibliofille closed 5 years ago

bibliofille commented 5 years ago

Expected Behavior

I'm just getting up and running with Vagrant and VVV. I completed the installation steps, including installing the vagrant-hostsupdater plugin and ran a vagrant up command. I expected to be able to access vvv.test in a browser.

Current Behavior

When I try to visit vvv.test in a browser, I see an error message saying vvv.test's IP address cannot be found. I've tried this in Chrome, Firefox, and Safari.

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment

tomjn commented 5 years ago

Hey Debbie,

Sorry to hear you're having problems, would it be possible to see a copy of the vagrant up commands output? And a screen shot of your browser? I know the output can be quite large so put it in a gist or wrap it in a details tag

On Wed, 20 Mar 2019 at 19:37, Debbie Labedz notifications@github.com wrote:

Expected Behavior

I'm just getting up and running with Vagrant and VVV. I completed the installation steps, including installing the vagrant-hostsupdater plugin and ran a vagrant up command. I expected to be able to access vvv.test in a browser. Current Behavior

When I try to visit vvv.test in a browser, I see an error message saying vvv.test's IP address cannot be found. I've tried this in Chrome, Firefox, and Safari. Possible Solution Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context Your Environment

  • VVV version: v2.5.1
  • VVV Git Branch: master
  • Vagrant version: 2.2.4
  • VM Provider name: VirtualBox
  • VM Provider version: 6.0.4r128413
  • Operating System and version: OSX 10.11.3

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1749, or mute the thread https://github.com/notifications/unsubscribe-auth/AADl53cpmNKRsDWnC-LYLxvJKHKtrnhRks5vYo4HgaJpZM4cAG-j .

bibliofille commented 5 years ago

Thanks for the prompt reply, @tomjn! Here's a gist with my vagrant up commands output: https://gist.github.com/bibliofille/1a9d36f7952246375631b9fc68a335ea

Attached is a screenshot of my browser.

I just moved from my iPhone personal hotspot wifi to my home wifi, and now I'm seeing a DNS error when I try to navigate to vvv.test. Screenshot also attached.

Screenshot 2019-03-20 14 17 05

Screenshot 2019-03-20 15 33 02

Gist
Vagrant output
Vagrant output. GitHub Gist: instantly share code, notes, and snippets.
tomjn commented 5 years ago

It looks like it didn't do anything, it tried to set the hosts file entries but couldn't and bailed super early on. Did it ask you for your password to change the hosts file?

On Wed, 20 Mar 2019 at 20:35, Debbie Labedz notifications@github.com wrote:

Thanks for the prompt reply, @tomjn https://github.com/tomjn! Here's a gist with my vagrant up commands output: https://gist.github.com/bibliofille/1a9d36f7952246375631b9fc68a335ea

Attached is a screenshot of my browser.

I just moved from my iPhone personal hotspot wifi to my home wifi, and now I'm seeing a DNS error when I try to navigate to vvv.test. Screenshot also attached.

[image: Screenshot 2019-03-20 14 17 05] https://user-images.githubusercontent.com/8399013/54717209-aa077780-4b25-11e9-9f8b-b13f928552bb.png

[image: Screenshot 2019-03-20 15 33 02] https://user-images.githubusercontent.com/8399013/54717237-b68bd000-4b25-11e9-8357-6241f3730639.png

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1749#issuecomment-475017340, or mute the thread https://github.com/notifications/unsubscribe-auth/AADl5wCEpi61E3oGhEaAamt1rigm4TC1ks5vYpuGgaJpZM4cAG-j .

bibliofille commented 5 years ago

No, it did not prompt me to enter a password. Should I have used $ sudo vagrant upinstead?

tomjn commented 5 years ago

Nope I've never used sudo with vagrant, I remember helping someone who used sudo which lead to lots of problems, your issues seem Isolated to the vagrant hosts updater plugin

A quick obvious fix would be to change the permissions on your hosts file but not everybody is comfortable with that, and I recent set up on a new machine and didn't have to change the permissions ( but it did ask for a password to modify the hosts file )

What are the permissions on /etc/hosts? Do you have security software installed such as Avast or Avira?

On Wed, 20 Mar 2019 at 20:39, Debbie Labedz notifications@github.com wrote:

No, it did not prompt me to enter a password. Should I have used $ sudo vagrant up instead?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1749#issuecomment-475018751, or mute the thread https://github.com/notifications/unsubscribe-auth/AADl54N_9Hp_bb4Sp70zkU9sarHcJj7fks5vYpx3gaJpZM4cAG-j .

bibliofille commented 5 years ago

Ok, I changed the file permissions for my hosts file. They were listed as "custom" and I changed them to "read write" for my username. I was able to access vvv.test for a short time. However, I tried to access trunk.wordpress.test and got an error message saying the provisioning likely failed.

Then I did vagrant provision. Now I'm getting a 502 bad gateway error when I try to access vvv.test or any of the other available VVV urls.

Here's an output of that command: https://gist.github.com/bibliofille/f298a2699d392e84ab5a6c0438a89dd7

Gist
vagrant provision output
vagrant provision output. GitHub Gist: instantly share code, notes, and snippets.
tomjn commented 5 years ago

Those are very weird results, where in your filesystem did you put VVV? I've never seen it struggle like that with chmod, usually chmod is barely mentioned at all in provisioning. Are you sure you didn't do something to your filesystem or user permissions? In the short time you had access to vvv.test had provisioning finished? Or was it still ongoing?

At this point if you have nothing of value inside the VM, I'd suggest destroying the VM via vagrant destroy then reprovisioning and starting fresh.

The final output of a vagrant provision should end with green output that looks something like this:

    default: Adding domains to the virtual machine's /etc/hosts file...
    default: Adding hosts from the VVV config entry
    default:  * Added trunk.wordpress.test from /vagrant/vvv-custom.yml
    default:  * Restarting nginx nginx
    default:    ...done.
bibliofille commented 5 years ago

I didn't do anything to the file system other than change the file permissions on private/hosts, which is what finally got it working in the first place.

I decided to do a vagrant destroy to start from scratch. However, after that completed and I tried a vagrant up again. I got some error messages. https://gist.github.com/bibliofille/11f6ce9722658af2b298972bfee158d1

Should I try vagrant destroy again? And then maybe vagrant box remove?

Gist
vagrant up output
vagrant up output . GitHub Gist: instantly share code, notes, and snippets.
tomjn commented 5 years ago

These are rather alarming errors, that indicate that for whatever reason the filesystem inside the VM went from writable to read only. I have no explanation for why this might happen

 default: /tmp/vagrant-shell: line 279: /usr/bin/apt-get: No such file or directory

That error should be impossible, it's the equivalent of you using the App store only for it to disappear from your computer halfway through an install.

The kinds of issues you're seeing aren't the sort that are easily debuggable, and are rather alarming, the provisioner scripts VVV runs assume some fundamental things that appear to be broken for you, such as that the filesystem inside the VM is writeable, and stays writeable, or that installed programs stay installed and don't mysteriously dissapear.

Are you absolutely sure you don't have additional security software/antivirus/corporate policies on your Mac? Or ran cleaners or security commands? I also notice you're on El Capitan, I don't believe it would make a difference, or how it would be a factor, but it's an old version of MacOS.

I'm also assuming this is in a vagrant-local folder inside your users home directory? Did you reboot your machine after the VirtualBox/Vagrant installation?

bibliofille commented 5 years ago

Yikes. This sounds bad. I'm very certain I don't have any security software installed. I haven't run any security commands. I'm on my personal laptop.

I had assumed I was in my vagrant-local folder because I was able to get to it using cd vagrant-local, which I typed in first before running the vagrant up command. But I'm really not sure anymore. From the Finder, I went to Go to folder then selected /vagrant-local and it said no folder found.

Yes, I rebooted my machine after the initial VirtualBox/Vagrant installation per the installation guide recommendation.

tomjn commented 5 years ago

I had assumed I was in my vagrant-local folder because I was able to get to it using cd vagrant-local, which I typed in first before running the vagrant up command. But I'm really not sure anymore. From the Finder, I went to Go to folder then selected /vagrant-local and it said no folder found.

When you open the terminal it defaults to your home directory, but you can confirm that by running pwd and it'll output the current folder, and if you run open . it'll open the current folder in Finder too.

I'll need to think and do some research to try and figure out what's going on, but a wild guess might be that you don't have enough free space to finish provisioning.

Something else i'd like you to try, switch over to the develop branch, and remove vvv-custom.yml then reprovision:

rm vvv-custom.yml
git checkout develop
vagrant up --provision
bibliofille commented 5 years ago

Ok, I removed the vvv-custom.yml file, switched to the develop branch, and tried vagrant up --provision again. Here is the output of those commands: https://gist.github.com/bibliofille/f338ebaa935735c578fbb05bd2f60d07

Gist
vagrant develop branch provision output
vagrant develop branch provision output. GitHub Gist: instantly share code, notes, and snippets.
tomjn commented 5 years ago

hmm you might need to run vagrant halt first if it's already up and running, I'd also vagrant destroy

bibliofille commented 5 years ago

Ok, so vagrant halt, then vagrant destroy, then start again with the rm vvv-custom.yml, etc. steps?

On Thu, Mar 21, 2019 at 10:12 AM Tom J Nowell notifications@github.com wrote:

hmm you might need to run vagrant halt first if it's already up and running, I'd also vagrant destroy

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1749#issuecomment-475269836, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAopWQk_77r0AUmGCvjXzzlyboOosAzks5vY6FWgaJpZM4cAG-j .

-- Debbie Labedz Bibliofille Creative http://www.bibliofille.com

Twitter https://twitter.com/bibliofilleblog / Instagram http://instagram.com/bibliofille

tomjn commented 5 years ago

Yeah, and lets remove the base box too for good measure

vagrant halt
vagrant destroy
vagrant box remove ubuntu/trusty64
vagrant box prune
rm vvv-custom.yml
git checkout develop
vagrant up --provision

Thanks for being patient btw, I know it's a lot of commands and steps

bibliofille commented 5 years ago

Looks like that did the trick! I'm wondering if when I did an earlier vagrant destroy, it didn't actually completely remove the box, and therefore caused a bunch of issues when trying to vagrant up again?

Here's the output of all those commands, in case it's helpful: https://gist.github.com/bibliofille/067abd33ecd5bdf0b91f62e677413182

One thing though. It looks like wordpress-trunk skipped provisioning, so can't open that URL. How do I fix that?

Gist
vagrant box remove output
vagrant box remove output. GitHub Gist: instantly share code, notes, and snippets.
tomjn commented 5 years ago

Awesome :) I suspect it was the Ubuntu box ubuntu/trusty64 that might have been a bit off, not sure how that happened.

Before I mark this closed, lets confirm this isn't a fluke and get the trunk site working

One thing though. It looks like wordpress-trunk skipped provisioning, so can't open that URL. How do I fix that?

So because of #1746 the default vvv-custom.yml got changed so that it skips that site ( it takes a while to provision ), that change will be in v2.6, if you go into vvv-custom.yml and change it from true to false and reprovision with vagrant provision then that should set up the trunk site.

Do that and let me know if all is still good :)

bibliofille commented 5 years ago

Ok, it looks like trying to get trunk.wordpress.test is where everything goes wrong. I edited the vvv-vustom.yml file to say "false" instead of "true" and did vagrant up --provision. That threw some error messages and now vvv.test returns a 502 gateway error.

Here's the output: https://gist.github.com/bibliofille/7769012c89dc1da85c521f88ebae8d22

I wonder, then, if I just don't have enough memory on my machine to get load trunk.wordpress.test?

Gist
failed provision of trunk.wordpress.test
failed provision of trunk.wordpress.test. GitHub Gist: instantly share code, notes, and snippets.
tomjn commented 5 years ago

ok, so the issue hasn't gone away, out of curiosity how much free space do you have on your machine?

bibliofille commented 5 years ago

459.26 GB free of 748.93 GB

On Thu, Mar 21, 2019 at 3:15 PM Tom J Nowell notifications@github.com wrote:

ok, so the issue hasn't gone away, out of curiosity how much free space do you have on your machine?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1749#issuecomment-475385618, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAopas3Og0aZXlCvK4A7SJWCtdvQOjEks5vY-h3gaJpZM4cAG-j .

-- Debbie Labedz Bibliofille Creative http://www.bibliofille.com

Twitter https://twitter.com/bibliofilleblog / Instagram http://instagram.com/bibliofille

ghost commented 5 years ago

i've been following up this, how much ram do you have currently. i wondered if its trunk issue.

bibliofille commented 5 years ago

4 GB

On Thu, Mar 21, 2019 at 3:20 PM Benjamin Lu notifications@github.com wrote:

i've been following up this, how much ram do you have currently. i wondered if its trunk issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1749#issuecomment-475387178, or mute the thread https://github.com/notifications/unsubscribe-auth/AIAopTa-3weJMYdt1Kri4iMar6hdFcEVks5vY-mRgaJpZM4cAG-j .

-- Debbie Labedz Bibliofille Creative http://www.bibliofille.com

Twitter https://twitter.com/bibliofilleblog / Instagram http://instagram.com/bibliofille

tomjn commented 5 years ago

hmm 4GB isn't much, I don't know what the minimum needed would be, but vvv-custom.yml specifies 2GB for RAM, lets nerf that down to 1024 and 1 cpu core, find this:

vm_config:
  memory: 2048
  cores: 2
  # provider: vmware_workstation

and swap it for this:

vm_config:
  memory: 1024
  cores: 1

Then run:

vagrant halt
vagrant destroy
vagrant up --provision

That'll recreate the VM with half the RAM. I'm hesitant to push it lower than 1024mb but if RAM is the culprit and 1024 is better but not enough, 768 would be the next step

bibliofille commented 5 years ago

Finally, some success. I'm now able to access trunk.wordpress.test.

I did end up having to go down to 768. The provision failed at 1024. So I guess it was a RAM issue all along? I know 4 GB isn't that much, but in reading the docs, I only 2 GB as a requirement, so I figured 4 GB would be serviceable.

tomjn commented 5 years ago

That looks to be the cause, I think we originally had 1 core at 1024mb assigned, and assigning more cores and RAM does improve performance so we bumped it up to 2048 and 2 cores. I think some investigation on what to recommend is needed.

I'm going to close this out now, but if it happens again at 768 post here and mention me. Also I'd love to know how well 768 works out performance wise, if you can give a thumbs up or down after doing some work with that setting that'd be super handy to know :)

bibliofille commented 5 years ago

Will do! Thanks so much for all your help!

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.