404 after running setup:di:compile, need to always run chown -R root:www-data . afterwards Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?After every setup:upgrade I need to give permission (Debien)Warning: imagejpeg 'Failed to open stream' on product update Magento 2Uncaught TypeError: Argument 1 passed to […] must be an instance of“Fatal error: Uncaught TypeError: Argument 1 passed to […]::__construct() must be an instance of […]” after (re-)compileMagento-2.1 : Warning: Missing argument 2 for OAuthCommonConsumerCredentials::__construct()Magento2 store permission errorsMagento 2: Run setup:di:compile a Specific ModuleMagento2: impossible run command in terminal setup:di:compileMagento 2.3 Inject helper into controller object type error?Magento Website ErrorMsrpPriceCalculator Exception

Trying to enter the Fox's den

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

Can I ask an author to send me his ebook?

Why doesn't the university give past final exams' answers?

Why not use the yoke to control yaw, as well as pitch and roll?

What's the connection between Mr. Nancy and fried chicken?

A journey... into the MIND

Is it OK if I do not take the receipt in Germany?

What is the ongoing value of the Kanban board to the developers as opposed to management

Unix AIX passing variable and arguments to expect and spawn

"Destructive force" carried by a B-52?

Who can become a wight?

What is the definining line between a helicopter and a drone a person can ride in?

What were wait-states, and why was it only an issue for PCs?

/bin/ls sorts differently than just ls

What helicopter has the most rotor blades?

Why is one lightbulb in a string illuminated?

Suing a Police Officer Instead of the Police Department

Why do people think Winterfell crypts is the safest place for women, children & old people?

Construct a nonabelian group of order 44

Can the van der Waals coefficients be negative in the van der Waals equation for real gases?

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

Why does BitLocker not use RSA?

How to mute a string and play another at the same time



404 after running setup:di:compile, need to always run chown -R root:www-data . afterwards



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?After every setup:upgrade I need to give permission (Debien)Warning: imagejpeg 'Failed to open stream' on product update Magento 2Uncaught TypeError: Argument 1 passed to […] must be an instance of“Fatal error: Uncaught TypeError: Argument 1 passed to […]::__construct() must be an instance of […]” after (re-)compileMagento-2.1 : Warning: Missing argument 2 for OAuthCommonConsumerCredentials::__construct()Magento2 store permission errorsMagento 2: Run setup:di:compile a Specific ModuleMagento2: impossible run command in terminal setup:di:compileMagento 2.3 Inject helper into controller object type error?Magento Website ErrorMsrpPriceCalculator Exception



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have noticed that from time to time my Magento installation shows 404 on all pages. Panic!



After doing some research I found out that running:
chown -R root:www-data . in the document folder solved the problem temporarily.



Until the next day and the problem is back.



I have since then been able to recreate the problem with that if I run:



php bin/magento setup:di:compile



it crashes and requires me to run the: chown -R root:www-data .
to fix the problem.



Why is this? Why do I always get these errors?



The error log shows problems with the cache folder:




`#0
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
Zend_Cache::throwException('cache_dir "/var...')



1 /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):



Zend_Cache_Backend_File->setCacheDir('/var/www/html/v...')



2 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):



Cm_Cache_Backend_File->__construct(Array)



3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):



Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)



4 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):



Zend_Cache::factory('MagentoFramewo...', 'Cm_Cache_Backen...',
Array, Array, true, true, true)



5 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):



MagentoFrameworkAppCacheFronte" while reading response header from
upstream, client: 172.68.182.104, server: _, request: "GET /
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"www.kickacc.se" ^C`











share|improve this question
























  • Check this. It will be helpful for you. https://magento.stackexchange.com/questions/267292/after-every-setupupgrade-i-need-to-give-permission-debien/267334#267334

    – Yash Shah
    2 days ago











  • Thanks, but I am using nginx, LEMP (PHP 7.2 and MariaDB). Do you have any suggestions for that setup?

    – user3091199
    2 days ago

















1















I have noticed that from time to time my Magento installation shows 404 on all pages. Panic!



After doing some research I found out that running:
chown -R root:www-data . in the document folder solved the problem temporarily.



Until the next day and the problem is back.



I have since then been able to recreate the problem with that if I run:



php bin/magento setup:di:compile



it crashes and requires me to run the: chown -R root:www-data .
to fix the problem.



Why is this? Why do I always get these errors?



The error log shows problems with the cache folder:




`#0
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
Zend_Cache::throwException('cache_dir "/var...')



1 /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):



Zend_Cache_Backend_File->setCacheDir('/var/www/html/v...')



2 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):



Cm_Cache_Backend_File->__construct(Array)



3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):



Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)



4 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):



Zend_Cache::factory('MagentoFramewo...', 'Cm_Cache_Backen...',
Array, Array, true, true, true)



5 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):



MagentoFrameworkAppCacheFronte" while reading response header from
upstream, client: 172.68.182.104, server: _, request: "GET /
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"www.kickacc.se" ^C`











share|improve this question
























  • Check this. It will be helpful for you. https://magento.stackexchange.com/questions/267292/after-every-setupupgrade-i-need-to-give-permission-debien/267334#267334

    – Yash Shah
    2 days ago











  • Thanks, but I am using nginx, LEMP (PHP 7.2 and MariaDB). Do you have any suggestions for that setup?

    – user3091199
    2 days ago













1












1








1








I have noticed that from time to time my Magento installation shows 404 on all pages. Panic!



After doing some research I found out that running:
chown -R root:www-data . in the document folder solved the problem temporarily.



Until the next day and the problem is back.



I have since then been able to recreate the problem with that if I run:



php bin/magento setup:di:compile



it crashes and requires me to run the: chown -R root:www-data .
to fix the problem.



Why is this? Why do I always get these errors?



The error log shows problems with the cache folder:




`#0
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
Zend_Cache::throwException('cache_dir "/var...')



1 /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):



Zend_Cache_Backend_File->setCacheDir('/var/www/html/v...')



2 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):



Cm_Cache_Backend_File->__construct(Array)



3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):



Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)



4 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):



Zend_Cache::factory('MagentoFramewo...', 'Cm_Cache_Backen...',
Array, Array, true, true, true)



5 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):



MagentoFrameworkAppCacheFronte" while reading response header from
upstream, client: 172.68.182.104, server: _, request: "GET /
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"www.kickacc.se" ^C`











share|improve this question
















I have noticed that from time to time my Magento installation shows 404 on all pages. Panic!



After doing some research I found out that running:
chown -R root:www-data . in the document folder solved the problem temporarily.



Until the next day and the problem is back.



I have since then been able to recreate the problem with that if I run:



php bin/magento setup:di:compile



it crashes and requires me to run the: chown -R root:www-data .
to fix the problem.



Why is this? Why do I always get these errors?



The error log shows problems with the cache folder:




`#0
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
Zend_Cache::throwException('cache_dir "/var...')



1 /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):



Zend_Cache_Backend_File->setCacheDir('/var/www/html/v...')



2 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):



Cm_Cache_Backend_File->__construct(Array)



3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):



Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)



4 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):



Zend_Cache::factory('MagentoFramewo...', 'Cm_Cache_Backen...',
Array, Array, true, true, true)



5 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):



MagentoFrameworkAppCacheFronte" while reading response header from
upstream, client: 172.68.182.104, server: _, request: "GET /
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"www.kickacc.se" ^C`








magento2.3 permissions 404-page setup-di-compile






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









ARUNPRABAKARAN M

536114




536114










asked 2 days ago









user3091199user3091199

462




462












  • Check this. It will be helpful for you. https://magento.stackexchange.com/questions/267292/after-every-setupupgrade-i-need-to-give-permission-debien/267334#267334

    – Yash Shah
    2 days ago











  • Thanks, but I am using nginx, LEMP (PHP 7.2 and MariaDB). Do you have any suggestions for that setup?

    – user3091199
    2 days ago

















  • Check this. It will be helpful for you. https://magento.stackexchange.com/questions/267292/after-every-setupupgrade-i-need-to-give-permission-debien/267334#267334

    – Yash Shah
    2 days ago











  • Thanks, but I am using nginx, LEMP (PHP 7.2 and MariaDB). Do you have any suggestions for that setup?

    – user3091199
    2 days ago
















Check this. It will be helpful for you. https://magento.stackexchange.com/questions/267292/after-every-setupupgrade-i-need-to-give-permission-debien/267334#267334

– Yash Shah
2 days ago





Check this. It will be helpful for you. https://magento.stackexchange.com/questions/267292/after-every-setupupgrade-i-need-to-give-permission-debien/267334#267334

– Yash Shah
2 days ago













Thanks, but I am using nginx, LEMP (PHP 7.2 and MariaDB). Do you have any suggestions for that setup?

– user3091199
2 days ago





Thanks, but I am using nginx, LEMP (PHP 7.2 and MariaDB). Do you have any suggestions for that setup?

– user3091199
2 days ago










2 Answers
2






active

oldest

votes


















1














There might be 2 case 


1. Cache issue



rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ 
rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs/
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy


2. Permission Issue



find . -type f -exec chmod 644 ;
find . -type d -exec chmod 755 ;
find ./var -type d -exec chmod 777 ;
find ./pub/media -type d -exec chmod 777 ;
find ./pub/static -type d -exec chmod 777 ;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml





share|improve this answer






























    0














    Execute these commands as a root user



    find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w +
    find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws +


    Set the root ownership as sudo chown -R :<web server group> . after executing this.



    Try once again and say if you are facing the issue. Please also share the var and generated ownership file permissions to analyze the cause of the issue.



    So don't you have a Magento user other than the root user






    share|improve this answer























    • Its running as chown root:www-data at the moment. Does that sound ok ?

      – user3091199
      2 days ago












    • So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

      – Raj Mohan R
      2 days ago











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270834%2f404-after-running-setupdicompile-need-to-always-run-chown-r-rootwww-data%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    There might be 2 case 


    1. Cache issue



    rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ 
    rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs/
    php bin/magento setup:upgrade
    php bin/magento setup:static-content:deploy


    2. Permission Issue



    find . -type f -exec chmod 644 ;
    find . -type d -exec chmod 755 ;
    find ./var -type d -exec chmod 777 ;
    find ./pub/media -type d -exec chmod 777 ;
    find ./pub/static -type d -exec chmod 777 ;
    chmod 777 ./app/etc
    chmod 644 ./app/etc/*.xml





    share|improve this answer



























      1














      There might be 2 case 


      1. Cache issue



      rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ 
      rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs/
      php bin/magento setup:upgrade
      php bin/magento setup:static-content:deploy


      2. Permission Issue



      find . -type f -exec chmod 644 ;
      find . -type d -exec chmod 755 ;
      find ./var -type d -exec chmod 777 ;
      find ./pub/media -type d -exec chmod 777 ;
      find ./pub/static -type d -exec chmod 777 ;
      chmod 777 ./app/etc
      chmod 644 ./app/etc/*.xml





      share|improve this answer

























        1












        1








        1







        There might be 2 case 


        1. Cache issue



        rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ 
        rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs/
        php bin/magento setup:upgrade
        php bin/magento setup:static-content:deploy


        2. Permission Issue



        find . -type f -exec chmod 644 ;
        find . -type d -exec chmod 755 ;
        find ./var -type d -exec chmod 777 ;
        find ./pub/media -type d -exec chmod 777 ;
        find ./pub/static -type d -exec chmod 777 ;
        chmod 777 ./app/etc
        chmod 644 ./app/etc/*.xml





        share|improve this answer













        There might be 2 case 


        1. Cache issue



        rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ 
        rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs/
        php bin/magento setup:upgrade
        php bin/magento setup:static-content:deploy


        2. Permission Issue



        find . -type f -exec chmod 644 ;
        find . -type d -exec chmod 755 ;
        find ./var -type d -exec chmod 777 ;
        find ./pub/media -type d -exec chmod 777 ;
        find ./pub/static -type d -exec chmod 777 ;
        chmod 777 ./app/etc
        chmod 644 ./app/etc/*.xml






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Yann MartelYann Martel

        8716




        8716























            0














            Execute these commands as a root user



            find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w +
            find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws +


            Set the root ownership as sudo chown -R :<web server group> . after executing this.



            Try once again and say if you are facing the issue. Please also share the var and generated ownership file permissions to analyze the cause of the issue.



            So don't you have a Magento user other than the root user






            share|improve this answer























            • Its running as chown root:www-data at the moment. Does that sound ok ?

              – user3091199
              2 days ago












            • So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

              – Raj Mohan R
              2 days ago















            0














            Execute these commands as a root user



            find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w +
            find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws +


            Set the root ownership as sudo chown -R :<web server group> . after executing this.



            Try once again and say if you are facing the issue. Please also share the var and generated ownership file permissions to analyze the cause of the issue.



            So don't you have a Magento user other than the root user






            share|improve this answer























            • Its running as chown root:www-data at the moment. Does that sound ok ?

              – user3091199
              2 days ago












            • So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

              – Raj Mohan R
              2 days ago













            0












            0








            0







            Execute these commands as a root user



            find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w +
            find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws +


            Set the root ownership as sudo chown -R :<web server group> . after executing this.



            Try once again and say if you are facing the issue. Please also share the var and generated ownership file permissions to analyze the cause of the issue.



            So don't you have a Magento user other than the root user






            share|improve this answer













            Execute these commands as a root user



            find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w +
            find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws +


            Set the root ownership as sudo chown -R :<web server group> . after executing this.



            Try once again and say if you are facing the issue. Please also share the var and generated ownership file permissions to analyze the cause of the issue.



            So don't you have a Magento user other than the root user







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 days ago









            Raj Mohan RRaj Mohan R

            683110




            683110












            • Its running as chown root:www-data at the moment. Does that sound ok ?

              – user3091199
              2 days ago












            • So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

              – Raj Mohan R
              2 days ago

















            • Its running as chown root:www-data at the moment. Does that sound ok ?

              – user3091199
              2 days ago












            • So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

              – Raj Mohan R
              2 days ago
















            Its running as chown root:www-data at the moment. Does that sound ok ?

            – user3091199
            2 days ago






            Its running as chown root:www-data at the moment. Does that sound ok ?

            – user3091199
            2 days ago














            So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

            – Raj Mohan R
            2 days ago





            So don't you have a user?If not create one following the document devdocs.magento.com/guides/v2.3/install-gde/prereq/…. Don't give 777 access to your magento files and folders as it is not recommended

            – Raj Mohan R
            2 days ago

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270834%2f404-after-running-setupdicompile-need-to-always-run-chown-r-rootwww-data%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form