Insufficient Memory Error on Rebuild


I have recently installed Discourse on a 1Gb DigitalOcean droplet (with 2Gb swap file as per the installation instructions), which I’ve been playing with and successfully rebuilding over the past few days.

When I made some changes to the app.yml SMTP login details this morning and tried to rebuild I got the following error:

sudo ./launcher rebuild app
You do not appear to have sufficient memory to run Discourse.


This only happened after I reran git pull this morning, I had to temporarily upgrade my droplet to 2Gb in order to get the rebuild to run successfully.

I’m a relative newcomer to Linux, so is there some trick that I’m missing? I’m not sure why I am struggling now when previously it would rebuild correctly every time.

(Christopher Heald) #2

I just got this message too, on a system that has been running Discourse for several months. What gives?

/var/discourse# ./launcher rebuild app
You do not appear to have sufficient memory to run Discourse.


(Christopher Heald) #3

Rebooted the server to see if this would help. Discourse is running just fine, but rebuild stops with the same insufficient memory warning.

top - 15:18:23 up 3 min,  1 user,  load average: 0.18, 0.15, 0.06
Tasks: 119 total,   2 running, 117 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.0 us,  0.3 sy,  0.0 ni, 98.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   1017880 total,   937336 used,    80544 free,     1472 buffers
KiB Swap:  2097148 total,   117804 used,  1979344 free.    81476 cached Mem

(Mittineague) #4

Only a wild guess at a possible cause of the problem.

Any chance large backup files are included in a rebuild and consuming too much memory?

(Christopher Heald) #5

There at 7 16.8MB backup files. I can delete most of them and see what happens when I try to rebuild.

(Christopher Heald) #6

No luck. And it’s worse than I thought. I can’t even do ./launcher enter app.

FWIW, here’s the output from my first attempt to rebuild Discourse this morning:

# ./launcher rebuild app
Ensuring discourse docker is up to date
Fetching origin
remote: Counting objects: 21, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 21 (delta 9), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (21/21), done.
   449a576..5a90c43  master     -> origin/master
Updating Discourse Docker
Updating 449a576..5a90c43
Fast-forward   | 17 +++++++++++++++++
 Vagrantfile | 34 ++++++++++++++++++++++++++++++++++
 launcher    | 27 +++++++++++++++++++++++++++
 3 files changed, 78 insertions(+)
 create mode 100644 Vagrantfile
You do not appear to have sufficient memory to run Discourse.


(Jeff Atwood) #7

Looks like we’ve introduced some regressions / bugs here @mpalmer can you take a look ASAP?

(Sam Saffron) #8

We reverted the change for now … do a rebuild again

(Christopher Heald) #9

I get the memory warning every time I invoke ./launcher.

Is there any way for me to return launcher and Vagrantfile to a working version?

(Sam Saffron) #10


git pull

Then do a rebuild.

(Christopher Heald) #11

Thank you. That did the trick.


Thanks, that’s working again for me now. :slight_smile:

(Matt Palmer) #13

Ayup, that was me. Sorry about that.

We’ve had a history of people trying to run Discourse on machines that are too small to successfully run Discourse, and the change was attempting to warn people of that issue. As it turns out, I only accounted for the “not already running Discourse” case, and the script (erroneously) detected that the system didn’t have enough memory, because it was only looking at available memory, not total memory.

We’re going to downgrade the errors to warnings, and be less “clever” about what to detect and warn about (total RAM, not available RAM).