-
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
wp-env: Unable to upload plugins on Linux & Windows, error on media upload. #45592
Comments
On some further investigation:
I also tried a "vanilla" approach without a .wp-env.json:
Still same error on uploading plugins ^- all done on linux, so no info on windows for this, sorry |
Hi, |
I have the same issue, unable to upload plugins on Linux. I think this is related to the following note in the documentation: https://github.com/WordPress/gutenberg/tree/trunk/packages/env#installing-a-plugin-or-theme-on-the-development-instance
The last command seems to be missing docker-compose run --rm -u $(id -u) -e HOME=/tmp cli wp plugin install example-plugin Edit: Hm, I see this permissions question is a deep rabbit hole. According to #42867:
Also see: Handle folder permissions in wp-env #22515. |
As this issue appears confirmed, I have removed the "Needs Testing" label. @t-hamano if you have any time to take a peek at this one, it would be most appreciated 🙏 |
Thanks for the report. I'm a Windows user and have often had that problem. When I try to install themes, plugins, update core, etc., I get a message prompting me to enter my FTP connection information: As far as I know, we have the following problems on Windows: When I try to install themes, plugins, update core, etc., I get a message prompting me to enter FTP connection information. Unable to switch languages. After a little deeper investigation, I found that this problem occurs when @wordpress/env switches from version 5.0.0 to 5.1.0. Additionally, starting with 5.1.0, the page appears to take much longer to display. On Windows, the WordPress directory is created in Starting with version 5.1.0, WordPress is downloaded from the GitHub repository instead of WordPress provided by Docker. I suspect that this change might have caused some differences in permissions that are causing this issue. @noahshrader |
@t-hamano I'm seeing the exact same thing on Windows. |
This is the PR - #42826 Pinging @noahtallen and @fullofcaffeine who collaborated on it. |
The permissions issue is indeed a deep rabbit hole... I suspect that using local files for WordPress is making those permissions issues happen more frequently? Before that wp-env version, the default WordPress PHP files were included in the docker image itself (the one officially published by Docker), which is why nothing is on the local filesystem. You can see the motivation for changing that behavior in #42826 |
The most recent and optimistic movement that I found about this issue is the following comment by @defunctl in the unmerged pull request, wp-env runs docker commands with same UID as host to prevent filesystem permission issues.
The pull request linked above is still an incomplete solution, as it only sets the user and group IDs for the If successful, this would solve a number of related issues such as:
..And all the places that are currently using
The The solution might have been easier, if not for this unresolved issue (since 9 years ago) in Docker itself: Make uid & gid configurable for shared volumes #7198. Thanks to this limitation, there are various hacks and workarounds to attempt to solve the permission issue, as can be seen in: https://stackoverflow.com/questions/23544282/what-is-the-best-way-to-manage-permissions-for-docker-shared-volumes/28596874
|
I just noticed this is also a problem for WordPress core's built-in Docker development environment. Whatever fix is put in place for the Gutenberg repo should be applied to WordPress core as well. |
This should be solved by #49962. You'll be able to see the change it when developing Gutenberg directly (since |
Description
When I
wp-env start
my dev environment and try to upload a plugin (zip) I'll get an "FTP Form" instead of an successful install.If I have a look at the
home/.wp-env/<container>/wp-contents/uploads
folder at least the plugin.zip exists, so the upload is done anyway but the installation is not.I also get
media could not be copied
error if I mapwp-content
to my project-folder. This error disappears if I remove the mapping but the above described error still exists.Occured on:
Works fine on:
I installed docker on windows via docker-desktop setup.
On linux I followed this guide, incl. the usermod to "use docker without root": https://linuxconfig.org/manjaro-linux-docker-installation
Step-by-step reproduction instructions
wp-env start
it on windows or linuxScreenshots, screen recording, code snippet
My
.wp-env.json
with both errors:My
.wp-env.json
with only the plugin installation from zip not working:The
/bin/php.ini
:Environment info
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: