v2-hub icon indicating copy to clipboard operation
v2-hub copied to clipboard

Excessive memory when updating

Open wesort opened this issue 5 years ago • 8 comments

Describe the bug NB: might be the same as #1783

Updating from v2.11.9 to v2.11.10 has failed via the CP on multiple sites. Seems to be a memory issue.

Was able to workaround by setting memory_limit = 2048M in php.ini (previously set at 512M). This seems extraordinarily high based on reading other {s} issues and forum posts.

Wondering if setting memory_limit to -1 would be reasonable? (That value is taken from the Composer help doc here linked to in the error message.)

To Reproduce Steps to reproduce the behaviour:

  1. Update the site from Control Panel
  2. Files download and upzip
  3. Installation fails with the following message in CP
Couldn't install dependencies.
The command "php composer.phar update rap2hpoutre/laravel-log-viewer --prefer-dist --no-dev --optimize-autoloader" failed. 
Exit Code: 255(Unknown error) 
Output: ================ 
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 32 bytes) in phar:///home/wesort/webapps/ccdev/local/temp/update-unzipped/statamic/statamic/composer.phar/src/Composer/DependencyResolver/RuleWatchNode.php on line 40 
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors. 
Error Output: ================ 
Loading composer repositories with package information 
Updating dependencies

Expected behavior

  • CMS to update and to hear that arcade game jingle of joy.
  • Not need a (seemingly) high memory limit.

Screenshots memory limit

Environment details (please complete the following information):

  • Statamic Version v2.11.9
  • Fresh Install or Upgrade: upgrading
  • OS: Linux
  • Browser: Chrome(OS)
  • Web Server: Apache/nginx (Webfaction)
  • PHP Version: 7.2
  • Addons installed: Logbook

wesort avatar Apr 12 '19 11:04 wesort

Wondering if anyone else has experienced this issue or there's something in my environment?

wesort avatar Apr 30 '19 13:04 wesort

How many addons do you have installed?

jackmcdade avatar Jun 27 '19 19:06 jackmcdade

Just two:

  • Logbook
  • SVG Output (and this one is outmoded and unnecessary now anyway not that {s} has native support for svg)

wesort avatar Jun 28 '19 07:06 wesort

I have this issues with recent updates, the update fails even with a memory limit of 1.5GB. Seeing this on Linux and MacOS.

Even with projects with only 1 or 2 addons which have dependencies.

COMPOSER_MEMORY_LIMIT=-1 php please update

Works but nomnomnomnom's your memory

rrelmy avatar Apr 23 '20 13:04 rrelmy

I have this issues with recent updates, the update fails even with a memory limit of 1.5GB. Seeing this on Linux and MacOS.

Even with projects with only 1 or 2 addons which have dependencies.

COMPOSER_MEMORY_LIMIT=-1 php please update

Works but nomnomnomnom's your memory

Thanks for much for this!

JamesS-M avatar May 06 '20 15:05 JamesS-M

Same issue here. Only have to addons with dependencies.

aerni avatar May 20 '20 09:05 aerni

Same here. The -1 memory limit workaround works.

Eworm avatar Jun 03 '20 10:06 Eworm

I have this issues with recent updates, the update fails even with a memory limit of 1.5GB. Seeing this on Linux and MacOS.

Even with projects with only 1 or 2 addons which have dependencies.

COMPOSER_MEMORY_LIMIT=-1 php please update

Works but nomnomnomnom's your memory

This solution works for me.

janejanejane avatar Jul 21 '21 00:07 janejanejane