Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

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

Closed
vikcon opened this issue Jan 11, 2017 · 48 comments
Closed

Comments

@vikcon
Copy link

vikcon commented Jan 11, 2017

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
Copy link

solace commented Jan 12, 2017

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

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

  • reports some warnings at "Installing local npm packages for src.wordpress-develop.dev, this may take several minutes."
  • aborts the "Initializing grunt and creating build.wordpress-develop.dev, this may take several minutes." task

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
Copy link

Following, also getting the same issue.

@nuttifox
Copy link

Same issue here. No htdocs folder and empty DB.

@adamk22
Copy link

adamk22 commented Jan 12, 2017

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

@blairworks
Copy link

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
Copy link

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:

`__vv__output_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
Copy link

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
Copy link

@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
Copy link

I'm having the same exact issue as @jversmis

@carottemendoza
Copy link

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

@jversmis
Copy link

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

@Clone02A1
Copy link

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
Copy link

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
Copy link

@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
Copy link

@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
Copy link

OK - I've learned a few key things:

  • I am on the "develop" branch and was not aware. It uses the new provisioner. You might want to check and see what branch you are on if you are having this problem. As of this time, the current release of VVV is 1.4.
  • With the new provisioner, it seems to work with Variable VVV as long as you add your site to the sites object in a copy of "vvv-config.yml" that has been saved at "vvv-custom.yml". If I have done so, and then do "vv create", everything behaves as expected and there is no empty folder.
  • My issue with the backups ended up being a quirk. Certain database names are filtered out of the list of databases to dump. My sites/databases had the word "test" as part of the name... Any database with the the name "test" within is automatically excluded from the backup, probably trying to filter out sample databases and the like. You can see what other names are filtered out by the dump script.

@bill-mpakas
Copy link

I also have the same exact issue as @jversmis

@erikdmitchell
Copy link

erikdmitchell commented Jan 17, 2017

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
Copy link

@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
Copy link

@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
Copy link

@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
Copy link

LoreleiAurora commented Jan 17, 2017

@blairworks Thanks 😀

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

@erikdmitchell
Copy link

@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
Copy link

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
Copy link

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

@matthewmcvickar
Copy link

matthewmcvickar commented Jan 19, 2017

@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
Copy link

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
Copy link

@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
Copy link

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

@matthewmcvickar
Copy link

@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
Copy link

@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
Copy link

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
Copy link

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

@error2k2
Copy link

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
Copy link

@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
Copy link

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

@maxreality
Copy link

@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
Copy link

@maxreality

  • Have you named the file custom.yml or vvv-custom.yml?
  • Did you add the site before or after creating the site with vv?
  • If after did you run vagrant provision after adding the site?
  • What is the directory name of the site in www?
  • Post your vvv-custom.yml in a gist and link it here?

@maxreality
Copy link

@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
Copy link
Contributor

neilgee commented Jan 20, 2017

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
Copy link

@neilgee Can you git pull the main VVV repo?

@neilgee
Copy link
Contributor

neilgee commented Jan 21, 2017

@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
Copy link

Yeah it will.

@neilgee
Copy link
Contributor

neilgee commented Jan 21, 2017

@LoreleiAurora sweet thanks, back in the game!

@Android63
Copy link

Android63 commented Feb 3, 2017

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
Copy link

Autive commented Feb 8, 2017

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 the animalage database.

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

@cgrymala
Copy link

cgrymala commented Mar 2, 2017

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
Copy link
Owner

bradp commented Mar 17, 2017

Closing this, I'm going to start tracking 2.0 support in #348.

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

No branches or pull requests