Error running composer update command

I’ve been trying to update from 2.3.0 -> 2.3.2 using the CLI. The process doesn’t last long as I get:

Loading composer repositories with package information
Updating dependencies (including require-dev)

Error when running the composer update command. I’ve read that this could be a lack of memory problem and to do the update on my local files and then upload the composer.lock to my server?

I’ll be honest and say I’m not too sure of what to do exactly and if this is good advice for me to try next and can’t seem to find the relevant advice online.

Could anyone point me in the direction of some instructions on how to update the local magento files?

Hi @eddieMagento and welcome.

I can’t say I’ve ran into this problem (not that I recall anyway). However, I did run into a problem 2-3 years ago when running composer. If memory serves, it turned out to be a lack of system resources. The server I was using didn’t have enough memory. So, I upgraded to a server with 2GB memory and the issue went away. Ever since then I’ve never ran a server with less than 2GB.

Again, not sure if it’s related but worth a look. Failing that, you might want to ask over on The community there will have more advice to offer as this question is a bit outside our Magento niche here.

Edit: This post seems to talk about your issue and confirms my suspicion. The solutions talk about options like doing the whole “swap” thing… But honestly it’s not really a “solution” as it is a “workaround”. Just upgrade your servers memory. No need to over-engineer a solution to a simple problem.

1 Like

Thanks for the reply,

My server is 2GB but on closer inspection I’m using 1.28GB on my Magento 2 installation. Most of it is the composer.lock file 659.8KB and 424.74KB is this normal? If it is do I need 2GB free memory so for me anything above 3.28GB?

When I say ‘memory’, I mean it in the technical term (aka RAM). I’m not referring to Hard Disk Space.

Memory requirement
Upgrading the Magento applications and extensions you obtain from Magento Marketplaces and other sources can require up to 2GB of RAM. If you are using a system with less than 2GB of RAM, we recommend you create a swap file; otherwise, your upgrade might fail. - Magento 2 Official Documentation

As for Hard Disk Space, my Sandback server that I use to make tutorials takes nearly 3GB of Hard Disk space.

To summarise, my absolute minimum Server Spec Recommendations would be:

  • Hard Disk Space: 4GB
  • Memory (RAM): 2GB

As you’re already starting to experience, running Magento 2 on a sub-par machine isn’t worth the headache.

1 Like

Increasing the size of the swap file has worked for me in the past:

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=2M count=2048
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1