Less than 5GB of disk space, can't upgrade Discourse

Dear All,

I have an existing installation of discourse however i did not upgrade last few releases. Its hosted by digital ocean. This mornng when i tried to upgrade through manual, i am getting the following error. Please can you guide as what step i should take to upgrade this.

Cheers,
Muhammad

Run it again and say Yes. Your data won’t be touched, only old docker images will be removed.

1 Like

Thanks. I did that but it does not seem working. Please see this snapshot. Sorry I forgot to attach this earlier. Thanks in advance

use either du -sh * and drill down into the large directories or ncdu if you have that package available, and try to figure out where exactly your space has gone

if it is user content you will probably have to increase diskspace on your server, but a common problem on servers that run docker for a while is that the default json logging engine never rotates the logs

[root@discocent discourse]# cd /var/lib/docker/containers/
[root@discocent containers]# du -sh *
5.1M	86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f
36K	cecf3b8565bce6156c61f61b27af425d0f956b8ce439f2519300ebfdc7bb4cf9
[root@discocent containers]# cd 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f/
[root@discocent 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f]# ls -lh
total 5.1M
-rw-r-----. 1 root root 5.0M Jan 16 10:07 86981cd18ab1d8e95e502bf08a1fdc949030cddc29079b53a8e17b2c6a98ba6f-json.log

that’s 5M of log for my idle test instance after a couple days, an active server will be larger. if you run other containers they might be logging even more.

You can configure docker to handle log rotation, check out Configure logging drivers | Docker Documentation …not sure why it’s not the default.

1 Like

Hi @ssvenn

Many thanks. this is much appreciated. I have run the commands and i can see the following statistics. Would you mind to advise, how does this look like as I am unable to interpret I am afraid. Thanks in advance.

Sorry here is the lastest one please.

I have been surprised to see the occupied space. As we have very minimal activty on our forum. Thanks

ok, that’s not your problem then. Only one container and only 0.5MB of logs.

if you run du -sh * again in the / top directory maybe you will get a better picture of where the space has gone. I highly recommend ncdu to make it easier ( NCurses Disk Usage )

on my test instance docker uses about 8GB on images, check out Prune unused Docker objects | Docker Documentation for help on how to clean that up.

docker image prune -a usually frees up a lot of space for me, you might have to docker rm app to delete your old Discourse app container first. If you have lots of forum backups maybe you could download them to your local machine to free up some additional space.

another thing you should check is docker ps -a to see if you have any unexpected containers. Sometimes a failed rebuild will leave a dangling container that you have to remove manually.

[root@discocent /]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                  PORTS               NAMES
86981cd18ab1        da251a932851        "/bin/bash -c 'cp -r…"   4 days ago          Exited (0) 4 days ago                       festive_margulis
[root@discocent /]# docker rm festive_margulis
festive_margulis
[root@discocent /]# docker image prune -a
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
deleted: sha256:da251a9328516f691f0fc3bcdd685e218fa075ae744766996a25b7fe0008b4fc
deleted: sha256:3adfc688f9c999f5f08caae668a722c273311c3f84da33161bf23184218fa74b
deleted: sha256:ea31cd77735ab3d86f3d8903425d4157320b7047a07da4555a4752614c6e5265
deleted: sha256:b375a11cf89e3f124f9151688c2952ef8ca45f5ab5f2bd0751ea3f617708df87
deleted: sha256:cce92fda689ab9033f0b8db214bc63edd1ae3e05831a0f3a9418976d7dc7ccdd
deleted: sha256:d22094bbd65447c59a42c580eaa3a44cee9cd855f00905f59409be21bcefc745
deleted: sha256:b8976847450013f3eb5e9a81a5778f73ed7bef67e6393049712ef17102b4b7b7
deleted: sha256:b8c891f0ffec910a12757d733b178e3f62d81dbbde2b31d3b754071c416108ed

Total reclaimed space: 2.33GB

Have you checked your backups? It’s quite easy for them to fill your disk.

2 Likes

Hey @pfaffman Quick question related to this. I faced the same issue, so I ran du -sh *. None of the file exceeds 1MB.

So I didn’t remove.

but I tried docker image “prune -a”, reclaimed space: 0B.

Anything else I should do?
My issue is related to the latest upgrade I made that lead to app shutdown.

Did you check /var/discourse/shared/standalone/backups/default? That’s the most likely culprit.

I’m working on a new product at https://www.pfaffmanager.com/. If you’ll log in there, click the server list button at the top and then the Free! Manage existing server button and then configure it for your server as (I hope that) it suggests, I’ll figure it out for you.

2 Likes

Thanks Man, Yes i checked the backups. Totally 5 Files * 16M. That’s small ya?

Also I ran this


==================== MEMORY INFORMATION ====================
RAM (MB): 1002

              total        used        free      shared  buff/cache   available
Mem:            978         692          68          33         216         110
Swap:          2047         242        1805

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       12G   11G  848M  93% /

---------- Container Disk Space ----------
Filesystem      Size  Used Avail Use% Mounted on
overlay          12G   11G  848M  93% /
/dev/xvda1       12G   11G  848M  93% /shared
/dev/xvda1       12G   11G  848M  93% /var/log


Am trying your suggestion now the new product.

Oh. You have only 12G. That’s not enough. I recommend a minimum of 25, but really like 50.

1 Like

Ok got it. Few minutes back, Increased the volume to 30, might be it still optimising
image

btw, am confused with the UI in your product but also felt sudden interest how you are going to debug from there. hahaha. Messaging you in PM to avoid any rules breaking here.

2 Likes