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

Permission errors when a WordPress version is specified in the core field of .wp-env.json file #44338

Open
MrJnrman opened this issue Sep 21, 2022 · 2 comments
Labels
Needs Technical Feedback Needs testing from a developer perspective. [Package] Env /packages/env [Type] Bug An existing feature does not function as intended

Comments

@MrJnrman
Copy link

Description

When the WordPress version is specified in the core field of the .wp-env.json file, we may encounter permission issues when trying to manipulate the WordPress installation using the cli container.

Step-by-step reproduction instructions

Scenario 1: Permalinks

  1. Set the core field of your .wp-env.json to WordPress/WordPress#tags/5.8.5
  2. Start your container using wp-env start
  3. Try to update the permalink settings by running wp-env run cli "wp rewrite structure '/%postname%/'"
  4. Navigate to http://localhost:8888/hello-world and confirm that you see an apache error message.
    Similar issue: wp-env: file permissions issues with rewrites and uploads #28201

Scenario 2: Install & Activate a plugin(I can only reproduce this is in a linux environment)

  1. Set the core field of your .wp-env.json to WordPress/WordPress#tags/5.8.5
  2. Use the mappings filed to map a local zip file to a location in your container.
  3. Start your container using wp-env start
  4. Install and activate the plugin by running wp-env run cli "wp plugin install path/to/mapped/zip/file --activate". Below is an example of my CI output after running wp-env run cli "wp plugin install wp-content/uploads/ci-runner/woocommerce/woocommerce.zip --activate"
Creating d4ba85059787d72a716f6b416f9f71b6_cli_run ... 
Creating d4ba85059787d72a716f6b416f9f71b6_cli_run ... done
Unpacking the package...
Warning: Could not create directory.
Warning: The 'wp-content/uploads/ci-runner/woocommerce/woocommerce.zip' plugin could not be found.
Error: No plugins installed.
1
✖ Command failed with exit code 1
Command failed with exit code 1

It seems to begin to unpack the plugin, then encounters permission issues and throws Warning: Could not create directory..

Screenshots, screen recording, code snippet

No response

Environment info

GitHub CI with Ubuntu 20.04.5

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

Yes

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

No

@kopepasah
Copy link
Member

@MrJnrman while I am not certain what is happening in Scenario 1, I can say that Scenario 2 sounds like a Docker user permissions issue. When running into these problems, you will need to run docker-compose directly, as referenced in the documentation: https://github.com/WordPress/gutenberg/tree/trunk/packages/env#installing-a-plugin-or-theme-on-the-development-instance

@annezazu annezazu added the Needs Technical Feedback Needs testing from a developer perspective. label Oct 12, 2022
@jordesign jordesign added [Type] Bug An existing feature does not function as intended [Package] Env /packages/env labels Aug 3, 2023
@jordesign
Copy link
Contributor

@MrJnrman Just looping back to this issue - is the behaviour still the same in your testing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Technical Feedback Needs testing from a developer perspective. [Package] Env /packages/env [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants