composer require Could not delete ...default/default.services.yml

Created on 20 June 2025, 22 days ago

Problem/Motivation

When upgrading Drupal 11.1.8 to Drupal 11.2.0, I have the following error/warning in the composer script report :

In Filesystem.php line 303:
Could not delete ...../web/sites/default/default.services.yml:

I have seen that a similar problem was reported 5-6 years ago (with Drupal 8). See : https://www.drupal.org/forum/support/post-installation/2019-12-09/fresh-...

What should we do ?
Thanks for your advice.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

💬 Support request
Status

Active

Version

11.2 🔥

Component

install system

Created by

🇫🇷France dpierre

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dpierre
  • What are the permissions of the parent directories and of the file? The user account executing the composer command doesn't have permissions to remove or to alter that file. This happens because Drupal "hardens" security on those key files.

  • 🇫🇷France dpierre

    Thanks for your answer.

    parent directory "default" permission is 555
    file "default.services.yml" permission is 644

    I am not worried about this error/warning. But it always raises questions when such an event occurs.

    What is your advice ?
    Should I manually remove the "default.services.yml" file ?
    Should I keep things as they are ?

    At Drupal first installation, the "settings.php" file is created in the ""default" directory (permission 555). As far as I understand, in that case, the installation program modifies the permission in order to create it. Am I wrong ? Could it be the same for deleting the "default.services.yml" file ?

    Once again, thanks for your answers and advices. In the past months, it helped me moving forward with Drupal 11.

Production build 0.71.5 2024