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

BLT-5209: [info] Waiting for non-50x response from http://localhost:9222... #4672

Open
neelkhatri opened this issue Mar 29, 2023 · 4 comments
Labels
Bug Something isn't working

Comments

@neelkhatri
Copy link

neelkhatri commented Mar 29, 2023

Describe the bug
After upgrading to BLT 13.7.0 and Drush 11.5.x I am facing issue with my ci pieline. I am seeing "[debug] cURL error 7: Failed to connect to localhost port 9222: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
 [info] Waiting for non-50x response from http://localhost:9222/..." error during CI build after behat test triggered.

To Reproduce
Steps to reproduce the behavior, ideally starting from a fresh install of BLT:

  1. Run composer create-project acquia/drupal-recommended-project --no-interaction
  2. After installing Drupal 9.5.7, BLT 13.7.0 and drush 11.5.x
  3. run blt tests:behat --no-interaction --define drush.alias='${drush.aliases.ci}' --define tests.run-server=true -v
  4. See error

Expected behavior
It should run ci pieline without any error

Detailed error output

Run All Tests

$COMPOSER_BIN/blt tests:behat --no-interaction --define drush.alias='${drush.aliases.ci}' --define tests.run-server=false --define environment=ci -v
[info] Running command /builds/ito-ms/applications/website-factory/drupal/repo/vendor/bin/drush @self status bootstrap
BLT can (re)generate tests/behat/local.yml using tests/behat/example.local.yml.
[warning] Required file /app/docroot does not exist.
[warning] Behat is not configured properly.

tests:behat:init
Generating Behat configuration files...
[Filesystem\FilesystemStack] mkdir ["/builds/ito-ms/applications/website-factory/drupal/repo/reports"]
[info] Killing running google-chrome processes...
[info] Killing all processes on port '9222'...
[info] Launching headless chrome...
'google-chrome' --headless --disable-web-security --no-sandbox --disable-gpu --disable-extensions --start-maximized --remote-debugging-port=9222 --window-size='1366,768' http://localhost/ -vvv
Deprecation Warning: this command is passing a command string and should pass a command array.
[Robo\Common\ProcessExecutor] Running ''''google-chrome'''' '--headless' '--disable-web-security' '--no-sandbox' '--disable-gpu' '--disable-extensions' '--start-maximized' '--remote-debugging-port=9222' '--window-size='''1366,768'''' 'http://localhost' '-vvv' in /builds/ito-ms/applications/website-factory/drupal/repo
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Waiting for non-50x response from http://localhost:9222/...
[info] Killing running google-chrome processes...
[info] Killing all processes on port '9222'...
[error] Timed out.

with debug mode it is showing some curl 7 error "[debug] cURL error 7: Failed to connect to localhost port 9222: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"

image

System information

  • Operating system type: docker container for CI on gitlab
  • Operating system version: Ubuntu
  • BLT version: 13.7.0

Additional context
Add any other context about the problem here.

@neelkhatri neelkhatri added the Bug Something isn't working label Mar 29, 2023
@github-actions github-actions bot changed the title [info] Waiting for non-50x response from http://localhost:9222... BLT-5209: [info] Waiting for non-50x response from http://localhost:9222... Mar 29, 2023
@loopy3025
Copy link

I had this issue when running source ${BLT_DIR}/scripts/pipelines/tests on a big, nasty site that takes a lot of time to spin up in the Pipelines CI.

The issue might be occuring for me because I am trying to use the script in a non-standard way; we are calling it during setup-env. I really need the database to sync for the tests, though, and blt drupal:sync:default:site doesn't seem to want to work during the tests step.

At any rate, the following patch to blt stops the wait and will at least get you past that point so that you can troubleshoot...

diff --git a/vendor/acquia/blt/src/Robo/Common/Executor.php b/vendor/acquia/blt/src/Robo/Common/Executor.php
--- a/vendor/acquia/blt/src/Robo/Common/Executor.php
+++ b/vendor/acquia/blt/src/Robo/Common/Executor.php
@@ -181,7 +181,7 @@ public function killProcessByName($name) {
    *   The URL to wait for.
    */
   public function waitForUrlAvailable($url) {
-    $this->wait([$this, 'checkUrl'], [$url], "Waiting for non-50x response from $url...");
+    // $this->wait([$this, 'checkUrl'], [$url], "Waiting for non-50x response from $url...");
   }
 
   /**

It's possible, however, that you really do need that wait time, so if your scripts are failing partially at the beginning, instead of removing the wait, you can replace it with a custom sleep() time that works for your application...

diff --git a/vendor/acquia/blt/src/Robo/Common/Executor.php b/vendor/acquia/blt/src/Robo/Common/Executor.php
--- a/vendor/acquia/blt/src/Robo/Common/Executor.php
+++ b/vendor/acquia/blt/src/Robo/Common/Executor.php
@@ -181,7 +181,7 @@ public function killProcessByName($name) {
    *   The URL to wait for.
    */
   public function waitForUrlAvailable($url) {
-    $this->wait([$this, 'checkUrl'], [$url], "Waiting for non-50x response from $url...");
+    sleep(60);
   }
 
   /**

I did try adding set_time_limit(0); before the $this->wait(), but that didn't seem to have any effect. I've done extensive searching and can find no mention of how to generally increase the wait time for BLT. It would be nice if this was a setting I could add to blt.yml instead of having to add a wonky patch.

So I guess that's the real question. Is there, during Acquia Pipelines CI, a way to increase the amount of time or attempts that executor waits before crapping out?

@joewhitsitt
Copy link

We experienced something similar with Travis CI and had to change our ubuntu distro to focal from xenial as recent Chrome versions have had a mismatch for some dependencies.

@mikemadison13
Copy link
Contributor

I've run into this issue intermittently as well, and the above solution to comment out the wait method has fixed the issue for me when necessary. it doesn't "always" happen but when it does, that's how i've worked around it.

FYI this can also sometimes indicate a php fatal error somewhere (and commenting out the wait time can expose that in your CI logs).

@mikemadison13
Copy link
Contributor

can you confirm you have a ci.blt.yml file? see #4489 for getting that added by default (it was missing for a while).

see #4011 for my original issue from a couple of years ago on this broader topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants