bradp / vv

:globe_with_meridians: Variable VVV - a VVV Site Creation Wizard.‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ :x: This project is no longer maintained. Please update your copy of VVV , which has most of the vv features built in.
GNU General Public License v2.0
1k stars 90 forks source link

vv create - creates blank folder, no htdocs, also error in nginx config #330

Closed vikcon closed 7 years ago

vikcon commented 7 years ago

When I type vv create it asks all the parameters, runs provision, site folder gets created in /vagrant-local/www/, It creates blank DB. but There is no htdocs folder within it, no WordPress files. I have to do it manually.

Also there is an error with nginx config. I have to do vagrant ssh & edit vvv-wordpress-default-xxxxxxxxx.conf & vvv-wordpress-develop-xxxxxxxxxxx.conf to comment out following line set $upstream {upstream]; this nginx error happens everytime I run provision.

Anything I am doing wrong here?

solace commented 7 years ago

+1 Need to manually run vvv-init.sh in the new directory.

It runs with no noticeable errors, updates wordpress-default, wordpress-develop, then:

and at the nginx restart:

==> default: nginx: [emerg] directive "set" is not terminated by ";" in /etc/nginx/custom-sites/vvv-auto-wordpress-default-provisioner-provision-1b771c7975e79d255ff8985e481a2a12.conf:17
==> default: nginx: configuration file /etc/nginx/nginx.conf test failed

After running vvv-init.sh in the new directory, everything seems fine. Didn't have to touch nginx.

macgraphic commented 7 years ago

Following, also getting the same issue.

nuttifox commented 7 years ago

Same issue here. No htdocs folder and empty DB.

adamk22 commented 7 years ago

Same here, no htdocs and empty DB. Need to manually run the vvv-init.

blairworks commented 7 years ago

I had the same thing happen. I then added my site directory to the "sites:" object in "vvv-config.yml" like

sites:    (...default site provisioners here...)    wordpress-default:

(blank after the colon) and ran a "vagrant up --provision" and it picked up the vvv-init and downloaded the latest WordPress and installed it.

However, sites I have setup this way no longer seem to have their database backed up when I do a "vagrant halt". I'm not sure if there are any issues with this method.

macgraphic commented 7 years ago

vv --debug-vv results in the following: `/usr/local/bin/vv: line 1481: version: command not found

vv: /usr/local/bin/vv

vv_config: /Users/mark/.vv-config vvv path: /Volumes/MacDev/vagrant-local home: /Users/mark

tput: cat: /bin/cat curl: /usr/bin/curl brew: /usr/local/bin/brew tar: /usr/bin/tar find: /usr/bin/find git: /usr/local/bin/git sed: /usr/bin/sed paste: /usr/bin/paste vagrant: /usr/local/bin/vagrant

iMac:vagrant-local mark$ `

code from that file:

`vvoutput_debug_vv() { echo "----------" version echo "" echo "vv: $(which vv)" echo "" echo "vv_config: $vv_config" echo "vvv path: $path" echo "home: $home" echo "" echo "tput: $(whichtput 2>/dev/null)" echo "cat: $(which cat)" echo "curl: $(which curl)" echo "brew: $(which brew)" echo "tar: $(which tar)" echo "find: $(which find)" echo "git: $(which git)" echo "sed: $(which sed)" echo "paste: $(which paste)" echo "vagrant: $(which vagrant)"

echo "----------"

}`

jversmis commented 7 years ago

Same here.

When I cd into /www/, chmod the vvv-init.sh script and execute it, I get:

Installing WordPress (release version) in www.mysite.be/htdocs... ./vvv-init.sh: line 7: wp: command not found ./vvv-init.sh: line 8: wp: command not found ./vvv-init.sh: line 14: wp: command not found

Did I somehow miss a step in my setup or is this related to the issue mentioned above?

blairworks commented 7 years ago

@jversmis I initially did try running the init script directly using "vagrant ssh" to ssh into the box itself rather than run it from my local computer -- were you using SSH? However, it seemed to set a site up better better when I used the approach in my previous comment.

@vikcon that Nginix error went away for me during creation after I updated VVV with a git pull (had to stash and merge my vagrantfile during the update).

bretterballz commented 7 years ago

I'm having the same exact issue as @jversmis

carottemendoza commented 7 years ago

Did exact same as @jversmis Then ended up here...

jversmis commented 7 years ago

@blairworks I was running the script from my local machine.

Clone02A1 commented 7 years ago

any solution for this ? i have the same problem . if i go in vagrant ssh there is an update , ill try to do that and see if it helps

matt-antone commented 7 years ago

I was having the same problem using VVV version 1.4. I downgraded to 1.3. Problem solved. It appears they've changed the provisioning.

jversmis commented 7 years ago

@blairworks I can confirm that ssh'ing into the vagrant box and running the script there works.

In fact, this seems to be the most logical way of working. Why would you put up a vagrant box and run scripts which require a tool (wp) on you host machine? I don't know why I didn't think of that yesterday :-)

blairworks commented 7 years ago

@jversmis That is great news. Now, what I've understood from browsing at VVV lately is that with the new provisioning system, you are supposed to add the site, like in my previous comment, to a copy of "vvv-config.yml" that has been saved at "vvv-custom.yml".

If you do that as a last step after adding the site via "vv create", then it should run the script during the next "vagrant up --provision". With this method, you don't need to actually go in via "vagrant ssh" and run it manually (I'm not sure if running it manually has any drawbacks).

I do still have a problem though that my new sites no longer seem to have their database backed up when I do a "vagrant halt" (but the old ones do....). If you are running the triggers plugin, I'd be curious to know if you have run into the same problem. I can't figure out what the difference between the old and new sites are that is causing this different behavior -- it is very strange.

blairworks commented 7 years ago

OK - I've learned a few key things:

bill-mpakas commented 7 years ago

I also have the same exact issue as @jversmis

erikdmitchell commented 7 years ago

So I think I'm jumping in late here. I have some similar problems and was hoping to help some out. Like @blairworks my VVV was on the "develop" branch. I switched to the "master" branch and that seemed to fix my empty folder issue.

I know get this error:

==> default: nginx: [emerg] directive "root" is not terminated by ";" in /etc/nginx/custom-sites/vvv-auto-wordpress-default-provisioner-provision-1b771c7975e79d255ff8985e481a2a12.conf:12 ==> default: nginx: configuration file /etc/nginx/nginx.conf test failed

I did "vagrant ssh" and then nano edited the file to no avail. It sounds similar to the original problem @vikcon was having. Does anyone know what I should edit in that file, or what I should comment out?

I can't seem to get this to work properly and am stuck.

blairworks commented 7 years ago

@erikdmitchell I don't think 'master' is necessarily stable either. As of this moment, the stable release is the tagged release 1.4.1:

https://github.com/Varying-Vagrant-Vagrants/VVV/releases/latest

It might be safer to clone that tag if you want a stable version.

If instead you want to try another crack at "develop", this blog post supporting the upcoming VVV 2.0 goes into more detail about how the new provisioner configuration works. I'm staying on the develop branch myself, until the 2.0 release so that I can take advantage of this more powerful provisioner. Basically, all this means and just adding the new site to the sites object. As long as I have done that, Variable VVV seems to provision WordPress properly.

LoreleiAurora commented 7 years ago

@blairworks Master is 1.4.1 and is verry stable

The problem only exists if you try to move from develop back down to master.

blairworks commented 7 years ago

@LoreleiAurora That is great to hear. I'd gotten the impression from one of the comments to your issue here that it does not always represent the latest stable release.

BTW, thanks for all the great work you have put into the upcoming 2.0 release! The new provisioning system is great.

LoreleiAurora commented 7 years ago

@blairworks Thanks 😀

The reason for that comment was because if you just git clone vvv it will use develop by default.

erikdmitchell commented 7 years ago

@blairworks I will update to 1.4.1. If that doesn't work I'll check out the other thread you mentioned. Just need to get vvv running in the morning so I can get some work done.

Thanks for the help so far.

erikdmitchell commented 7 years ago

Thanks to everyone for the help. 1.4.1 seems to be very stable and working well. Hopefully this will solve a lot of the issues people are having.

macgraphic commented 7 years ago

I've updated to 1.4.1, but still getting the empty DB & no htdocs directory - what am I missing?

matthewmcvickar commented 7 years ago

@macgraphic You need to add your site to the vvv-custom.yml file in the root of the VVV installation. For example, if you are adding a site called macgraphic.dev:

  1. In the root of the VVV installation (the vagrant-local folder), duplicate the vvv-config.yml file and name the copy vvv-custom.yml.

  2. Add your site to the vvv-custom.yml file:

    ---
    sites:
      wordpress-default:
        repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
        hosts:
          - local.wordpress.dev
    
      macgraphic:
        hosts:
          - macgraphic.dev

    (Leave the rest of the file alone. It is run instead of vvv-config.yml, not in addition to it, so you need to leave in the default WP installations if you still want them.)

  3. Create your site: vv create macgraphic

VV will then create the site as expected.

macgraphic commented 7 years ago

Thanks @matthewmcvickar As you can tell, I am fairly new to the world of Vagrant (Former MAMP user). Also I was trying the vvv-custom.yml after doing the vv -create. Cheers!

matthewmcvickar commented 7 years ago

@macgraphic Glad you got it working. I'm in the same boat as you, and there's very little documentation, so it's a challenge!

LoreleiAurora commented 7 years ago

@macgraphic @matthewmcvickar were working on the documentation, its just steady going as its a major rewrite.

matthewmcvickar commented 7 years ago

@LoreleiAurora Indeed; I know it's a big task and I appreciate your work a lot. The new provisioner is an excellent improvement. 🙂

It's frustrating to need to dig through and interpret comments in GitHub issues in order to get something to work. A notice in the VV readme or even in the existing VVV documentation (since that's where a lot of VV users will end up) would help a lot, I think.

I'd love to help add that—would that be helpful?

LoreleiAurora commented 7 years ago

@matthewmcvickar open an issue and see what the rest of the team thinks :)

For now, this is the closest thing to docs https://tomjn.com/2017/01/16/whats-new-vvv-2-0/

maxreality commented 7 years ago

I added the site via custom.yml. However, when I navigate to the local site, it displays the default vvv.dev content. Any ideas?

jversmis commented 7 years ago

@maxreality Not tested but have you added the new domain to you hosts file on the host machine?

error2k2 commented 7 years ago

So this has been my personal experience. Since the new provisioner in the vvv develop branch doesn't automatically run the vvv-init.sh script in the /www/ directory unless you manually add it in the vvv-custom.yml. You have 2 options. Read and learn how to add a site in the vvv-custom.yml as described in https://tomjn.com/2017/01/16/whats-new-vvv-2-0/ or ssh into your box and run the vvv-init.sh yourself.

Since I am lazy and want everything done for me I decided to switch branches from develop to master... huge mistake. i got the same problem that @erikdmitchell got, ==> default: nginx: [emerg] directive "root" is not terminated by ";" in /etc/nginx/custom-sites/vvv-auto-wordpress-default-provisioner-provision-1b771c7975e79d255ff8985e481a2a12.conf:12 ==> default: nginx: configuration file /etc/nginx/nginx.conf test failed

Quickest solution was to clone a brand new master branch. If anyone knows a good method to switch from develop to master without starting from scratch it would be nice to know.

For now I am happy with the master branch and till vv create can append a site to vvv-custom.tml automatically I'll stick with it for now. I did want to try out the new per-site provisioning but like I said. I love everything done for me.

LoreleiAurora commented 7 years ago

@error2k2 To switch from develop to master you have to delete the wordpress-default, wordpress-develop & wordpress-trunk directories from www and re-provision.

error2k2 commented 7 years ago

@LoreleiAurora Thanks, looking back it seems obvious, hope it helps others.

maxreality commented 7 years ago

@jversmis My hosts file looks like the following 192.168.50.4 vvv.dev local.wordpress.dev local.wordpress-trunk.dev src.wordpress-develop.dev build.wordpress-develop.dev 192.168.50.4 testsite.dev

LoreleiAurora commented 7 years ago

@maxreality

maxreality commented 7 years ago

@LoreleiAurora thank you for replying. I actually just got it working. My file was/is vvv-custom.yml. I actually didn't realize using VV was necessary after adding the site to the custom.

1.) I removed all installs from www like you mentioned in a previous post. 2.) I switched from development branch to master and reprovisioned. 3.) I noticed the install wasn't installed, so I then ran vv create. 4.) Everything appears to be working as expected. Now onto port forwarding. I'm on a VPN a lot of the time, and there are IP conflicts.

Thank you and everyone for your assistance. Just so I'm clear, is it necessary to use vv for site creation, or should modifying the custom file alone do the trick?

neilgee commented 7 years ago

On VVV develop 1.4.1.

Also getting this on vagrant up

==> default: Running provisioner: shell...
    default: Running: inline script
==> default: mysql stop/waiting
==> default: mysql start/running, process 13043
==> default: Running provisioner: shell...
    default: Running: inline script
==> default:  * Restarting nginx nginx
==> default: nginx: [emerg] directive "root" is not terminated by ";" in /etc/nginx/custom-sites/vvv-auto-wordpress-default-provisioner-provision-1b771c7975e79d255ff8985e481a2a12.conf:12
==> default: nginx: configuration file /etc/nginx/nginx.conf test failed
LoreleiAurora commented 7 years ago

@neilgee Can you git pull the main VVV repo?

neilgee commented 7 years ago

@LoreleiAurora just going to checkout master and

delete the wordpress-default, wordpress-develop & wordpress-trunk directories from www and re-provision.

That should do it right?

LoreleiAurora commented 7 years ago

Yeah it will.

neilgee commented 7 years ago

@LoreleiAurora sweet thanks, back in the game!

Android63 commented 7 years ago

I had exactly the same problem (no htdocs and empty database). Running the following command after vv create fixes it:

vagrant ssh -c "cd /srv/www/<sitename> && ./vvv-init.sh"

@bradp I'm happy to offer a pull request including this fix

Also, it would be prudent for the script to check the folder and database have been created

Autive commented 7 years ago

This last solution gives me new errors atm. Im on the latest vv and on develop on vvv. But when i do:

vagrant ssh -c "cd /srv/www/<sitename> && ./vvv-init.sh"

it states:

Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select theanimalagedatabase.

So for some reason it isn't creating the database for me...

cgrymala commented 7 years ago

I'm having the same issue as @Autive. I copied vvv-config.yml to vvv-custom.yml; added my additional site info; and then ran vv create. That got me as far as downloading WordPress into the appropriate directory, but then I encountered the MySQL error mentioned above. When I open phpMyAdmin on the server, it shows that the new database doesn't exist.

I am running OSX Sierra 10.12.3, VirtualBox 5.0.32, have VVV up to date with branch origin/develop and have VV up to date with branch origin/master. I also ran vagrant box update after I started running into these issues and noticed a message saying the box itself needed an update.

bradp commented 7 years ago

Closing this, I'm going to start tracking 2.0 support in https://github.com/bradp/vv/issues/348.