hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

Errors installing XHProf #117

Closed dixhuit closed 9 years ago

dixhuit commented 9 years ago

XHProf seems to be having some install troubles. I fixed a couple issues on the fly with https://github.com/hashbangcode/vlad/commit/e037edc8765920fd5300a5c19064d917c772192c but now it seems to be struggling with the SQL install script. Error below:

TASK: [xhprof | run SQL install script] ***************************************
failed: [xmaswizardrodeo] => {"changed": true, "cmd": "mysql --user=vlad --password=wibble xhprof < /var/www/xhprof_html/install.sql", "delta": "0:00:00.009957", "end": "2014-12-26 16:30:29.049754", "rc": 1, "start": "2014-12-26 16:30:29.039797", "warnings": []}
stderr: ERROR 1044 (42000): Access denied for user 'vlad'@'localhost' to database 'xhprof'

FATAL: all hosts have already failed -- aborting

This install was for a Ubuntu system, running PHP 5.4.

philipnorton42 commented 9 years ago

Yup, I noticed this the other day when I was working on the Centos version. Now fixed in dev, but it might be worth porting that patch to the current master branch?

dixhuit commented 9 years ago

Nice one. I wasn't sure whether it was multi OS support that broke the XHProf install or whether it just never worked (I've never installed it before). If it's the latter, then yes we should consider patching master if the next tag release is still a while off.

Check us out committing on Boxing Day!

dixhuit commented 9 years ago

Thanks for the timely fix BTW. Much appreciated :)

dixhuit commented 9 years ago

Latest dev seems to complete the install but the following test fails:

TASK: [test | test xhprof is present] *****************************************
failed: [mtrap] => {"changed": false, "cmd": ["curl", "-I", "xhprof.mtrap.local:80", "--resolve", "xhprof.mtrap.local:127.0.0.1"], "delta": "0:00:00.013551", "end": "2014-12-26 19:44:59.239087", "failed": true, "failed_when_result": true, "rc": 0, "start": "2014-12-26 19:44:59.225536", "stdout_lines": ["HTTP/1.1 404 Not Found", "Date: Fri, 26 Dec 2014 19:44:59 GMT", "Server: Apache/2.2.22 (Ubuntu)", "Vary: Accept-Encoding", "Content-Type: text/html; charset=iso-8859-1"], "warnings": ["Consider using get_url module rather than running curl"]}
stderr:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
stdout: HTTP/1.1 404 Not Found
Date: Fri, 26 Dec 2014 19:44:59 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

FATAL: all hosts have already failed -- aborting
dixhuit commented 9 years ago

Ouch, browsing to the site (not even the xhprof subdomain) throws the following error:

( ! ) Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

( ! ) Fatal error: Unknown: Failed opening required '/var/www/xhprof_html/external/header.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
philipnorton42 commented 9 years ago

I figured out what that was as well and added a patch to fix it. It's currently working in the dev branch.

dixhuit commented 9 years ago

Marvellous, I'll take a look as soon as I can.

dixhuit commented 9 years ago

I still seem to get the failed test as above even with latest dev.

philipnorton42 commented 9 years ago

Can you just confirm that the vhosts entry is there for the xhprof subdomain.

vagrant@vlad:/var/www/site/docroot$ sudo apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443                  drupal.local (/etc/apache2/sites-enabled/drupal.local_ssl.conf:2)
*:8080                 is a NameVirtualHost
         default server adminer.drupal.local (/etc/apache2/sites-enabled/adminer.drupal.local.conf:1)
         port 8080 namevhost adminer.drupal.local (/etc/apache2/sites-enabled/adminer.drupal.local.conf:1)
         port 8080 namevhost drupal.local (/etc/apache2/sites-enabled/drupal.local.conf:1)
         port 8080 namevhost logs.drupal.local (/etc/apache2/sites-enabled/logs.drupal.local.conf:1)
         port 8080 namevhost xhprof.drupal.local (/etc/apache2/sites-enabled/xhprof.drupal.local.conf:1)
Syntax OK

If it is then is this a symptom of the hosts problem you had before?

dixhuit commented 9 years ago

Output pasted below:

vagrant@mtrap:/var/www/site/docroot$ sudo apache2ctl -S
Warning: DocumentRoot [/var/www/xhprof_html/xhprof_html] does not exist
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443                  mtrap.local (/etc/apache2/sites-enabled/mtrap.local_ssl.conf:2)
*:80                   is a NameVirtualHost
         default server adminer.mtrap.local (/etc/apache2/sites-enabled/adminer.mtrap.local.conf:1)
         port 80 namevhost adminer.mtrap.local (/etc/apache2/sites-enabled/adminer.mtrap.local.conf:1)
         port 80 namevhost mtrap.local (/etc/apache2/sites-enabled/mtrap.local.conf:1)
         port 80 namevhost xhprof.mtrap.local (/etc/apache2/sites-enabled/xhprof.mtrap.local.conf:1)
Syntax OK

Which hosts problem are you referring to? Can you point to an issue number?

Happy New Year!

philipnorton42 commented 9 years ago

Issue #100, already closed, but it seems to be the cause of the problem above?

Happy New Year to you too :)

dixhuit commented 9 years ago

I don't think that issue is related. I thought it might be at first so I've been sure to remember to test ssh-add -L shortly after provisioning to double check that vagrant_up.yml did run. It's not been a problem on this box yet. I'm gonna do a test on a completely different host box next to see if I get the same results. Will check back here after.

dixhuit commented 9 years ago

OK, managed to get this working on a a different system with current dev. Looks like one of my systems has some issues of its own (good job I wrote that OS X provisioning playbook!).

Apologies for the noise.

kasperg commented 9 years ago

I do not know if this is a separate issue, but I am still seeing issues installing XHProf with 65a25af170f79d864451a448a1bfa4e87e16352d:

TASK: [xhprof | copy SQL install script] **************************************
failed: [vlad] => {"checksum": "751a97c968fb300535f016db38407c49adada0e7", "failed": true}
msg: Destination directory /var/www/xhprof_html does not exist

I am new to vagrant but if you need any more info or want me to open a new issue let me know.

dixhuit commented 9 years ago

@kasperg Pretty sure I fixed that in the dev branch.

If you switch to dev now, be aware that you'll need to change any variables set to "y" or "n" in your settings file to true or false respectively.

kasperg commented 9 years ago

@danbohea: Yeah - that works. Thanks a bunch!

dixhuit commented 9 years ago

No worries.