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

Operation not permitted warning on local dev env (mounted filesystem) #190

Open
andronocean opened this issue Sep 5, 2022 · 1 comment

Comments

@andronocean
Copy link

Hi, and first of all thank you so much for creating satispress — this project has been an absolute lifesaver!

This issue is a very low priority, since nothing actually breaks. The warning gets emitted on this rename() call when archiving a new plugin release:

if ( ! rename( $source, $filename ) ) {

Here's an example of the warning from debug.log. This seems to appear any time a new release for a watched plugin (here, for example, Gutenberg) is being archived:

PHP Warning:  rename(/tmp/satispress/gutenberg-14.0.2.zip,/srv/www/example.test/current/web/app/uploads/satispress-lnWtRfJc1aeA/packages/gutenberg/gutenberg-14.0.2.zip): Operation not permitted in /srv/www/example.test/current/web/app/plugins/satispress/src/Storage/Local.php on line 134

The rename/move does work, however, since the zip in /tmp/satispress is deleted and reappears at the /srv/www... location. Permissions look fine. So everything functions — but warnings appear in WP debug.log occasionally.

I've only seen this warning on my local dev environment, never in production. For local dev I'm running Trellis on a Mac, with Vagrant on Virtualbox as the VM provider, so mounted filesystems are involved between the Linux VM and my Mac. Specifically /tmp/ and /srv/www/example.test/current/ are on different filesystems. This is almost certainly the root cause of the warning.

Hence I'm pretty sure this is related to the cross-filesystem rename() behavior described in this comment: https://www.php.net/manual/en/function.rename.php#117590.

Again, low-priority, and I can submit a fix PR if you like. Mostly I just wanted to document this in case anyone else comes across the same situation, or something similar.

@bradyvercher
Copy link
Member

Hi @andronocean, I apologize for the delay, but I'm glad to hear you've found SatisPress useful!

There haven't been any other reports, but I appreciate you opening this just in case. Would the fix involve using copy/unlink instead of rename? If you'd like to submit a PR, I can get that merged to get rid of that debug pollution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants