Errno::ENOMEM: Cannot allocate memory

(Joshua McFarland) #1

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 '

Create a swapfile for your Linux server
(Rafael dos Santos Silva) #2

Do you have enough ram and swap?

free -m

(Dylan Hunt) #3

@SkritterJosh ME TOO!!

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

100% same err. Def have enough mem.

(Joshua McFarland) #4

@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.

(Jeff Atwood) #5

Show us the output of free -m

(Avorio) #6

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

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

docker_manager (9b59950)

(Rafael dos Santos Silva) #7

Set up a swap!

(Avorio) #8

Thanks. I just did that.

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

(Rafael dos Santos Silva) #9

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

(Joshua McFarland) #10

@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.

(Avorio) #11

Hi @SkritterJosh! Thanks for that.

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

(Joshua McFarland) #12

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


apt-get update
apt-get upgrade lxc-docker


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

(Sam Saffron) #13

see: Redirecting…

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

(Jeff Atwood) #14

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