TransWikia.com

Folder Permissions denied with Nitro

Craft CMS Asked by Simon Clayson on March 4, 2021

I’m getting this error when accessing/writing images. It’s only just come along suddenly after one or a couple of updates.

LeagueFlysystemException

Impossible to create the root directory
"/Users/username/Sites/project-name/craft/web/images/folder". mkdir():
Permission denied

  • Running Nitro with Multipass 1.5
  • Multipassd has all Full Disk Access (but had to add this manually from Application Services)
  • Craft CMS 3.5.16
  • MacOS Catalina 10.15.7
  • Composer version 2.0.8
  • Unable to change file permissions in Finder/Transmit etc
  • Not new installs
  • Unable to load an image through CP. Same message as above

Nitro running other simpler site fine, so no problems there.

At a loss, any site running locally that needs images will fail to load, but /admin runs all fine.

Thanks 🙂

One Answer

This could be because you are setting your Settings → Assets → your volume File System Path to an absolute location outside the VM.

Create an alias (or hard-set webroot) using:

'aliases' => [
    'webroot' => dirname(__DIR__) . '/web'
],

In your config/general.php (changing web if you have a different public root).

With this in place, change the File System Path of your volume to @webroot/your/path which should solve you issue.

Correct answer by Oli on March 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP