Skip to content

deploy returns 'Operation not permitted' with chgrp on shared_dirs #2571

@memen45

Description

@memen45

A while after the first deploy, I wanted to update, so did a deploy again. In the mean time, the web user (www-data) added some files to some of the shared_dirs, also making some subdirectories. These files and directories are created with owner www-data:www-data and this should not be a problem.

Now, trying to deploy, the dep deploy returns an extended list of all those files and directories with e.g.
chgrp: changing group of 'pub/media/tmp/design/file': Operation not permitted
The deploy process is ran from the user 'deploy' with the following settings:

set('writable_mode', 'chgrp');
set('writable_recursive', true);
set('http_group', 'www-data');

Effectively, the command that is executed by the deploy user is chgrp -H -R www-data writable_dirs, however, chgrp is not allowed on files or directories that are not owned by the user calling it. Since the new files are created by www-data:www-data, this command fails, even thought the group actually already is www-data. So, the complete deploy fails, while nothing is wrong with the file permissions.

How can this be solved? Is this caused by the overlap of shared_dirs and writable_dirs? I can imagine that permissions do not have to be repeatedly set for shared_dirs, as those are not created again for each deploy. So only the first deploy should set permissions for shared_dirs AND writable_dirs, but subsequent deploys should only set permissions for writable_dirs that are NOT shared_dirs (with one exception, in case the shared_dirs have changed, the new directories have to be created and permissions have te be set).

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