If you follow the Magento Commerce (Cloud) recommendations to use Configuration Management (and move static assets generation to the build stage in order to decrease website downtime during deployment), you may face the following error when running the
setup:static-content:deploy command manually:
5xyxqebtd36zi_stg@i-02dfdf9290e3a31fe:~$ php bin/magento setup:static-content:deploy Requested languages: en_US Requested areas: frontend, adminhtml Requested themes: Magento/blank, Magento/luma, Aheadworks/marketplace, Magento/backend [Magento\Framework\Exception\FileSystemException] The path "deployed_version.txt:///app/5xyxqebtd36zi_stg/pub/static/app/5xyxqebtd36zi_stg/pub/static/" is not writable
We have optimized the deployment process to decrease downtime and have created symlinks to static assets files instead of copying them. The location where the static assets are stored is read-only, that is why you get the error message above.
We strongly do not recommend to run static content deploy manually because all assets are already generated and there will be no difference between files if you do it manually (the theme files are read-only as well, you cannot change them), so there's no sense in such operation.
If you still want to run static content deployment, remove symlinks in the
pub/static directory and run the
setup:static-content:deploy command again:
find pub/static/ -maxdepth 1 -type l -delete