-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
env: Unable to boot on Windows OS #50814
Comments
I expected the problem to be a failure to add users in the Docker container. So I made the following changes: diff --git a/packages/env/lib/init-config.js b/packages/env/lib/init-config.js
index 4a573c97aa..a86b40896e 100644
--- a/packages/env/lib/init-config.js
+++ b/packages/env/lib/init-config.js
@@ -133,8 +133,8 @@ ARG HOST_USERNAME
ARG HOST_UID
ARG HOST_GID
# When the IDs are already in use we can still safely move on.
-RUN groupadd -g $HOST_GID $HOST_USERNAME || true
-RUN useradd -m -u $HOST_UID -g $HOST_GID $HOST_USERNAME || true
+RUN groupadd -g $HOST_GID $HOST_USERNAME
+RUN useradd -m -u $HOST_UID -g $HOST_GID $HOST_USERNAME
# Install any dependencies we need in the container.
${ installDependencies( 'wordpress', env, config ) }`;
@@ -167,7 +167,7 @@ RUN adduser -h /home/$HOST_USERNAME -G $( getent group $HOST_GID | cut -d: -f1 )
# Install any dependencies we need in the container.
${ installDependencies( 'cli', env, config ) }
-
+
# Switch back to the original user now that we're done.
USER www-data When I run
Next, I thought the problem might be that diff --git a/packages/env/lib/init-config.js b/packages/env/lib/init-config.js
index 4a573c97aa..efbed4486a 100644
--- a/packages/env/lib/init-config.js
+++ b/packages/env/lib/init-config.js
@@ -133,8 +133,8 @@ ARG HOST_USERNAME
ARG HOST_UID
ARG HOST_GID
# When the IDs are already in use we can still safely move on.
-RUN groupadd -g $HOST_GID $HOST_USERNAME || true
-RUN useradd -m -u $HOST_UID -g $HOST_GID $HOST_USERNAME || true
+RUN groupadd -g 9999 $HOST_USERNAME || true
+RUN useradd -m -u 9999 -g 9999 $HOST_USERNAME || true
# Install any dependencies we need in the container.
${ installDependencies( 'wordpress', env, config ) }`;
@@ -162,12 +162,12 @@ ARG HOST_USERNAME
ARG HOST_UID
ARG HOST_GID
# When the IDs are already in use we can still safely move on.
-RUN addgroup -g $HOST_GID $HOST_USERNAME || true
-RUN adduser -h /home/$HOST_USERNAME -G $( getent group $HOST_GID | cut -d: -f1 ) -u $HOST_UID $HOST_USERNAME || true
+RUN addgroup -g 9999 $HOST_USERNAME || true
+RUN adduser -h /home/$HOST_USERNAME -G $( getent group 9999 | cut -d: -f1 ) -u 9999 $HOST_USERNAME || true
# Install any dependencies we need in the container.
${ installDependencies( 'cli', env, config ) }
-
+
# Switch back to the original user now that we're done.
USER www-data The error then changed to the following
|
I think UID and GID are for Unix file systems; SID is used for Windows. I expect this is why Is there any problem with hard-coding |
Thanks @t-hamano, The This worked fine in the original PR updating permissions, but, we're now switching to the user in order to install Composer. While it's true that you've encountered this problem because of the deliberate The caveat here is that
I don't know! I went with |
Assigning an arbitrary user might be the best course of action on Windows 😄 I realized this was a bad idea five seconds after I tried it because literally everything gets mad if you run it as root. Apache very aggressively refuses to start and I imagine even if that was worked around there is still a myriad of problems to navigate. |
Description
It appears that version
7.0.0
of theenv
package is no longer able to start on Windows OS.Here are all the logs after running the command:
Log
I deleted all Docker containers, images, volumes, and networks before running the command. With env version
6.0.0
, it can be started normally.The following are possible error locations in the logs:
{username}
shows the actual Windows OS login user. If the following commands are executed directly, the installation completed successfully:I think this issue might be related to #50408, where the command causing the error was added.
Step-by-step reproduction instructions
npm i
npm run wp-env start
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: