VVV-Dashboard icon indicating copy to clipboard operation
VVV-Dashboard copied to clipboard

Dashboard does not load domains that were provisioned via VVV

Open davidwolfpaw opened this issue 7 years ago • 44 comments

I'm using the new provisioning system in VVV to create sites. When the sites are complete I go to the VVV dashboard and purge the hosts cache and refresh the page. New sites show as N/A (pictured in screenshot).

All of the links also display as "N/A" for the domain portion of the URL. For instance, the link to wp-admin is http://n/A/wp-admin.

screenshot 2017-03-17 06 52 41

davidwolfpaw avatar Mar 17 '17 11:03 davidwolfpaw

I always used VV but I will try to look into this weekend.

topdown avatar Mar 17 '17 18:03 topdown

+1, confirmed. Just upgraded to VVV 2.0 and have the same issue. VV isn't ready for VV 2.0 yet, there are couple open issues.

ihorvorotnov avatar Mar 21 '17 16:03 ihorvorotnov

screen shot 2017-03-22 at 8 40 50 am +1, also tested the new provisioning in VVV2 - the site is provisioned but if using VVV-Dashboard it is declared as **N/A** in sites list

neilgee avatar Mar 22 '17 08:03 neilgee

This is still an issue when using the new provisioning system in VVV2. New sites show as N/A with bad paths - http://n/A/wp-admin or http://n/A/. Using vv -create works after manually adding a new site to vvv-custom.yml but is not in line with current provisioning.

erikJonsberg avatar Apr 04 '17 14:04 erikJonsberg

+1

There are 2 things ongoing actually. The first is that VV doesn't provision in the expected format for VVV2.0 yet. And the second is that VVV-Dashboard builds its hosts_list relying on {host_path}/vvv-hosts,

I have done a 'standard' install in VVV2.0 using the provided example setup. With the 2.0 provisioning options and the way sites are being handled everything looks quite different. Main player would be the vvv-config.yml OR vvv-custom.yml (if exists) in the root of the VVV install. This is where all 2.0 sites are listed.

Setup of the example structure site is surprisingly easy and requires just 3 lines in the new yml file using the example repo (config is provided in vvv-config.yml). A site in itself gets a new directory structure, without vvv-hosts and using public_html instead of htdocs. Provisioning information and logs reside in subdirs.

<example-site>
- log
- provision
- public_html
wp-cli.yml

The vvv-config.yml / vvv-custom.yml files allow for full customization paths (vm_dir / local_dir) but these latter can be omitted and then the new 'default' paths will be used.

With the breaking changes on the VVV2.0 release, migration documentation has been provided - but like many - I am not inclined to spend time on moving sites. So I will continue with a mix of sites in old structures - as setup by VV) and use the new VVV2.0 format setting up future developments.

I hope the above provides a little bit more insight on what has happened under the hood. I believe for the dashboard to work with VVV2.0 it has to use yml files for knowledge of the site configuration. Sites setup for VVV1.x could be added to this file.

syllie avatar Apr 26 '17 21:04 syllie

+1 bump

scarstens avatar Jul 17 '17 23:07 scarstens

Okay. I have had the same issue and after looking into the source files, I was able to fix this with some minor modifications. Now creating a pull request.

swashata avatar Aug 07 '17 11:08 swashata

I merged in the changes that @swashata made in the PR. Could you all do a pull on the dashboard and verify its working properly for you now. NOTE: you need to copy the newly changed dashboard-custom.php to the default root overwriting the old one or make the changes from the PR which is just an addition to the paths.

topdown avatar Aug 08 '17 01:08 topdown

Working for me. VVV-Dashboard shows new sites created with vvv-custom.yml after manually adding the site to dashboard/vvv_dash/hosts/defaults.php

ryanemitchell avatar Aug 08 '17 15:08 ryanemitchell

I tried this but it's still not adding new sites provisioned in VVV2 - I am using - Version: 0.2.0, Branch: 61e7ac6 master

neilgee avatar Aug 09 '17 09:08 neilgee

@neilgee Try manually adding sites created with VVV2 to dashboard/vvv_dash/hosts/defaults.php. That worked for me.

ryanemitchell avatar Aug 09 '17 12:08 ryanemitchell

@ryanemitchell thanks - i see in the host_list function - I was hoping the PR was going to automatically add the sites.

neilgee avatar Aug 09 '17 23:08 neilgee

It should. You should not have to edit code. I'll have to setup a fresh copy and go through the code and fix what ever is missing.

topdown avatar Aug 10 '17 00:08 topdown

Ok, I can not get the adding a new site mentioning in the first original post to work at all. So if someone wants to shed light on that because following the instructions here https://develop.varyingvagrantvagrants.org/docs/en-US/adding-a-new-site/ is not working and each provision talks 10 minutes which in my opinion is crap. After 2.5 hours of changing little things and provisioning trying to get a site loaded I am not wasting more time. So someone using this process needs to explain.

One reason the domains are not loading in VVV Dashboard is they no longer use the vvv-hosts files, which is funny because its still included with the default WP installs. So create that file, probably in the sites directory and add the domain to the first line. THen purge the dashboard cache and the domain should load. Not sure about the rest since I can't get the instructions to work.

topdown avatar Aug 10 '17 23:08 topdown

This is not obvious in those docs but actually you can provision in just about 20secs with a single site command - so add the site first in vvv-custom.yml like so...

  example:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template
    hosts:
      - example.dev

Then to provision run vagrant provision --provision-with=site-example

https://tomjn.com/2017/01/16/whats-new-vvv-2-0/

neilgee avatar Aug 10 '17 23:08 neilgee

I don't know how topdown works right now, but is it not possible for topdown to parse the vvv-custom.yml file to assess which sites are setup? Vagrant provisions have always been slow, but if you use @neilgee recommendation, it will limit the provision to just the 1 install you need to deal with.

scarstens avatar Aug 10 '17 23:08 scarstens

@neilgee that command doesn't do anything for me other than add the domain to the hosts. I am using the default init, so it should be running that and downloading wp (not) When provisioning is done (only adding the domain to hosts) it just redirects to the dashboard even if I have files in the public_html. Something is missing.

topdown avatar Aug 11 '17 00:08 topdown

Actually, I can not get anything to provision other than the default sites.

topdown avatar Aug 11 '17 01:08 topdown

@topdown Can you paste your yml file in here? I'm pretty sure indentation and exact syntax matters.

scarstens avatar Aug 11 '17 01:08 scarstens

I was having that behaviour at some stage - can't quite remember how it rectified, make sure you do a git pull on VVV2 to have the latest.

neilgee avatar Aug 11 '17 01:08 neilgee

Okay since this is working for me (auto listing sites added with new vvv method) I am going to break it down on how this is working. I am assuming the site in question is xyz.dev so naturally it should reside inside www/xyz directory.

  1. No, it doesn't look into the vvv-custom.yaml or vvv-config.yaml file at all. I know it should, but it doesn't.
  2. It looks for directories inside www. Here in our case it finds www/xyz.
  3. For each directory it finds, it looks for a vvv-hosts and if not found provision/vvv-hosts file. This is used to get the domain name (xyz.dev). With the new method, we are supposed to place inside provision/vvv-hosts.
  4. For each directory it finds, it looks for a wp-cli.yml file from where it gets the public folder. It was htdocs before, but now it is public_html.

And that's it really. So make sure that

  1. You have vvv-hosts or provision/vvv-hosts file inside the sites directory.
  2. You have wp-cli.yml file saying path: public_html or what-ever path where WordPress is actually installed.
  3. Under www/default dashboard you have copied over the new file cp dashboard/dashboard-custom.php .
  4. You have cleared host cache under http://vvv.dev

swashata avatar Aug 11 '17 08:08 swashata

I don't have any vvv-hosts file in the www/xyz/provision/ folder, just these three:

  • vvv-init.sh
  • vvv-nginx.conf
  • vvv-nginx.conf.tmpl

but there are vvv-hosts files int the wodpress-default and develop folders.

I did a fresh vvv installation after VVV2 was relased, and I created all website with the new yml method

ironicmoka avatar Aug 12 '17 19:08 ironicmoka

Same here, confirm that no vvv-hosts file in newly provisioned sites in VVV2 .

neilgee avatar Aug 13 '17 05:08 neilgee

@ironicmoka @neilgee

I see that. So with the new provisioning I need to read settings from the vvv-custom.yml file. I will see if I can make something like that. But for now, could you please put a vvv-hosts file inside provision directory with the following content

yoursite.dev

This won't break anything and VVV dashboard will start working again.

swashata avatar Aug 14 '17 03:08 swashata

Any updates for that? In the meantime I changed on hosts.php line 85 "N/A" with basename($this->host_path) . '.dev' in that way also on N/A the domain is right because often the folder name is the same of the domain

Mte90 avatar Aug 16 '17 22:08 Mte90

I added a new branch vvv2 with @Mte90 suggestion above if you guys want to checkout that branch and try it.

topdown avatar Aug 17 '17 01:08 topdown

I still can not get VVV2 to do anything with vvv-custom.yml So testing the custom site setup via https://github.com/Varying-Vagrant-Vagrants/custom-site-template is useless and does literally nothing. I don't know how you guys are getting it to work but at this point, the custom site thing and vvv2 are no good to me and has already cost me 4 days of screwing around trying to get this to work.

The reality is for me to work on the dashboard VVV2 and the custom site process has to be working and it's just not on my end. No idea why.

topdown avatar Aug 17 '17 16:08 topdown

Hoping that can help this is my vvv-custom.yml https://gist.github.com/Mte90/a94e6fb73f68f0958809308dea94c2d3 Also I saw (already reported) that if the folder of the new website added not exist on VVV/www doesn't exist doesn't download anything. The commando vagrant --provision-with site-name do the provision only of the new website.

Mte90 avatar Aug 17 '17 16:08 Mte90

@Mte90 I striped yours down to just the demo site https://gist.github.com/topdown/4fbb740ffc7c6e875c23caaf9f2aa15c Then created the folder demo Ran vagrant provision --provision-with=demo It created the host entry and ended, screenshot attached. No downloading or anything, its like the process just ends. This is the same result I have been having the entire time. I event reinstalled triggers and hostupdater thinking maybe that would fix it. screen shot 2017-08-17 at 11 40 50 am

topdown avatar Aug 17 '17 16:08 topdown

Seems that this flag is not working :-/

Mte90 avatar Aug 21 '17 21:08 Mte90