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;
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
add a comment |
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
add a comment |
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
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
symfony symfony4
edited Mar 9 at 2:44
Merlin Fejzuli
asked Mar 9 at 2:25
Merlin FejzuliMerlin Fejzuli
1697
1697
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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".
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 withchown -R www-data:www-data /var/www
. Then set files and folder permissions withfind /var/www/ -type d -exec chmod 775 "" ;
andfind /var/www/ -type f -exec chmod 664 "" ;
. And last, make sure permissions are inherited withfind /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
|
show 2 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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".
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 withchown -R www-data:www-data /var/www
. Then set files and folder permissions withfind /var/www/ -type d -exec chmod 775 "" ;
andfind /var/www/ -type f -exec chmod 664 "" ;
. And last, make sure permissions are inherited withfind /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
|
show 2 more comments
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".
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 withchown -R www-data:www-data /var/www
. Then set files and folder permissions withfind /var/www/ -type d -exec chmod 775 "" ;
andfind /var/www/ -type f -exec chmod 664 "" ;
. And last, make sure permissions are inherited withfind /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
|
show 2 more comments
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".
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".
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 withchown -R www-data:www-data /var/www
. Then set files and folder permissions withfind /var/www/ -type d -exec chmod 775 "" ;
andfind /var/www/ -type f -exec chmod 664 "" ;
. And last, make sure permissions are inherited withfind /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
|
show 2 more comments
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 withchown -R www-data:www-data /var/www
. Then set files and folder permissions withfind /var/www/ -type d -exec chmod 775 "" ;
andfind /var/www/ -type f -exec chmod 664 "" ;
. And last, make sure permissions are inherited withfind /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
|
show 2 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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