create subtheme: permission problems

Created on 20 June 2021, over 3 years ago
Updated 14 September 2023, about 1 year ago

Problem/Motivation

None.

Steps to reproduce

As administrator i try a create a subtheme.

After clicking 'create' i get error

'The website encountered an unexpected error. Please try again later.'

There are two error messages in the logs:

1)

Drupal\Core\File\Exception\DirectoryNotReadyException: The specified file 'themes/contrib/bootstrap5/css/style.css.map' could not be copied because the destination directory '/var/www/vhosts/phano.de/httpdocs/drupal/web/themes/custom/b5subtheme/css' is not properly configured. This may be caused by a problem with file or directory permissions. in Drupal\Core\File\FileSystem->prepareDestination() (line 476 of /var/www/vhosts/xxxxxxxxx.com/httpdocs/drupal/web/core/lib/Drupal/Core/File/FileSystem.php).

2)

The specified file 'themes/contrib/bootstrap5/css/style.css.map' could not be copied because the destination directory '/var/www/vhosts/xxxxxxxxx.com/httpdocs/drupal/web/themes/custom/b5subtheme/css' is not properly configured. This may be caused by a problem with file or directory permissions.

Proposed resolution

None.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany upk

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇶Caribbean Netherlands calbasi Catalonia

    In my case, the issue is due opendir restrictions. If disabled it in my web account (ispconfig) and then I have not issue at all.

  • I'm still getting the "Subtheme cannot be created. Check permissions." error despite having allowed everything for the /themes directory and the root it is located into.

    Even adding permission to the normal /bootstrap5 theme directory (which makes no sense, but I tried because you never know) yelded no result.

    I have no idea what other permissions I should change.

  • 🇪🇸Spain dtamajon

    @Videtes, try with the following patch: https://www.drupal.org/project/drupal/issues/2799635 🐛 FileSystem::mkdir should handle open_basedir correctly Needs work

    We are using nginx and we had the same problem, given the way in which the core manages the file creation. With that patch, the problem is solved without the need to provide unsecure permissions to the filesystem.

  • @dtamajon, that patch worked for me, thanks a lot!

  • Still got permission issues with creating B5 subtheme, tried on nginx and local repositories, no result for me

Production build 0.71.5 2024