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

terra queue: Getting error after running environment:enable #86

Open
jlyon opened this issue Aug 14, 2015 · 4 comments
Open

terra queue: Getting error after running environment:enable #86

jlyon opened this issue Aug 14, 2015 · 4 comments
Assignees

Comments

@jlyon
Copy link
Contributor

jlyon commented Aug 14, 2015

terra queue works well, but after I add environment in Drupal and run terra queue, it suddenly crashes:

  [PhpAmqpLib\Exception\AMQPRuntimeException]                  
  Error Connecting to server(0): Failed to parse address ":"   

It seems like execute() is getting called again, but $url = $input->getArgument('url'); is empty so everything crashes. I tried to debug it further, but didn't get anywhere.

@jlyon
Copy link
Contributor Author

jlyon commented Aug 14, 2015

It might actually be something else, like settings.php isn't getting properly set or something. Here's the complete log file:

jeff@jeff-laptop ~ $ terra queue tcp://guest:guest@localhost:5672/terra
Checking tcp://guest:guest@localhost:5672/terra ...
Array
(
    [scheme] => tcp
    [host] => localhost
    [port] => 5672
    [user] => guest
    [pass] => guest
    [path] => /terra
    [queue] => terra
)
 [*] Waiting for messages. To exit press CTRL+C
 [x] Received [{"key":"environment:add","nid":"211","uid":"1","cmd":{"cmd":"terra","args":["environment:add","drupal","test"],"flags":{"--enable":"","--no-interaction":true,"--no-ansi":true}},"callback":"http:\/\/localhost:32806\/api\/terra\/callback"},{"key":"drush","nid":"211","uid":"1","cmd":"wait 10","callback":"http:\/\/localhost:32806\/api\/terra\/callback"},{"key":"drush","nid":"211","uid":"1","cmd":"drush @drupal.test vset site_name '[node:field_description]'","callback":"http:\/\/localhost:32806\/api\/terra\/callback"}]
 [x] Executing terra environment:add drupal test --enable= --no-interaction --no-ansiCloning into '/home/jeff/Apps/drupal/test'...
Array
(
    [args] => {"key":"environment:add","nid":"211","uid":"1","cmd":{"cmd":"terra","args":["environment:add","drupal","test"],"flags":{"--enable":"","--no-interaction":true,"--no-ansi":true}},"callback":"http:\/\/localhost:32806\/api\/terra\/callback"}
    [cmd] => {"cmd":"terra","args":["environment:add","drupal","test"],"flags":{"--enable":"","--no-interaction":true,"--no-ansi":true}}
    [output] => * master
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean
Beginning to build drupal.make.                                      [ok]
drupal-7.35 downloaded.                                              [ok]
Environment saved to registry.
DOCKER > Creating drupaltest_database_1...
DOCKER > Creating drupaltest_app_1...
DOCKER > Creating drupaltest_load_1...
DOCKER > Creating drupaltest_drush_1...
Environment enabled!  Available at http://drupal.test.localhost and http://localhost:32812
Drush alias file created at /home/jeff/.drush/drupal.aliases.drushrc.php
Wrote drush alias file to /home/jeff/.drush/drupal.aliases.drushrc.php
Use drush @drupal.test to access the site.

Running ENABLE app hook...
Sleeping for 5 seconds to let db server start...
 drush @drupal.test site-install -y
drush @drupal.test uli

You are about to CREATE the 'drupal' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the        [ok]
--notify global option.
exception 'Exception' with message '<ul><li>To start over, you must      [error]
empty your existing database.</li><li>To install to a different
database, edit the appropriate <em>settings.php</em> file in the
<em>sites</em> folder.</li><li>To upgrade an existing installation,
proceed to the <a href="http://localhost:32812/update.php">update
script</a>.</li><li>View your <a
href="http://localhost:32812">existing site</a>.</li></ul>' in
/source/www/includes/install.core.inc:301
Stack trace:
#0 /source/www/includes/install.core.inc(74):
install_begin_request(Array)
#1 /usr/local/src/drush7/includes/drush.inc(708):
install_drupal(Array)
#2 /usr/local/src/drush7/includes/drush.inc(694):
drush_call_user_func_array('install_drupal', Array)
#3 /usr/local/src/drush7/commands/core/drupal/site_install_7.inc(80):
drush_op('install_drupal', Array)
#4 /usr/local/src/drush7/commands/core/site_install.drush.inc(289):
drush_core_site_install_version(NULL, Array)
#5 [internal function]: drush_core_site_install()
#6 /usr/local/src/drush7/includes/command.inc(368):
call_user_func_array('drush_core_site...', Array)
#7 /usr/local/src/drush7/includes/command.inc(219):
_drush_invoke_hooks(Array, Array)
#8 [internal function]: drush_command()
#9 /usr/local/src/drush7/includes/command.inc(187):
call_user_func_array('drush_command', Array)
#10 /usr/local/src/drush7/lib/Drush/Boot/BaseBoot.php(62):
drush_dispatch(Array)
#11 /usr/local/src/drush7/drush.php(70):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 /usr/local/src/drush7/drush.php(11): drush_main()
#13 {main}
Unable to execute user login.                                        [error]
    [status] => 0
    [result] => Unable to execute user login.                                        [error]
)



  [PhpAmqpLib\Exception\AMQPRuntimeException]                  
  Error Connecting to server(0): Failed to parse address ":"   



queue [<url>]

@jonpugh
Copy link
Member

jonpugh commented Aug 14, 2015

It breaks like this for me when i have drush commands in the app node. If I add the app https://github.com/terra-ops/example-drush-make without drush commands, I can create environments just fine, and I get the link saved to the environment node.

I think I've tracked it down to https://github.com/terra-ops/terra-cli/blob/master/src/terra/Command/Queue.php#L70

@jlyon
Copy link
Contributor Author

jlyon commented Aug 14, 2015

Thanks for digging into this. I'll try to take a look today. It seems like the

 global $server;

line must not be working.

For the time being, I've been running

php receiver.php

and it still works well.

We should also probably add some try catch statements in this file.

@jonpugh
Copy link
Member

jonpugh commented Aug 15, 2015

Yeah... I copied receiver.php into the terra queue command pretty much verbatim!

If you hack on it, could you do it in a fork of terra-ops/terra-cli? Would love your help on some pull requests directly in the project.

Thanks!
Jon

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