Skip to content

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

@andronocean

Description

@andronocean

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions