Your Docker installation is not working correctly - no space left on device - safe to use ./launcher cleanup?

I am getting the Your Docker installation is not working correctly issue after doing ./launcher rebuild app.

The error is docker: failed to register layer: Error processing tar file(exit status 1): write /usr/lib/x86_64-linux-gnu/libx265.a: no space left on device.

…I see one of the common tips on how to fix this is ./launcher cleanup, but before I do I’d like to check so it is safe to use, since I am getting:
WARNING! This will remove all stopped containers.
WARNING! This will remove all images without at least one container associated to them.

Helps? Just want to make sure I don’t delete anything important here.

docker ps -a

docker images

It’s definitely the recommended option:

Though if you want to make sure you have your site up and running before you press the button you can ./launcher start app first.

3 Likes

Running ./launcher start app gives the same error:

docker: failed to register layer: Error processing tar file(exit status 1): write /usr/lib/x86_64-linux-gnu/libx265.a: no space left on device.
See 'docker run --help'.
Your Docker installation is not working correctly

…so I still don’t know the answer to the question: is it safe to use ./launcher cleanup when the site is not up and running?

From the screenshot under ‘docker images’ in the top post it seems there are a lot of older images, but don’t know how to target them specifically for deletion, and whether this would cause any troubles.

df

If the docker container is running, it won’t delete the container. If the container is not running, it’ll delete the container, but you can rebuild a new one with ./launcher rebuild app.

2 Likes

Thank you, but still not super clear to me - Docker is not my strong suit so I don’t know whether deleting and rebuilding a container would mess anything up on my site… Would it be safer to get the app up and running first by clearing out some selective space? Like this:

  1. First clear up some space by targeting a specific image to delete
  2. Then run ./launcher start app
  3. Once the app is up and running: ./launcher cleanup

…not sure if this caution is needed. Perhaps just doing ./launcher cleanup straight up would work fine and not delete anything important even though my app is not running.

But in case you think the above approach could be an option: do you know the command for targeting a specific image to delete (step 1 above)? See my options for which images to delete below.

What I would do is first delete a backup or two? That should give you enough space for things to function.

If you run ./launcher start app then ./launcher cleanup will not delete your image that works, and your site will keep working while the cleanup progresses.

If some somehow make a mistake and delete your image that does work, and you’ve upgraded recenlty, there’s a pretty good chance that you can just do a ./launcher rebuild app and be in good shape.

1 Like

Do you know the command for just deleting a backup or two? Something like ./ launcher cleanup [id of image] perhaps?

I don’t believe ./launcher cleanup removes any backups, just containers that are not in use.

cd /var/discourse/shared/standalone/backups/default
ls 
rm file-to-delete
1 Like

Did

cd /var/discourse/shared/standalone/backups/default
ls 
rm oldest-file

tried ./launcher rebuild app

…failed with memory issue as before

did ./launcher cleanup

Cleaned 4GB

tried ./launcher rebuild app

Got back failed with new errors.

Did ./discourse-doctor, trying to figure out what’s up.

…seems to have solved it?
No clue why though. Would love to understand for next time.

If you got a memory error on the rebuild then I’d add another GB of swap, though that’ll make your disk space issue tighter (It sounds like you’re on a small droplet with 25GB of RAM, which is just barely enough). I’d run a ./launcher cleanup before each rebuild, or maybe you just have a bunch of backups and should move them to S3 ([Configure an S3 compatible object storage provider for uploads](Configure an S3 compatible object storage provider for uploads --you can do just backups, you don’t have to do all of the assets as described there).

The second error was not a memory error, but I could not identify what the new error was: hence the doctor.
Anyways, ./discourse-doctor solved it, would just have loved to know what actually happened.
Thank you for your help!

1 Like

My guess was that you’re conflating RAM (memory) with disk space. The memory error can come and go and the error “error 127” is cryptic and easy to miss.