فشل ترقية Discourse بسبب عدم كفاية مساحة القرص على قطرة 25 جيجا

I have a 25g droplet, which Discourse claims should be big enough, but I cannot do the upgrade to the latest version as I’ve run out of storage. My forum is very small with very little traffic.

I ran ./launcher cleanup and even deleted old backups, but still no joy.

What can I do?

root@DO-Discourse:/var/discourse# ./launcher rebuild app
x86_64 arch detected.

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

2.0.20220224-2005: Pulling from discourse/base
5eb5b503b376: Pull complete 
35b2f73fc27b: Pull complete 
44526e3ec669: Pull complete 
Digest: sha256:8a8bb9525882220196c0faa8ce95c62a7fb607fc203d4247b3d5985f3ca9c3d8
Status: Downloaded newer image for discourse/base:2.0.20220224-2005
docker.io/discourse/base:2.0.20220224-2005
You have less than 5GB of free space on the disk where /var/lib/docker is located. You will need more space to continue
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   22G  3.0G  88% /

Would you like to attempt to recover space by cleaning docker images and containers in the system? (y/N)y
If the cleanup was successful, you may try again now
root@DO-Discourse:/var/discourse# 
root@DO-Discourse:/var/discourse# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            448M     0  448M   0% /dev
tmpfs            99M  1.1M   98M   2% /run
/dev/vda1        25G   18G  6.2G  75% /
tmpfs           491M     0  491M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           491M     0  491M   0% /sys/fs/cgroup
/dev/vda15      105M  9.2M   96M   9% /boot/efi
overlay          25G   18G  6.2G  75% /var/lib/docker/overlay2/d319d95263d87c2a75a4bc9a9f03a25ea7f6eb1f7bac687e7ae7d45522939dc0/merged
/dev/loop10      56M   56M     0 100% /snap/core18/2284
/dev/loop7       44M   44M     0 100% /snap/snapd/14978
/dev/loop5       62M   62M     0 100% /snap/core20/1361
/dev/loop2       68M   68M     0 100% /snap/lxd/22526
/dev/loop1       62M   62M     0 100% /snap/core20/1376
/dev/loop3       44M   44M     0 100% /snap/snapd/15177
/dev/loop4       56M   56M     0 100% /snap/core18/2344
/dev/loop6       68M   68M     0 100% /snap/lxd/22753
tmpfs            99M     0   99M   0% /run/user/0
root@DO-Discourse:/var/discourse# 

You could try running ./launcher cleanup but if that doesn’t help, you’ll have to add more disk to your server.

إعجاب واحد (1)

You could (but shouldn’t)
./launcher rebuild app --skip-prereqs

As I said earlier, did that already, a few times, actually.
I had read that discourse needs 20 - 30gb ideally. I have 25gb so it’s odd that it should need more. Have the requirements changed?

Not sure what you mean.

I mean short term on a test instance, i did try it (I think it went ok with 4.6Go free) , I wouldn’t on a prod one

sudo apt autoremove --purge maybe?

إعجاب واحد (1)

Also see if you have lots of backups.

إعجاب واحد (1)

Storage requirements depend upon how much media is being uploaded to your discourse instance.

إعجاب واحد (1)

It’s surprising how quickly my DO sandbox site grows as I play around.
If you are having problems now you may just be able to delete enough to get Discourse to upgrade, but next time the database will be a little bigger and you may have more media.
If you do have lots of media moving to S3 storage will free space if not a droplet resize may be your only option.

On DO the AMD droplet is supposed to be way better … not my benchmarks (I read it on the internet :face_with_raised_eyebrow:) - here

إعجاب واحد (1)

Copy that. Where is the amount of storage used shown?

Understood. My database is 60mb and I deleted all the backups.

As I said earlier, deleted all backups. (My DB is only 60mb though so that made no real difference)

إعجاب واحد (1)

root@DO-Discourse:/var/discourse# apt autoremove --purge
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.
root@DO-Discourse:/var/discourse#

Something you can try is to clear the apt cache.

apt clean

You could also try running

du -h -s /* | sort -h -r

to find out where the space is being used. If, for example, the majority is under /usr, you can repeat with

du -h -s /usr/* | sort -h -r

and so on. With any luck, that’ll lead to some big thing(s) that can be cleared but obviously don’t delete anything without an understanding of what it is - i.e. don’t delete anything unless you’re certain it’s safe to do so.

إعجاب واحد (1)

For a quick check, there’s an Uploads amount on your /admin dashboard:

إعجاب واحد (1)

Did my previous command give that info?

root@DO-Discourse:/var/discourse# cd ..
root@DO-Discourse:/var# cd ..
root@DO-Discourse:/# du -h --max-depth=1 -x
13G     ./var
301M    ./boot
5.4M    ./etc
116K    ./tmp
4.0K    ./srv
4.0K    ./home
28K     ./snap
4.0K    ./media
3.3G    ./usr
4.0K    ./mnt
901M    ./root
24K     ./opt
16K     ./lost+found
19G     .
root@DO-Discourse:/#