Prind Broken After Unexpected Shutdown

I use prind to run my 3d printer. I’ve had this happen twice now where I get this error after an unexpected shutdown (like a power outage):

“Moonraker can’t connect to Klipper! Please check if the Klipper service is running and klippy_uds_address is correctly configured in the moonraker.conf”

I looked at moonraker.conf to check the address, and then I exec’d into the klipper and moonraker containers to make sure they could both see the klipper socket. I did a “touch” on a file from one container and could see it in the other container.

I finally started digging around in the docker volumes and figured out I had two volumes in an odd state:

prind3_log

prind3_run (this is the one that contains the klipper socket)

Sidebar here: I had this problem a few months ago and fixed it by reinstalling prind. I ended up reinstalling it in a folder called “prind3” and I was completely flummoxed that the new installation stopped working if I renamed it back to the original “prind” folder name. As you can see, the volume name format is <prind folder>_<container name>. So when I renamed the working installation back to “prind”, it stopped working because it went back to using these broken volumes.

I was not able to delete the volumes using docker volume rm <volume name>–I got an error about it being used by an active container (LIES!)

I was able to delete the volumes from the file system by removing the folders (as root) under:

/var/lib/docker/volumes

However they still showed up when I ran docker ls. I ended up having stop all the container with docker-compose, and then restart the docker service. At this point the phantom volumes were gone, and when I started up Prind everything was working.

This stackoverflow post helped steer me in the right direction for how to remove the phantom volumes. The way I found the phantom volumes was by running:

docker volume rm $(docker volume ls -q --filter dangling=true)

followed by:

docker volume ls -q --filter dangling=true

Which showed a couple remaining volumes, which as I mentioned earlier I wasn’t able to remove without extraordinary measures. There was one casualty here–since prind was not running it clobbered the volume that stored all the gcode files I had uploaded to Moonraker. Not really a loss in my case.