Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp config failed to read :7979 #36

Closed
AbdealiLoKo opened this issue Mar 1, 2016 · 6 comments
Closed

amp config failed to read :7979 #36

AbdealiLoKo opened this issue Mar 1, 2016 · 6 comments

Comments

@AbdealiLoKo
Copy link
Contributor

I installed amp with buildkit and then I ran amp config and got the following services.yml :

parameters:
    version: 2
    mysql_dsn: 'mysql://root:<passwd>@localhost:3306'
    perm_type: worldWritable
    httpd_type: apache24
    db_type: mysql_dsn
services: {  }

This is a local mariadb installation and I am fairly certain the DSN is correct.
Now, when i run amp test I get:

ajk@ajk-ThinkPad-R60:~/buildkit$ amp test
Create test application
Create data directory: /home/ajk/.amp/canary/data/Av5ikz5lpujbK0fgNpOgMv5J1HOGj0aJ
AMP_URL='http://localhost:7979'
AMP_ROOT='/home/ajk/.amp/canary'
AMP_DB_DSN='mysql://canary_81ukt:gW9CB6OqPf8hUsix@127.0.0.1:3306/canary_81ukt?new_link=true'
AMP_DB_USER='canary_81ukt'
AMP_DB_PASS='gW9CB6OqPf8hUsix'
AMP_DB_HOST='127.0.0.1'
AMP_DB_PORT='3306'
AMP_DB_NAME='canary_81ukt'
AMP_DB_ARGS='-h 127.0.0.1 -u canary_81ukt -pgW9CB6OqPf8hUsix -P 3306 canary_81ukt'

Connect to test application
Expect response: "response-code-QY8FMePLvE"
PHP Warning:  file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error
 in phar:///home/ajk/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 153
PHP Stack trace:
PHP   1. {main}() /home/ajk/buildkit/bin/amp:0
PHP   2. require() /home/ajk/buildkit/bin/amp:10
PHP   3. Amp\Application::main() phar:///home/ajk/buildkit/bin/amp/bin/amp:18
PHP   4. Symfony\Component\Console\Application->run() phar:///home/ajk/buildkit/bin/amp/src/Amp/Application.php:49
PHP   5. Symfony\Component\Console\Application->doRun() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Application.php:124
PHP   6. Symfony\Component\Console\Application->doRunCommand() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Application.php:193
PHP   7. Symfony\Component\Console\Command\Command->run() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Application.php:889
PHP   8. Amp\Command\TestCommand->execute() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
PHP   9. Amp\Command\TestCommand->doPost() phar:///home/ajk/buildkit/bin/amp/src/Amp/Command/TestCommand.php:78
PHP  10. file_get_contents() phar:///home/ajk/buildkit/bin/amp/src/Amp/Command/TestCommand.php:153

Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error
 in phar:///home/ajk/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 153

Call Stack:
    0.0003     125200   1. {main}() /home/ajk/buildkit/bin/amp:0
    0.0227     240376   2. require('phar:///home/ajk/buildkit/bin/amp/bin/amp') /home/ajk/buildkit/bin/amp:10
    0.0336     488304   3. Amp\Application::main() phar:///home/ajk/buildkit/bin/amp/bin/amp:18
    0.2386    2502380   4. Symfony\Component\Console\Application->run() phar:///home/ajk/buildkit/bin/amp/src/Amp/Application.php:49
    0.2395    2505484   5. Symfony\Component\Console\Application->doRun() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Application.php:124
    0.2398    2505656   6. Symfony\Component\Console\Application->doRunCommand() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Application.php:193
    0.2399    2505200   7. Symfony\Component\Console\Command\Command->run() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Application.php:889
    0.2407    2506616   8. Amp\Command\TestCommand->execute() phar:///home/ajk/buildkit/bin/amp/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
    0.3187    2812180   9. Amp\Command\TestCommand->doPost() phar:///home/ajk/buildkit/bin/amp/src/Amp/Command/TestCommand.php:78
    0.3187    2813684  10. file_get_contents() phar:///home/ajk/buildkit/bin/amp/src/Amp/Command/TestCommand.php:153

Received incorrect response: ""
Tip: Try running "amp config" and/or restarting the webserver.
ajk@ajk-ThinkPad-R60:~/buildkit$ 

I am not sure what the issue is. The error message isn't very helpful.
I installed all the prerequisites using sudo apt-get install php5-cli php5-imap php5-ldap php5-curl php5-mysql php5-intl php5-gd php5-mcrypt php-apc apache2 libapache2-mod-php5 (as was written in the installer script for buildkit)

@AbdealiLoKo
Copy link
Contributor Author

Note that I can see canary_81ukt has been created in my phpmyadmin

@AbdealiLoKo
Copy link
Contributor Author

@totten This is regarding your comment - #35 (comment)

Would the table canary_81ukt be created if mysql was using local sockets ?

@totten
Copy link
Collaborator

totten commented Mar 1, 2016

A few things:

  1. The general operation of the canary is to setup a demo app (db+http vhost) -- then send an HTTP request. The error indicates that the HTTP request failed (PHP Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error).
  2. Did you try the last suggestion ("Tip: Try running "amp config" and/or restarting the webserver.")? amp test almost always fails on the first try because it doesn't know how to restart apache. But if you alternate the command (amp test => apache2ctl restart => amp test), it should get around this.
  3. If it still doesn't work, inspect the Apache+PHP logs. Worst case, to figure out what's wrong, you can alternately send requests directly to http://localhost:7979/index.php and hack the files in ~/.amp/apache.d and ~/.amp/canary.
  4. Aside: I find worldWritable (aka chmod 1777) to be problematic with many web apps. It'll work for a while, but eventually there are conflicts where the web-user and shell-user fail to manipulate each other's files. I really recommend linuxAcl or osxAcl. (Related: http://civicrm.stackexchange.com/questions/2923/civicrm-does-not-have-permission-to-write-temp-files/2937#2937 )

@totten
Copy link
Collaborator

totten commented Mar 1, 2016

Aside: When I run amp test locally, I'm hitting another error due to the recent change to use amp.phar. Will post when that's patched.

@totten
Copy link
Collaborator

totten commented Mar 1, 2016

OK, the autoloading bug that affects amp test when using PHAR should be fixed (#39). That wasn't your problem, but it touches related code.

@AbdealiLoKo
Copy link
Contributor Author

Apparently that is what caused my problem (The logs said so)
Closing this now :)

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

No branches or pull requests

2 participants