3

unfortunately i get this error when I try to do a magento2 setup upgrade

arredeom@chronos [~]# php public_html/bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/home/arredeom/public_html/var/generation/Composer
/home/arredeom/public_html/var/generation/Magento
/home/arredeom/public_html/var/generation/Symfony
The directory '/home/arredeom/public_html/var/di/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
Module 'Magento_Store':
Module 'Magento_Theme':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Eav':
Module 'Magento_Backend':
Module 'Magento_Backup':
Module 'Magento_Customer':
Module 'Magento_AdminNotification':
Module 'Magento_BundleImportExport':
Module 'Magento_CacheInvalidate':
Module 'Magento_Indexer':
Module 'Magento_Cms':
Module 'Magento_CatalogImportExport':
Module 'Magento_Catalog':
Module 'Magento_Rule':
Module 'Magento_Payment':
Module 'Magento_Search':
Module 'Magento_CatalogUrlRewrite':
Module 'Magento_Widget':
Module 'Magento_Quote':
Module 'Magento_CheckoutAgreements':
Module 'Magento_SalesSequence':
Module 'Magento_CmsUrlRewrite':
Module 'Magento_Config':
Module 'Magento_ConfigurableImportExport':
Module 'Magento_Msrp':
Module 'Magento_Contact':
Module 'Magento_Cookie':
Module 'Magento_Cron':
Module 'Magento_CurrencySymbol':
Module 'Magento_Sales':
Module 'Magento_CustomerImportExport':
Module 'Magento_Deploy':
Module 'Magento_Developer':
Module 'Magento_Dhl':
Module 'Magento_Authorization':
Module 'Magento_Downloadable':
Module 'Magento_ImportExport':
Module 'Magento_Bundle':
Module 'Magento_Email':
Module 'Magento_User':
Module 'Magento_Fedex':
Module 'Magento_GiftMessage':
Module 'Magento_CatalogInventory':
Module 'Magento_GoogleAnalytics':
Module 'Magento_GoogleOptimizer':
Module 'Magento_GroupedImportExport':
Module 'Magento_GroupedProduct':
Module 'Magento_DownloadableImportExport':
Module 'Magento_Checkout':
Module 'Magento_Integration':
Module 'Magento_LayeredNavigation':
Module 'Magento_Marketplace':
Module 'Magento_MediaStorage':
Module 'Magento_CatalogRule':
Module 'Magento_Multishipping':
Module 'Magento_ConfigurableProduct':
Module 'Magento_Newsletter':
Module 'Magento_OfflinePayments':
Module 'Magento_SalesRule':
Module 'Magento_PageCache':
Module 'Magento_Braintree':
Module 'Magento_Paypal':
Module 'Magento_Persistent':
Module 'Magento_ProductAlert':
Module 'Magento_ProductVideo':
Module 'Magento_Captcha':
Module 'Magento_Reports':
Module 'Magento_RequireJs':
Module 'Magento_Review':
Module 'Magento_Rss':
Module 'Magento_CatalogRuleConfigurable':
Module 'Magento_Authorizenet':
Module 'Magento_OfflineShipping':
Module 'Magento_GoogleAdwords':
Module 'Magento_SampleData':
Module 'Magento_CatalogSearch':
Module 'Magento_SendFriend':
Module 'Magento_Ui':
Module 'Magento_Sitemap':
Module 'Ibnab_ChangeAttributeSet':
Module 'Magento_Swagger':
Module 'Magento_Swatches':
Module 'Magento_Tax':
Module 'Magento_TaxImportExport':
Module 'Magento_NewRelicReporting':
Module 'Magento_Translation':
Module 'Magento_Shipping':
Module 'Magento_Ups':
Module 'Magento_UrlRewrite':
Module 'Magento_EncryptionKey':
Module 'Magento_Usps':
Module 'Magento_Variable':
Module 'Magento_Version':
Module 'Magento_Webapi':
Module 'Magento_WebapiSecurity':
Module 'Magento_Weee':
Module 'Magento_CatalogWidget':
Module 'Magento_Wishlist':
Module 'Smartwave_Core':
Module 'Smartwave_Filterproducts':
Module 'Smartwave_Megamenu':
Module 'Smartwave_Porto':
Schema post-updates:
Module 'Magento_Store':
Module 'Magento_Theme':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Eav':
Module 'Magento_Backend':
Module 'Magento_Backup':
Module 'Magento_Customer':
Module 'Magento_AdminNotification':
Module 'Magento_BundleImportExport':
Module 'Magento_CacheInvalidate':
Module 'Magento_Indexer':
Running recurring..
Module 'Magento_Cms':
Module 'Magento_CatalogImportExport':
Module 'Magento_Catalog':
Module 'Magento_Rule':
Module 'Magento_Payment':
Module 'Magento_Search':
Module 'Magento_CatalogUrlRewrite':
Module 'Magento_Widget':
Module 'Magento_Quote':
Module 'Magento_CheckoutAgreements':
Module 'Magento_SalesSequence':
Module 'Magento_CmsUrlRewrite':
Module 'Magento_Config':
Module 'Magento_ConfigurableImportExport':
Module 'Magento_Msrp':
Module 'Magento_Contact':
Module 'Magento_Cookie':
Module 'Magento_Cron':
Module 'Magento_CurrencySymbol':
Module 'Magento_Sales':
Module 'Magento_CustomerImportExport':
Module 'Magento_Deploy':
Module 'Magento_Developer':
Module 'Magento_Dhl':
Module 'Magento_Authorization':
Module 'Magento_Downloadable':
Module 'Magento_ImportExport':
Module 'Magento_Bundle':
Module 'Magento_Email':
Module 'Magento_User':
Module 'Magento_Fedex':
Module 'Magento_GiftMessage':
Module 'Magento_CatalogInventory':
Module 'Magento_GoogleAnalytics':
Module 'Magento_GoogleOptimizer':
Module 'Magento_GroupedImportExport':
Module 'Magento_GroupedProduct':
Module 'Magento_DownloadableImportExport':
Module 'Magento_Checkout':
Module 'Magento_Integration':
Module 'Magento_LayeredNavigation':
Module 'Magento_Marketplace':
Module 'Magento_MediaStorage':
Module 'Magento_CatalogRule':
Module 'Magento_Multishipping':
Module 'Magento_ConfigurableProduct':
Module 'Magento_Newsletter':
Module 'Magento_OfflinePayments':
Module 'Magento_SalesRule':
Module 'Magento_PageCache':
Module 'Magento_Braintree':
Module 'Magento_Paypal':
Module 'Magento_Persistent':
Module 'Magento_ProductAlert':
Module 'Magento_ProductVideo':
Module 'Magento_Captcha':
Module 'Magento_Reports':
Module 'Magento_RequireJs':
Module 'Magento_Review':
Module 'Magento_Rss':
Module 'Magento_CatalogRuleConfigurable':
Module 'Magento_Authorizenet':
Module 'Magento_OfflineShipping':
Module 'Magento_GoogleAdwords':
Module 'Magento_SampleData':
Module 'Magento_CatalogSearch':
Module 'Magento_SendFriend':
Module 'Magento_Ui':
Module 'Magento_Sitemap':
Module 'Ibnab_ChangeAttributeSet':
Module 'Magento_Swagger':
Module 'Magento_Swatches':
Module 'Magento_Tax':
Module 'Magento_TaxImportExport':
Module 'Magento_NewRelicReporting':
Module 'Magento_Translation':
Module 'Magento_Shipping':
Module 'Magento_Ups':
Module 'Magento_UrlRewrite':
Module 'Magento_EncryptionKey':
Module 'Magento_Usps':
Module 'Magento_Variable':
Module 'Magento_Version':
Module 'Magento_Webapi':
Module 'Magento_WebapiSecurity':
Module 'Magento_Weee':
Module 'Magento_CatalogWidget':
Module 'Magento_Wishlist':
Module 'Smartwave_Core':
Module 'Smartwave_Filterproducts':
Module 'Smartwave_Megamenu':
Module 'Smartwave_Porto':
object(SplFileInfo)#2612 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(126) "/home/arredeom/public_html/pub/static/frontend/Smartwave/porto_child/it_IT/Magento_Customer/template/authentication-popup.html"
  ["fileName":"SplFileInfo":private]=>
  string(25) "authentication-popup.html"
}
bool(false)



  [Exception]
  Missing write permissions to the following directories: '/home/arredeom/public_html/pub/stati
  c'



setup:upgrade [--keep-generated] [--magento-init-params="..."]

I tried

  1. setup/src/Magento/Setup/Model/FilePermissions.php
  2. Goto line 143 in method checkRecursiveDirectories
  3. Add the lines var_dump($subDirectory);var_dump($subDirectory->isWritable());
  4. Re run bin/magento setup:upgrade

but I don't see any changes, what can I do? thanks

3
  • make sure there should be 777 permission on var folder in side your Magento root dir
    – Arunendra
    Jun 1, 2016 at 9:29
  • I set them via ftp and using command below but (except for the fact that via ftp it says that is impossible to change it for some files) it's not working Jun 1, 2016 at 9:48
  • could this be this file's fault? object(SplFileInfo)#2506 (2) { ["pathName":"SplFileInfo":private]=> string(126) "/home/arredeom/public_html/pub/static/frontend/Smartwave/porto_child/it_IT/Magento_Customer/template/authentication-popup.html" ["fileName":"SplFileInfo":private]=> string(25) "authentication-popup.html" } bool(false) Jun 1, 2016 at 13:11

5 Answers 5

2

@Lauren I would suggest taking a look at this if you haven't already: http://devdocs.magento.com/guides/v2.0/install-gde/install/post-install-umask.html .

If you do decide to use this:

  1. rm -rf public_html/pub/static/* public_html/pub/media/* public_html/var/generation/* public_html/var/di

  2. Correctly set permissions on public_html (chmod 755 -R public_html or 777 or whatever you want, please read link below on file permissions to understand this concept better, and then check the docs for your Linux distribution for how to make these changes)

  3. *If you chose to use the umask, make sure it reflects the permissions you want...if you use 000 , then your permissions will be 777. I think this explanation of Unix file permissions is accessible: https://unix.stackexchange.com/a/184005

  4. php public_html/bin/magento setup:upgrade

I hope that this helps

1

Well, as the error message says it is a permission issue.

I suggest you try to run the following commands:

find pub/static -type f -exec chmod g+w {} \;
find pub/static -type d -exec chmod g+w {} \;

You can find more details about Magento 2 permissions in the official documentation.

7
  • I executed arredeom@chronos [~]# find public_html/pub/static -type f -exec chmod g+w {} \; and arredeom@chronos [~]# find public_html/pub/static -type d -exec chmod g+w {} \; but nothing happened :\ Jun 1, 2016 at 9:32
  • @LaurenFrida did you try to rerun the upgrade command after running those commands ? Jun 1, 2016 at 9:33
  • yes, and I get the same error Jun 1, 2016 at 9:38
  • is there anything else I can try? Jun 6, 2016 at 7:57
  • @LaurenFrida not recommended but could you try chmod -R 777 ./pub/static Jun 6, 2016 at 8:03
0

The error message is not always helpful here, as more often than not, this is really caused by a broken symbolic link in the pub/static directory. An example is if a file in pub/static is pointing to a certain module's file, and then that module's file is moved or deleted.

To see if there are any broken links, run the following command from the pub/static folder:

find -L . -type l

See the following for more context: Missing write permissions in directory pub/static when run bin/magento setup:upgrade

0

In my case running upgrade command through non-root user or a user with limited permissions was causing the error. Make sure you run the upgrade command with a user with enough permissions.

0

Just Remove the Symbolic Link By Command

find -L . -type l -exec rm {} \;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.