"Less than 5GB of free space" — not true! 👀

Been running Discourse for years, and my experience has been uniformly awesome except for one recurring problem:

Whenever I see “You are running an old version of the Discourse image” on the update screen, I am overtaken by a grim pallor and an overwhelming sense of dread.

Why?

Because I know I’ll be wrestling my DigitalOcean droplet from the command line—something I generally hate—for a few hours before I can get the upgrade to go through properly.

And this time, I can’t seem to get it working at all :pensive:

As far as I can tell, my free space is being eaten up by the /dev/vda1 directory. But when I investigate this directory, I am getting different feedback depending on the method!

The image below illustrates this oddity. Notice how, in the top portion (which comes from a df -h command), the /dev/vda1 folder appears to have 7.1GB free.

But then notice how the launcher says there is only 4GB free in that same folder!

Does anyone have more insight here?

Specifically, I am looking for advice on why 2 different methods of observing the file return 2 different amounts of free space.

And then I would love to know how to take advantage of the open 7.1GB so I can perform the upgrade.

(For clarification, I am not looking for a lazy response like, “Just upgrade your DO droplet”—if I wanted to double my yearly expenses on this forum, I would have done that already.)

Thank you!

2 Likes

That’s frustrating indeed. You can try

 docker prune

There could be some resources that docker created but forgot about. There was a topic about that recently.

But having space somewhere other than where docker wants it won’t help. It’s possible, but not likely, that launcher is checking in the wrong place.

4 Likes

For this particular rebuild you needed to download a new base image, shown from the WARNING to Status lines in your screenshot. This is large, 2.81GB according to my system, so what you’re seeing is the space lost to that new version of the base image.

# docker images -a
REPOSITORY                 TAG       IMAGE ID       CREATED        SIZE
discourse/base             latest    ab71a5d97460   4 days ago     2.81GB

Using ./launcher cleanup will clear unused containers and images which may reclaim enough space and as @pfaffman said, pruning with docker directly may be able to clear further unused objects, though I personally haven’t seen any significant benefit beyond the containers and images.

Another thing that may help is to clear the apt cache which can become quite large.

apt-get clean
4 Likes

This is precisely what I’m thinking—for this particular update, it looks like you need 5GB + 2.811GB for the new Docker image.

Is this true? Seems like a lot of people would be affected if this were the case…

I’ve tried every pruning/removal/cleanup/doctor command I could find, but the bottom line appears to be that this is not going to work unless there are 7.811GB free on a given machine.

If this is the case, I don’t see how a 25GB DO droplet can still be recommended as a starting condition :woman_shrugging:t5:


Also, here’s an example of the process that is leading me to the above conclusion:

Beginning:

6.9GB free, 72% used

After running ./launcher rebuild app:

3.7GB free, 85% used

I don’t see any other way out of this, but I hope someone else does!

You have 7.1GB free before downloading the discourse container image but less than 5gb after downloading it when we perform the check.

You have two options:

  1. Run ./launcher rebuild app --skip-prereqs to bypass the disk space check

  2. Increase your disk size

If you pick 1 you kick the can down the road, but you will eventually have to deal with disk usage as both your community and Discourse grow over time.

6 Likes

Very helpful! Got 6.8GB reclaimed :+1:

2 Likes

Trying this now, thank you!

Update: It worked!

2 Likes