Seravo / wordpress

The WordPress project layout used by many of Seravo's customers, suitable also for local development with Vagrant and git deployment
https://seravo.com
GNU General Public License v3.0
102 stars 54 forks source link

File (?) permissions on Windows #161

Open lecklin opened 3 years ago

lecklin commented 3 years ago

When updating plugins or e.g. a default theme on a local environment in Windows, be it via the dashboard or WP-CLI, the updates will very often fail. The error WordPress/WP-CLI provides is that it can't remove a file and/or folder. After such an error, a completely different plugin might update without issues.

Looking at a plugin directory after the error, it might be that that everything has been removed except for example one folder with one file remaining. Strangely enough, updating core never seems to fail.

I've been trying to Google this issue for quite some time now, without much luck so far. Running VirtualBox 5.2.42 and Vagrant 2.2.9.

Perhaps running everything under WSL would work, but afaik Vagrant for it is still in beta. Plus surely a solution for this issue exists. Hoping someone else has a better idea of where to start investigating, or maybe even a solution. Once a solution is found it could be added to the documentation under Windows installation instructions.

ottok commented 3 years ago

Thanks for reporting!

Can you send a copy-paste of what ls -la prints inside and outside Vagrant in the situation that "everything has been removed"?

Or a screenshot? This could also be related to composer install runs or something else. We need more details to be able to reproduce/debug the situation.

lecklin commented 3 years ago

Yes of course I can provide more details. This was more of an opener for figuring this out, and I expected that more details would be required.

I'll try to get these provided soon.

I have some number of other local installs that have not been updated, so I'll grab a before and after ls -la both inside and outside of Vagrant in one of those.

ottok commented 3 years ago

We have not been able to reproduce this issue. If somebody experiences this again, please provide more into. For example file listings with permissions would be nice to see in case there is something special in them.

lecklin commented 3 years ago

I'll try to remember and provide the details soon. I usually run into this issue during a work task, which means I work around it and move on at which point the details can't be collected.

I have some theories on this, but not sure how to test them. I'll try explain those too when I get back to this.

lecklin commented 3 years ago

Seems to be Nginx locking down css/js files of plugins/themes. This seems to be a very similar scenario:

https://stackoverflow.com/questions/42574500/cant-edit-delete-file-shared-with-vagrant-on-windows-10-vitualbox-issue

I tried some Nginx confs, similar to what was mentioned in the link, but to no avail. I also tried the ones Local (by Flywheel) uses for local Nginx sites, since that has no issues. Then again the scenario here is entirely different, Seravo WP runs VB/VVV and Local these days is a native environment on all platforms.

Not entirely sure yet, but it seems like a temporary workaround is to run wp-restart-nginx, then make sure to not visit the local site frontend or dashboard after, and update plugins/themes. The logic behind this is that, for example seeing the thumbnail of a default theme in the dashboard has Nginx lock down that file preventing updating.