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

wp-env Error while running docker compose command #62242

Open
louiswol94 opened this issue Jun 3, 2024 · 5 comments
Open

wp-env Error while running docker compose command #62242

louiswol94 opened this issue Jun 3, 2024 · 5 comments
Labels
[Package] Env /packages/env [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Bug An existing feature does not function as intended

Comments

@louiswol94
Copy link

Description

Hi there,

We are experiencing the following issue with wp-env:

Error while running docker compose command.
Container 389b8d981d610881ee022d53ce63130e-tests-mysql-1 Running
Container 389b8d981d610881ee022d53ce63130e-tests-wordpress-1 Running
Error: Error establishing a database connection. This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at tests-mysql could not be established. This could mean your host’s database server is down.

It is happening in more than one of our repositories at the moment.

I see a MariaDB version was released a few days ago. Maybe it is related: https://mariadb.org/mariadb/all-releases/

Step-by-step reproduction instructions

  1. run wp-env start

Screenshots, screen recording, code snippet

No response

Environment info

  • Latest WP version
  • Latest wp-env version and v9.4.0 also tested.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@louiswol94 louiswol94 added the [Type] Bug An existing feature does not function as intended label Jun 3, 2024
@Mamaduka Mamaduka added the [Package] Env /packages/env label Jun 4, 2024
@paolopiaggio
Copy link
Contributor

+1

@louiswol94
Copy link
Author

If anyone needs a temporary workaround, I updated the mariadb:lts to mariadb:11.2.4-jammy in my node_modules/@wordpress/env/lib/build-docker-compose-config.js

If you are running this on a CI script you can run sed -i -e "s/image: 'mariadb:lts'/image: 'mariadb:11.2.4-jammy'/g" node_modules/@wordpress/env/lib/build-docker-compose-config.js right after npm ci for example.

It works for now, until there is a fix from wp-env or MariaDB's side.

@talldan talldan added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Jul 25, 2024
@talldan
Copy link
Contributor

talldan commented Jul 25, 2024

This is something I've seen too, but it's very intermittent for me. I've only seen it once in my local environment, but it's the cause of a lot of test failures in this repo's CI. There's an example here - https://github.com/WordPress/gutenberg/actions/runs/10087381455/job/27891446096?pr=63918.

It'd be good if there was more error logging to know what the actual mariadb error is, that way it could be reported upstream.

If anyone needs a temporary workaround, I updated the mariadb:lts to mariadb:11.2.4-jammy in my node_modules/@wordpress/env/lib/build-docker-compose-config.js

That seems like a downgrade rather than an update, as LTS is 11.4.

@peterfabian
Copy link

Seems also related to #59244 where the switch to the lts version happened. It's quite annoying, so +1 on adding more logging, and potentially some retries/waiting for MySQL service to help with CI stability. We've been encountering this almost every other day.

@talldan
Copy link
Contributor

talldan commented Jul 29, 2024

Good spot, it does seem like a similar issue, though now only intermittent.

It does look like mariadb recently made 11.4 LTS (https://mariadb.org/11-4-lts/), and that seems to correlate with when the flakiness started. 🤔

In terms of better logging, I wonder if we can add the log files to the github action job artifacts when failing at the 'Install WordPress' stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Env /packages/env [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Bug An existing feature does not function as intended
5 participants