WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 4 weeks ago

#53820 closed defect (bug) (fixed)

Build doesn't support Docker Compose V2

Reported by: pbearne Owned by: desrosj
Milestone: 5.8.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch fixed-major
Focuses: Cc:

Description (last modified by SergeyBiryukov)

I can't get the build to work
downloaded fresh master from https://github.com/WordPress/wordpress-develop

npm install
npm run build:dev
npm run env:start

then get this error

PS C:\Users\XX\Documents\xwp\wordpress-develop> npm run env:install

> WordPress@5.9.0 env:install C:\Users\XX\Documents\xwp\wordpress-develop
> node ./tools/local-env/scripts/install.js

time="2021-07-28T16:33:01-04:00" level=warning msg="The PHP_FPM_UID variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The PHP_FPM_GID variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The PHP_FPM_UID variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The PHP_FPM_GID variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The WP_MULTISITE variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The PHP_FPM_UID variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The PHP_FPM_GID variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The GITHUB_REF variable is not set. Defaulting to a blank string."
time="2021-07-28T16:33:01-04:00" level=warning msg="The GITHUB_EVENT_NAME variable is not set. Defaulting to a blank string."
services.cli.environment.LOCAL_PHP_MEMCACHED must be a string, number or null
node:child_process:675
    throw err;
    ^

Error: Command failed: docker-compose run --rm cli config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force
    at checkExecSyncError (node:child_process:636:11)
    at execSync (node:child_process:672:15)
    at wp_cli (C:\Users\XX\Documents\xwp\wordpress-develop\tools\local-env\scripts\install.js:48:2)
    at Object.<anonymous> (C:\Users\XX\Documents\xwp\wordpress-develop\tools\local-env\scripts\install.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1083:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
    at Module.load (node:internal/modules/cjs/loader:948:32)
    at Function.Module._load (node:internal/modules/cjs/loader:789:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)
    at node:internal/main/run_main_module:17:47 {
  status: 15,
  signal: null,
  output: [ null, null, null ],
  pid: 30196,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! WordPress@5.9.0 env:install: `node ./tools/local-env/scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the WordPress@5.9.0 env:install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

I am not sure why this is broken
Docker v20.10.7

Change History (19)

#1 @pbearne
2 months ago

  • Component changed from General to Build/Test Tools

#2 @SergeyBiryukov
2 months ago

  • Description modified (diff)

#3 @desrosj
2 months ago

  • Keywords reporter-feedback added

Hi @pbearne,

I had experienced this a week or so ago. When I looked at my Docker setup, I had "Use Docker Compose V2 checked off under Experimental Features. I unchecked this, and then everything worked after restarting Docker.

Could you give that a try? It's not clear to me what is causing this, but I had this enabled for a while without issue, so I'm thinking something changed upstream we'll need to investigate.

#4 @johnbillion
2 months ago

cc @francina who also had this problem last week

#5 @pbearne
2 months ago

  • Summary changed from services.phpunit.environment.LOCAL_PHP_MEMCACHED must be a string, number or null to Build doesn't support Docker Compose V2

#6 @pbearne
2 months ago

Let's get this fixed I assume that we will need to support Docker Compose V2

I will create a patch to add a comment to the readme for now until we have an updated build script(s)

This ticket was mentioned in PR #1527 on WordPress/wordpress-develop by pbearne.


2 months ago

  • Keywords has-patch added

Just a note in the readme.md to turn off composer v2
until we have a support for it in the build

Trac ticket:https://core.trac.wordpress.org/ticket/53820

#9 @pbearne
2 months ago

  • Keywords reporter-feedback removed

@ocean90 I agree we need to wait for it to be stable before we add support if needed

#10 @johnbillion
2 months ago

  • Milestone changed from Awaiting Review to 5.9

This ticket was mentioned in PR #1542 on WordPress/wordpress-develop by pbearne.


8 weeks ago

It seems that if we change the environment section to use the list format we don't get the fatal error
We still get warnings

Trac ticket: https://core.trac.wordpress.org/ticket/53820

#13 @pbearne
8 weeks ago

  • Milestone changed from 5.9 to 5.8.1

It seems that if we change the environment section to use the list format we don't get the fatal error
We still get warnings

I have added a patch with this change

The change works with v1 as well

Let's get this into 5.8.1

Last edited 8 weeks ago by pbearne (previous) (diff)

This ticket was mentioned in Slack in #core-test by francina. View the logs.


7 weeks ago

#15 @prbot
6 weeks ago

desrosj commented on PR #1542:

Thanks for this @pbearne! Before merging, I was curious if there was any documentation indicating list format was preferred?

#16 @prbot
5 weeks ago

desrosj commented on PR #1542:

Looked at the compose command docs, and it looks like they use list formatting there. It's also the recommended workaround here.

Good enough for me. Going to commit.

#17 @desrosj
5 weeks ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 51673:

Build/Test Tools: Use list format when defining environment variables in Docker compose file.

This is the correct formatting detailed in the Docker compose documentation examples and helps to avoid ambiguities in the yaml parser when values that may cause warnings.

Props pbrearne, ocean90, johnbillion, desrosj.
Fixes #53820.

#18 @desrosj
5 weeks ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to backport.

#19 @desrosj
4 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51680:

Build/Test Tools: Use list format when defining environment variables in Docker compose file.

This is the correct formatting detailed in the Docker compose documentation examples and helps to avoid ambiguities in the yaml parser when values that may cause warnings.

Props pbrearne, ocean90, johnbillion, desrosj.
Merges [51673] to the 5.8 branch.
Fixes #53820.

Note: See TracTickets for help on using tickets.