1

This one has been bugging me for months.

My development environment is running on MAMP on OS X. It's worked absolutely find for ages but for no reason that I can identify all my Craft sites now throw the following error when trying to apply updates via the craft cli:

./craft update craft

[snip]

Performing update with Composer ... PHP Fatal Error 'yii\base\ErrorException' with message 'Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes)'

Doesn't matter how much memory I give php, it will always eat it all up, exmaple of silly about of memory:

php -i | grep memory
memory_limit => 2048M => 2048

It will run for a good 2-3 minutes before throwing the error.

I assumed there was something odd with my local environment so held on as I was reloading the mac, but the issue has followed me to a fresh install.

I did notices the number of bytes it refers too is ~1.6GB, this figure doesn't change with php cli's memory limit, for example if I drop the limit to 512MB I get the same allowed memory size figure, which suggests to me there is another php binary in play here, but I don't know enough about how the craft cli works to troubleshoot that.

When this happens, in most cases I can complete the update using composer, but it's a hack that I don't want to continue with.

Versions are as follows:

Craft: All 3.1 and above, possibly 3.0 too but can't confirm Mamp: 5.51 php cli: 7.2.21 Composer: 1.9.0 OS X: 10.14

Any ideas on how to troubleshoot this further?

  • huh... weird. the only thing I can think of would be to hook xDebug up to the CLI and step through the code to see what's going on... maybe some infinite loop? We haven't heard of any other issues like this, though. – Brad Bell Sep 25 '19 at 18:15
  • Weird for sure. My setup is so vanilla it's not funny so I couldn't understand why nobody else was reporting this. I'll try xDebug, it's way out my comfort zone but will see if I can get somewhere – neekster Sep 26 '19 at 2:01
  • 1
    I'm suddenly having exactly the same issue. – artmem Oct 3 '19 at 19:50
  • I tried debugging it but didn't really get anywhere. I'm all out of ideas – neekster Oct 5 '19 at 4:57
  • I am having the same issue too. And I have not found a solution yet. I ctrl-c on Performing update with Composer and initiate composer update manually. – Dennis Frank Oct 13 '19 at 12:13
2

This ended up being a bug in Craft that was fixed in https://github.com/craftcms/cms/commit/df40f585cef3d7e47f811f73b08d9d71bbc9c9b2 and will be included in the next (3.3.14) release.

| improve this answer | |
  • "Update complete!" Not seen that in a while! Worked at least in the case of plugins. Will wait and see for the next Craft release. Thanks Brad – neekster Oct 31 '19 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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