Errno::ENOMEM: Cannot allocate memory

I just ran an update and got the following error. Then when I refreshed the page to run it again it showed that the update had already been applied. Any thoughts?

Errno::ENOMEM: Cannot allocate memory - gzip -f -c -7 /var/www/discourse/public/assets/docker-manager-app-5abf141467f1e67d5d860236f75651be.js > /var/www/discourse/public/assets/docker-manager-app-5abf141467f1e67d5d860236f75651be.js.gz
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/lib/tasks/assets.rake:108:in `gzip'
/var/www/discourse/lib/tasks/assets.rake:161:in `block (4 levels) in '
/var/www/discourse/lib/tasks/assets.rake:125:in `call'
/var/www/discourse/lib/tasks/assets.rake:125:in `block in concurrent?'
/var/www/discourse/lib/tasks/assets.rake:152:in `call'
/var/www/discourse/lib/tasks/assets.rake:152:in `block (3 levels) in '
/var/www/discourse/lib/tasks/assets.rake:141:in `each'
/var/www/discourse/lib/tasks/assets.rake:141:in `block (2 levels) in '
/var/www/discourse/lib/tasks/assets.rake:125:in `concurrent?'
/var/www/discourse/lib/tasks/assets.rake:137:in `block in '
3 Likes

Do you have enough ram and swap?

free -m

@SkritterJosh ME TOO!!

2gb droplet - way more than enough. I just saw the update and tried it.

100% same err. Def have enough mem.

@Falco Yes, I do have enough ram and swap.

@dylanh724 I just updated docker and discourse using the terminal and it seemed to work, but using the discourse admin interface it didn’t.

Show us the output of free -m

1 Like

I got exactly the same error. Here’s the output:

Compressing: docker-manager-app-c32d676193f61b3085ec0e77f8d9fca361291a549828d82d1e33c356786f8ca0.js
gzip /var/www/discourse/public/assets/docker-manager-app-c32d676193f61b3085ec0e77f8d9fca361291a549828d82d1e33c356786f8ca0.js
Bundling assets
Compressing Javascript and Generating Source Maps
rake aborted!
Errno::ENOMEM: Cannot allocate memory - gzip -f -c -7 /var/www/discourse/public/assets/docker-manager-app-c32d676193f61b3085ec0e77f8d9fca361291a549828d82d1e33c356786f8ca0.js > /var/www/discourse/public/assets/docker-manager-app-c32d676193f61b3085ec0e77f8d9fca361291a549828d82d1e33c356786f8ca0.js.gz
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/lib/tasks/assets.rake:108:in `gzip'
/var/www/discourse/lib/tasks/assets.rake:149:in `block (2 levels) in '
/var/www/discourse/lib/tasks/assets.rake:130:in `each'
/var/www/discourse/lib/tasks/assets.rake:130:in `block in '
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

And here’s free -m:

root@xyz:~# free -m
             total       used       free     shared    buffers     cached
Mem:          2000       1586        414         36         63        276
-/+ buffers/cache:       1246        754
Swap:            0          0          0
root@xyz:~#

However, now admin/upgrade says that docker_manager is up to date:

docker_manager (9b59950)

Set up a swap!

3 Likes

Thanks. I just did that.

Is it safe to assume that the upgrade went well, then? Or how do I double-check?

1 Like

There is the version on /admin, and the version hash on the page source (CTRL+U) that you can check.

@avorio I’m not sure if it’s safe to assume that. I also experienced the same thing where the upgrade failed, but then later it said everything was up to date. I went ahead and manually updated both docker and discourse. It did appear they still had updates perform and the dashboard was producing a false positive on the update.

Hi @SkritterJosh! Thanks for that.

How do I manually update both docker and discourse, please?

On my particular setup using Ubuntu I ran the following commands to get things updated.

Docker:

apt-get update
apt-get upgrade lxc-docker

Discourse

cd /var/discourse
git pull
./launcher rebuild app

1 Like

see: Install Docker Engine on Ubuntu | Docker Docs

you want docker-engine, lxc-docker should be removed.

3 Likes

I believe lxc-docker can be upgraded to 1.9.1 but no higher.

1 Like

General solution to this error is adding swap, in some cases you may need a bigger swap

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.