Can't install Discourse with only 10 GB disk, run out of space

I’m trying to set up Discourse via Docker installation on a ovh.com VPS (VPS Classic 1, 10 GB HDD, 1 GB RAM).
Sadly during bootstrapping Discourse at some point I always get no space left on device.

Before bootstrapping I had 8GB free space. This is really a lot. Is there a way to get the bootstrap finished without upgrading to a more expensive plan?

This is the last log:

I, [2015-05-22T18:42:35.120929 #43]  INFO -- : Terminating async processes
I, [2015-05-22T18:42:35.121383 #43]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 113
2015-05-22 18:42:35 UTC [113-2] LOG:  received fast shutdown request
2015-05-22 18:42:35 UTC [113-3] LOG:  aborting any active transactions
2015-05-22 18:42:35 UTC [120-2] LOG:  autovacuum launcher shutting down
I, [2015-05-22T18:42:35.124212 #43]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 236
236:signal-handler (1432320155) Received SIGTERM scheduling shutdown...
2015-05-22 18:42:35 UTC [117-1] LOG:  shutting down
236:M 22 May 18:42:35.333 # User requested shutdown...
236:M 22 May 18:42:35.347 * Saving the final RDB snapshot before exiting.
236:M 22 May 18:42:35.455 * DB saved on disk
236:M 22 May 18:42:35.456 # Redis is now ready to exit, bye bye...
2015-05-22 18:42:35 UTC [117-2] LOG:  database system is shut down
FATA[0056] Error response from daemon: ApplyLayer exit status 1 stdout:  stderr: write /var/www/discourse/tmp/cache/assets/production/sprockets/a3e726f9c4f9dc6b12348792c7793c2b: no space left on device
1 Like

This seems…unlikely. My discourse docker install only takes up 160-some-odd MB.

Can you paste the output of df and du --summ -k /var/www/discourse ?

df:

Filesystem        1K-blocks    Used Available Use% Mounted on
/dev/ploop11744p1  11220208 9382368   1313744  88% /
none               12276996       0  12276996   0% /sys/fs/cgroup
none               12276996      52  12276944   1% /run
none               12276996       0  12276996   0% /run/lock
none               12276996       0  12276996   0% /run/shm
none               12276996       0  12276996   0% /run/user
none               12276996       0  12276996   0% /dev/shm

and there’s no folder like /var/www/discourse (yet)

So, to be clear, you’ve reset from the condition you pasted above, and removed /var/www/discourse?

If that’s the case, then I’m not sure why you think you have 8GB free. df shows that you have 9.3GB used. This does not surprise me. A 10GiB partition is tiny and more or less useless for anything except static sites (IMO).

I just reinstalled the whole system. This is the output of df:

Filesystem        1K-blocks   Used Available Use% Mounted on
/dev/ploop10158p1  11220208 964176   9731936  10% /
none               12276996      0  12276996   0% /sys/fs/cgroup
none               12276996     52  12276944   1% /run
none               12276996      0  12276996   0% /run/lock
none               12276996      0  12276996   0% /run/shm
none               12276996      0  12276996   0% /run/user
none               12276996      0  12276996   0% /dev/shm

I will run ./launcher bootstrap app now which will clog the hdd as seen above.

1 Like

OK, yeah, that really ought to be plenty of room, I would think. But I haven’t watched disk usage DURING the install – all I did was check what it was on an already-installed system. Perhaps the install process produces a lot of detritus that gets cleaned up at the end?

Here is disk space usage after a Docker install on Digital Ocean:

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/vda1       30830588 7049764  22191688  25% /
none                   4       0         4   0% /sys/fs/cgroup
udev              498084       4    498080   1% /dev
tmpfs             101788     348    101440   1% /run
none                5120       0      5120   0% /run/lock
none              508940    1164    507776   1% /run/shm
none              102400       0    102400   0% /run/user

That’s 5.3% of the 30GB drive.

Here’s what a new DO droplet looks like at launch with nothing on it:

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/vda1       30830588 1625676  27615776   6% /
none                   4       0         4   0% /sys/fs/cgroup
udev              498084       4    498080   1% /dev
tmpfs             101788     324    101464   1% /run
none                5120       0      5120   0% /run/lock
none              508940       0    508940   0% /run/shm
none              102400       0    102400   0% /run/user

Subtracting the new droplet state from the installed state, it looks like a Discourse install takes 5,424,088 or 5.4 GB.

(I also forgot that we set up a 2GB swap as a part of the install on a 1GB droplet, so that might mean the Discourse usage is less…)

The 30GB drive goes from 6% used before the install to 25% used after the install.

It’s possible bootstrapping may take more temp disk space as stuff is built, though. The smallest DO instance is 20GB disk space so we we would not have seen an issue.

3 Likes

So, I just redid the bootstrap on my “scratch-monkey” site, and there is a definite “surge” in disk usage during the phase the OP reports the error. Overall, the process of bootstrapping kicked disk usage up a net of +0.7GB, but surged to as much as +1.3GB, even though I already had a site installed!

I may take some time to spin up a 10GB VM and run through the process from scratch. But I guess what it comes down to is that I believe that 10GB may simply be too small, not so much to run Discourse as to bootstrap it.

I’ve installed Discourse on classic1’s with 10GB before. That seems to be your package. Not sure why you’re running out of disk space, that wasn’t an issue in my testing.

Which OS did you choose? I had to choose Docker on Ubuntu 14.04 Server (64 bits) because of the old kernel.

Fresh VM, 10GB disk, 2048GB RAM, 2CPUs, Ubuntu 15.04 (it was an ISO I had handy). Of course, this is a GUI installation, so there’s more disk space in use than there would be on a pure server install.

After first post-install boot:

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1        8124856 3669648   4019448  48% /

After the wget phase:

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1        8124856 3688048   4001048  48% /

Not much change. The clone doesn’t add much more, either:

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1        8124856 3688952   4000144  48% /

Around the time Docker is done pulling its base:

/dev/sda1        8124856 4989052   2700044  65% /

After bundle

/dev/sda1        8124856 5615836   2073260  74% /

After assets

/dev/sda1        8124856 5800184   1888912  76% /

Then there’s a stage after 2015-05-22 21:24:15 UTC [75-2] LOG: database system is shut down, when you can see a surge in storage – it went up to 81%

/dev/sda1        8124856 6169208   1519888  81% /

But when bootstrap was done:

/dev/sda1        8124856 5817308   1871788  76% /

Bottom line…I don’t know why @hedgehog’s disk is filling up, but this really should work in 10GB, actually!

3 Likes

Thanks for all the hard work, guys.

These are the current results:

 time="2015-05-22T23:08:23+02:00" level=fatal msg="Error response from daemon: Untar exit status 1 write /usr/lib/git-core/git-sh-i18n--envsubst: no space left on device"
Your Docker installation is not working correctly

See: https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam
root@vps169825:/var/discourse# 2015 May 22 23:08:46 vps169825 fatal: Read from socket failed: Connection reset by peer [preauth]
2015 May 22 23:10:16 vps169825 fatal: Read from socket failed: Connection reset by peer [preauth]
2015 May 22 23:29:52 vps169825 fatal: Read from socket failed: Connection reset by peer [preauth]
^C
root@vps169825:/var/discourse# df
Filesystem        1K-blocks     Used Available Use% Mounted on
/dev/ploop10158p1  11220208 11203728         0 100% /
none               12276996        0  12276996   0% /sys/fs/cgroup
none               12276996       52  12276944   1% /run
none               12276996        0  12276996   0% /run/lock
none               12276996        0  12276996   0% /run/shm
none               12276996        0  12276996   0% /run/user
none               12276996        0  12276996   0% /dev/shm

@hedgehog This is a VPS Classic 1, yes? 10GB disk, 1GiB RAM? Did you add a swapfile? If so, how large?

Yes, it is VPS Classic 1 with 10 GB disk and 1 GB RAM.
You can’t add a swapfile to their VPS because they’re OpenVZ-based.

Hm…then I’m at a bit of a loss for what might be devouring the extra disk space. You’re starting out with LESS disk space filled than I did in my VM, but my install completed…

Just for kicks, I’m going to try again, scaling the machine more closely to the VPS Classic 1 specs (only 1 CPU, only 1 GiB of RAM). I’m not sure why RAM and CPU would make a difference in this situation, but it’s worth a try, and doesn’t take that long to set up.

OK, trying again with a 2GB RAM droplet so I don’t need a swapfile.

After basic OS provisioning (Ubuntu 14.04 LTS):

/dev/vda1          40188  1592     36532   5%

After installing docker / git / OS updates via get.docker.io:

/dev/vda1          40188  1651     36474   5%

After cloning git repo

/dev/vda1          40188  1652     36473   5%

After bootstrap

/dev/vda1          40188  3660     34464  10%

After starting the container

/dev/vda1          40188  3642     34483  10%

So 1592 - 3642 = 2050 or around 2GB. I would call it 5GB to be safe?

(One thing I am not sure about, during bootstrap disk usage may spike, so you may need more than that.)

That should fit on a 10GB instance, but you will be in trouble without swap on a 1GB RAM system anyway…

1 Like

See post below, docker is now supported on newer openvz kernels.

10GB disk, 1GB RAM, 1CPU, 15.04, no swap:

After wget:

/dev/sda1        9156984 3715188   4953604  43% /

After discourse_docker clone:

/dev/sda1        9156984 3716092   4952700  43% /

After docker base:

/dev/sda1        9156984 5016224   3652568  58% /

After bundle

/dev/sda1        9156984 5621652   3047140  65% /

After assets

/dev/sda1        9156984 5737528   2931264  67% /

Peak during surge

/dev/sda1        9156984 6412816   2255976  74% /

After bootstrap:

/dev/sda1        9156984 5756740   2912052  67% /

So, yeah, this definitely works fine under the limitations described in an environment other than the actual VPS Classic 1 offering from OVH. Without starting my own instance there, however, I don’t think I could easily diagnose why this should be the case.

2 Likes

Sorry on the road, but you’re limited to the host kernel on openvz, so even if you pick ubuntu 14.04 it’s really not the same thing. Curious you even got docker to install, but I bet your issue is with the old kernel and incorrectly showing up as a disk space limitation.