Magento 2 Permissions Exception During bin/magento setup: upgrade

  • author-img Nidhi Arora
  • 6 years

After updating a module & running bin/magento setup: upgrade, if you are getting exception – “Missing write permissions to the following directories: ‘/var/www/html/magento2/pub/static’, you don’t need to worry anymore. Due to an older installation where some symlinks & old files are no longer existing, when checkInstallationFilePermissions confirms the permission recursively, it finds missing symlink & returns false on the verification step. This blog post is going to explore the steps to handle this exception & how to debug it.

1) setup/src/Magento/Setup/Model/FilePermissions.php


2) Come to the line 143 in method checkRecursiveDirectories


3) Include the lines var_dump($subDirectory);var_dump($subDirectory->isWritable());


4) Run again – bin/magento setup: upgrade


After performing above steps, if you are still not able to debug the issue,


5) You need to check for existing modules that no longer exist, but having files in pub/static folder. We recommend you delete such files.


After such steps, run php bin/magento setup: upgrade command, and also clear cache.

Download Blog


Ready to Get started

Communication is the key for us to understand each other. Allow us to understand
your requirements or queries. Present us with an opportunity to serve you.

Fill out the form and out team will get back to you
within 24 hours

    Head Office

    1250 Pittsford Victor Road Ste 310
    Pittsford, NY 14534

    Development Center

    Plot no. 10, Rajiv Gandhi
    Chandigarh Technology Park