The user is unable to stop or start Discourse containers due to insufficient disk space, despite having ample storage in a RAID 1 setup. The issue stems from the / partition being nearly full, while /home has plenty of space. The launcher cleanup command fails to free space because there are no unused containers or images to remove. The user has two running Discourse apps, and Docker images are stored in /var/lib/docker, which is on the full partition. The community suggests relocating Docker’s data directory to /home via bind mounting or adjusting the partition layout, but the user cannot reinstall the system. A workaround to stop the containers without prerequisites is suggested Falco, while the user seeks safe ways to manage the containers without causing damage.
Recently i’ve ran into a problem, I am running 2 discourse forums, and I want to edit one, because its in an infinite redirect loop that I can only fix via discourse config, but can’t because I can’t stop the container. I don’t want to force it using kill or something, as that would possibly cause issues.
I ran the command ./launcher cleanup however, it does not free up any space. Any command using start/stop will not work, it just says it doesn’t have enough so it can’t continue.
The server has 2x2TB harddrives in raid 1, so space isn’t a problem in general.
You have less than 5GB of free space on the disk. You will need more space to continue
Would you like to attempt to recover space by cleaning docker images and containers in the system?(y/N)n
root@REDACTED:/home/discourse# apt-get clean
root@REDACTED:/home/discourse# ./launcher rebuild app
You have less than 5GB of free space on the disk. You will need more space to continue
Would you like to attempt to recover space by cleaning docker images and containers in the system?(y/N)
Then the next step it asks to confirm, and I input yes, then gives me this output
Would you like to attempt to recover space by cleaning docker images and containers in the system?(y/N)y
WARNING! This will remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling images
Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
If the cleanup was successful, you may try again now
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5c7e37e4f1bb local_discourse/app1 "/sbin/boot" 3 months ago Up 9 days 0.0.0.0:redacted->80/tcp, 0.0.0.0:redacted->443/tcp app1
3e83e4a36695 local_discourse/app2 "/sbin/boot" 4 months ago Up 9 days 0.0.0.0:redacted->80/tcp, 0.0.0.0:redacted->443/tcp app2
… which you allocated almost all of to /home. So, short of bind-mounting /var/lib/docker and /var/discourse into there, you’re always going to be very short of space. You might want to consider reinstalling the machine with a saner partitioning scheme.
Yeah, it was default layout for the install, I am not even sure if I can install it differently ,and its probably too late at this point, I have too much other applications setup on it. I moved discourse to /home anyway (or the shared data, and container config, etc) so it didn’t use up the root partition.
Is it possible to just move docker images to /home? I really can’t reinstall the server right now.
Docker images live under /var/lib/docker; there’s probably a way to change where docker stores all its stuff, otherwise the aforementioned bind mounting should probably work.
Well what should I do with the containers if I can’t stop them? what damage would killing them do? or perhaps is there another way I can stop it safely?