Symfony4: Out of memory exception when throwing exception after switching to prod environment Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How to set the environment in a Symfony2 console commandSymfony2: prod not found 404 = 200?Symfony2 always displays blank page in productionFOSRestBundle configuration of exceptions messages in prod environmentProduction mode asseticSegfault when running doctrine:migrations:status in prod, after switching to php7symfony security prod doesn't worksymfony2 throws PHP exception in prod but not in devSymfony production cache creation troubleSymfony4 out of memory error upon EntityManager auto-injection

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

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

Lights are flickering on and off after accidentally bumping into light switch

Determine the generator of an ideal of ring of integers

Short story about an alien named Ushtu(?) coming from a future Earth, when ours was destroyed by a nuclear explosion

Trying to enter the Fox's den

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

Why isn't everyone flabbergasted about Bran's "gift"?

How to make an animal which can only breed for a certain number of generations?

Does Prince Arnaud cause someone holding the Princess to lose?

Is my guitar’s action too high?

Marquee sign letters

Salesforce - multiple pre production environments

Meaning of "Not holding on that level of emuna/bitachon"

"Destructive force" carried by a B-52?

Who's this lady in the war room?

Who can become a wight?

/bin/ls sorts differently than just ls

Why is one lightbulb in a string illuminated?

What is her name?

What documents does someone with a long-term visa need to travel to another Schengen country?

How to break 信じようとしていただけかも知れない into separate parts?

Unix AIX passing variable and arguments to expect and spawn

Do chord progressions usually move by fifths?



Symfony4: Out of memory exception when throwing exception after switching to prod environment



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How to set the environment in a Symfony2 console commandSymfony2: prod not found 404 = 200?Symfony2 always displays blank page in productionFOSRestBundle configuration of exceptions messages in prod environmentProduction mode asseticSegfault when running doctrine:migrations:status in prod, after switching to php7symfony security prod doesn't worksymfony2 throws PHP exception in prod but not in devSymfony production cache creation troubleSymfony4 out of memory error upon EntityManager auto-injection



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Since I switched to prod environment every exception I throw creates an out of memory exception.

I log my exceptions with monolog.



Everything worked fine until I switched my environment to production and ran the cache:clear command.



Why am I getting out of memory exceptions when I am sure that I am not running out of memory?










share|improve this question






























    1















    Since I switched to prod environment every exception I throw creates an out of memory exception.

    I log my exceptions with monolog.



    Everything worked fine until I switched my environment to production and ran the cache:clear command.



    Why am I getting out of memory exceptions when I am sure that I am not running out of memory?










    share|improve this question


























      1












      1








      1








      Since I switched to prod environment every exception I throw creates an out of memory exception.

      I log my exceptions with monolog.



      Everything worked fine until I switched my environment to production and ran the cache:clear command.



      Why am I getting out of memory exceptions when I am sure that I am not running out of memory?










      share|improve this question
















      Since I switched to prod environment every exception I throw creates an out of memory exception.

      I log my exceptions with monolog.



      Everything worked fine until I switched my environment to production and ran the cache:clear command.



      Why am I getting out of memory exceptions when I am sure that I am not running out of memory?







      symfony symfony4






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 9 at 2:44







      Merlin Fejzuli

















      asked Mar 9 at 2:25









      Merlin FejzuliMerlin Fejzuli

      1697




      1697






















          1 Answer
          1






          active

          oldest

          votes


















          -1














          Apparently the cache:clear command changes the access permissions of the symfonyproject/var directory to read-only and when an exception gets logged it somehow runs out of memory.



          Thanks to Preciel everything works fine now.
          From application root directory:



          $ chown -R www-data:www-data var
          $ find var -type d -exec chmod 755 "" ;
          $ find var -type f -exec chmod 664 "" ;
          $ find var -type d -exec chmod g+s "" ;


          I still don't know why an out of memory exception was thrown and not something like "directory not writable".






          share|improve this answer

























          • It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

            – Preciel
            Mar 9 at 3:53











          • @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

            – Merlin Fejzuli
            Mar 9 at 3:58












          • Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

            – Preciel
            Mar 9 at 12:09












          • @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

            – Merlin Fejzuli
            Mar 9 at 16:26











          • whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

            – Preciel
            Mar 10 at 15:25











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2fstackoverflow.com%2fquestions%2f55073418%2fsymfony4-out-of-memory-exception-when-throwing-exception-after-switching-to-pro%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          -1














          Apparently the cache:clear command changes the access permissions of the symfonyproject/var directory to read-only and when an exception gets logged it somehow runs out of memory.



          Thanks to Preciel everything works fine now.
          From application root directory:



          $ chown -R www-data:www-data var
          $ find var -type d -exec chmod 755 "" ;
          $ find var -type f -exec chmod 664 "" ;
          $ find var -type d -exec chmod g+s "" ;


          I still don't know why an out of memory exception was thrown and not something like "directory not writable".






          share|improve this answer

























          • It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

            – Preciel
            Mar 9 at 3:53











          • @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

            – Merlin Fejzuli
            Mar 9 at 3:58












          • Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

            – Preciel
            Mar 9 at 12:09












          • @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

            – Merlin Fejzuli
            Mar 9 at 16:26











          • whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

            – Preciel
            Mar 10 at 15:25















          -1














          Apparently the cache:clear command changes the access permissions of the symfonyproject/var directory to read-only and when an exception gets logged it somehow runs out of memory.



          Thanks to Preciel everything works fine now.
          From application root directory:



          $ chown -R www-data:www-data var
          $ find var -type d -exec chmod 755 "" ;
          $ find var -type f -exec chmod 664 "" ;
          $ find var -type d -exec chmod g+s "" ;


          I still don't know why an out of memory exception was thrown and not something like "directory not writable".






          share|improve this answer

























          • It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

            – Preciel
            Mar 9 at 3:53











          • @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

            – Merlin Fejzuli
            Mar 9 at 3:58












          • Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

            – Preciel
            Mar 9 at 12:09












          • @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

            – Merlin Fejzuli
            Mar 9 at 16:26











          • whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

            – Preciel
            Mar 10 at 15:25













          -1












          -1








          -1







          Apparently the cache:clear command changes the access permissions of the symfonyproject/var directory to read-only and when an exception gets logged it somehow runs out of memory.



          Thanks to Preciel everything works fine now.
          From application root directory:



          $ chown -R www-data:www-data var
          $ find var -type d -exec chmod 755 "" ;
          $ find var -type f -exec chmod 664 "" ;
          $ find var -type d -exec chmod g+s "" ;


          I still don't know why an out of memory exception was thrown and not something like "directory not writable".






          share|improve this answer















          Apparently the cache:clear command changes the access permissions of the symfonyproject/var directory to read-only and when an exception gets logged it somehow runs out of memory.



          Thanks to Preciel everything works fine now.
          From application root directory:



          $ chown -R www-data:www-data var
          $ find var -type d -exec chmod 755 "" ;
          $ find var -type f -exec chmod 664 "" ;
          $ find var -type d -exec chmod g+s "" ;


          I still don't know why an out of memory exception was thrown and not something like "directory not writable".







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 11 at 8:28

























          answered Mar 9 at 2:42









          Merlin FejzuliMerlin Fejzuli

          1697




          1697












          • It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

            – Preciel
            Mar 9 at 3:53











          • @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

            – Merlin Fejzuli
            Mar 9 at 3:58












          • Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

            – Preciel
            Mar 9 at 12:09












          • @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

            – Merlin Fejzuli
            Mar 9 at 16:26











          • whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

            – Preciel
            Mar 10 at 15:25

















          • It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

            – Preciel
            Mar 9 at 3:53











          • @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

            – Merlin Fejzuli
            Mar 9 at 3:58












          • Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

            – Preciel
            Mar 9 at 12:09












          • @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

            – Merlin Fejzuli
            Mar 9 at 16:26











          • whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

            – Preciel
            Mar 10 at 15:25
















          It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

          – Preciel
          Mar 9 at 3:53





          It's strongly inadivsable to set folder perms to 777. If your cache:clear command chance folder permissions, it mean that either the CLI user isn't the good one, or that folder permissions are not set properly.

          – Preciel
          Mar 9 at 3:53













          @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

          – Merlin Fejzuli
          Mar 9 at 3:58






          @Preciel Why is it inadvisable to change the permissions to 777? And can you tell me what I should do instead? Thanks in advance, any help is greatly appreciated!

          – Merlin Fejzuli
          Mar 9 at 3:58














          Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

          – Preciel
          Mar 9 at 12:09






          Why it's inadvisable? It's the same as giving your home keys to everyone you meet in the street... Never grant full permissions to files, it's dangerous as anyone can do what they want with it. As for what to do, first change /var/www ownership with chown -R www-data:www-data /var/www. Then set files and folder permissions with find /var/www/ -type d -exec chmod 775 "" ; and find /var/www/ -type f -exec chmod 664 "" ;. And last, make sure permissions are inherited with find /var/www -type d -exec chmod g+s "" ;

          – Preciel
          Mar 9 at 12:09














          @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

          – Merlin Fejzuli
          Mar 9 at 16:26





          @Preciel It's not the /var/www folder don't worry. It's the var folder inside the symfony applications root folder. Still I will implement your suggestions on monday and change my answer accordingly as soon as it works. Thank you for your time!

          – Merlin Fejzuli
          Mar 9 at 16:26













          whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

          – Preciel
          Mar 10 at 15:25





          whether it's /var/www or any other folder on your system, setting 777 is just bad. Even if it's juste the /var folder in Symfony. Proper files permissions is the first step to security... ;)

          – Preciel
          Mar 10 at 15:25



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f55073418%2fsymfony4-out-of-memory-exception-when-throwing-exception-after-switching-to-pro%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

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved