Introduction
Looking at my grafana dashboard this morning I was seeing tens of failed jobs. I thought this was another hetzner maintenance job that locked my S3 storage by breaking halfway through. To my surprise garage was healthy and none of the buckets were locked. My attention turned to the next potential culprit: rook-ceph. I hopped onto the toolbox to check on the health of the ceph cluster but that wasn’t the problem either. All pods in the rook-ceph namespace were running as if there was no problem at all.
This is a debugging story about Ceph and a Unix socket that nobody was listening on.
How Kubernetes mounts storage
Kubernetes doesn’t know how to talk to Ceph, NFS or any other storage system. It delegates that to plugins that implement the Container Storage Interface (CSI). From “I need storage” to “the pod is running with a disk”, the process looks like this:
- A PVC is created. Something in the cluster (a Helm chart, a StatefulSet, a Deployment) asks for a volume of a given StorageClass.
- The controller plugin creates the volume. It talks to the storage backend (here Ceph) and creates the actual volume. This happens once, somewhere in the cluster, and doesn’t involve any particular node.
- The pod is scheduled onto a node. The scheduler picks a node, and from here on the work is node-local.
- The kubelet on that node asks the node plugin to mount the volume. The node plugin attaches or mounts the volume on the host and makes it available at the path the pod will use.
- The kubelet starts the pod’s containers. Only now does the pod leave
ContainerCreatingorPodInitializing.
If step 4 fails, the pod waits forever which is exactly the status of our backup pods.
The three players
- The kubelet is the agent on every node that actually runs pods. It doesn’t know any storage protocol itself. When a pod needs a volume, it calls the CSI driver installed on that node.
- The controller plugin handles the cluster-wide side: creating and deleting volumes, snapshots, resizing. It runs as a normal Deployment and never touches a specific node’s mounts.
- The node plugin handles the node-local side: mounting the volume on the host and into the pod. It runs on every node as a DaemonSet. It is typically made of two containers:
- The driver container (here
csi-cephfsplugin) does the real work of mounting. - The
driver-registrarsidecar introduces the driver to the kubelet. At startup it tells the kubelet “a CSI driver namedrook-ceph.cephfs.csi.ceph.comlives on this node.” Until that registration succeeds, the kubelet doesn’t know the driver exists and refuses to mount anything with it.
- The driver container (here
How they talk: Unix sockets
All of this communication happens locally on the node, over Unix domain sockets: special files that two processes use to talk to each other without a network.
- The kubelet talks to the driver through a socket,
csi.sock. - The registrar uses a second socket to register the driver with the kubelet.
One thing to keep in mind is that a socket file and a listener are not the same thing. The file can exist on disk while the process that should answer on it is dead or stuck.
lswill still show a perfectly normal socket, but every attempt to connect fails or times out. The file proves nothing about whether anyone is home.
Symptoms
An hourly backup Job (restic reading a CephFS-backed PVC) had been stuck in PodInitializing for three days. The only clue was a repeated event:
MountVolume.MountDevice failed for volume "pvc-82c4…" : rpc error: code = Unavailable
desc = connection error: desc = "error reading server preface:
raw-read unix @->//csi/csi.sock: use of closed network connection"
The retry count (x1969 over 3d5h) showed this wasn’t a blip.
The misleading signals
- The node plugin pods were
2/2 Running. - The
csinodeobject listed the CephFS driver. kubectl logs --previousshowed a crash, but from 25 days earlier: the plugin had failed to reach the API server at10.233.0.1:443(an i/o timeout) and restarted, then stayed up. So everything looked fine, and the evidence pointed at a month-old event.
What the kubelet log showed
Reading the kubelet journal on the node revealed the real picture:
- Every CephFS mount failed with
driver name rook-ceph.cephfs.csi.ceph.com not found in the list of registered CSI drivers. That affected the backup job and also paperless, authentik and netbox pods scheduled on that node. - The kubelet kept trying to register the plugin and got
connection refusedon the registration socket. - The
driver-registrarcontainer was in CrashLoopBackOff, hidden because the pod-level status still looked healthy at a glance.
1
2
3
4
5
root@coreos-cp-2:/var/home/core# journalctl -u kubelet --since "10 min ago" --no-pager
Nov 23 10:41:12 coreos-cp-2 kubelet[3020723]: E1123 10:41:12.735569 3020723 nestedpendingoperations.go:348] Operation for "{volumeName:kubernetes.io/csi/rook-ceph.cephfs.csi.ceph.com^0001-0009-rook-ceph-0000000000000001-e03cf7a7-f3c3-4c1f-880b-4c5390b18b3d podName: nodeName:}" failed. No retries permitted until 2026-11-23 10:42:16.735535499 +0100 CET m=+150.079513857 (durationBeforeRetry 1m4s). Error: MountVolume.MountDevice failed for volume "pvc-74a296b1-8475-431a-a39f-7e3f41809180" (UniqueName: "kubernetes.io/csi/rook-ceph.cephfs.csi.ceph.com^0001-0009-rook-ceph-0000000000000001-e03cf7a7-f3c3-4c1f-880b-4c5390b18b3d") pod "paperless-paperless-ngx-57975f694f-zv5jc" (UID: "fc98a8fb-74e2-4f39-b334-84ee3149519a") : kubernetes.io/csi: attacher.MountDevice failed to create newCsiDriverClient: driver name rook-ceph.cephfs.csi.ceph.com not found in the list of registered CSI drivers
(...)
Nov 23 10:41:14 coreos-cp-2 kubelet[3020723]: I1123 10:41:14.138124 3020723 reconciler_common.go:299] "Volume detached for volume \"kube-api-access-brdx7\" (UniqueName: \"kubernetes.io/projected/78e61975-b014-48c7-983e-2dfe6fb634ae-kube-api-access-brdx7\") on node \"coreos-cp-2\" DevicePath \"\""
Nov 23 10:41:14 coreos-cp-2 kubelet[3020723]: E1123 10:41:14.185453 3020723 goroutinemap.go:150] Operation for "/var/lib/kubelet/plugins_registry/rook-ceph.cephfs.csi.ceph.com-reg.sock" failed. No retries permitted until 2026-11-23 10:41:30.185386508 +0100 CET m=+103.529364909 (durationBeforeRetry 16s).
The root cause
crictl logs on the exited registrar container gave the final answer:
1
2
"Lost connection" address="unix:///csi/csi.sock" (repeated for 30 s)
"Error connecting to CSI driver" err="context deadline exceeded"
The registrar could not talk to the driver container’s socket. Meanwhile:
csi.sockexisted, with a timestamp from the Oct 29 restart.- The driver container showed
Running, but its log had no activity since Oct 29. A healthy node plugin logs on every stage and publish call. - The RBD node plugin on the same node was healthy.
So
csi-cephfspluginwas alive as a process but no longer serving gRPC on its socket. The file was a leftover from container start, and nothing was answering behind it. Every consumer of that socket failed in its own way:
| Component | What it saw |
|---|---|
driver-registrar |
Lost connection, then exit 1 after 30 s |
| kubelet (registration) | connection refused on …-reg.sock |
| kubelet (mounts) | driver name … not found in the list of registered CSI drivers |
| Pod events | use of closed network connection |
What can’t be said for certain is why the driver wedged. The timeline suggests the Oct 29 API-server timeout (a networking hiccup on that node) triggered a restart, and the new container never got back into a serving state. The driver would have kept running unnoticed because nothing needed it until a CephFS volume was next mounted on that node. That’s why the failure appeared weeks later, when a new Job pod landed there.
Restart the plugin pod
Recreating the pod gives fresh containers, a fresh socket, and a reset CrashLoop backoff:
1
kubectl -n rook-ceph delete pod rook-ceph.cephfs.csi.ceph.com-nodeplugin-bm4cz --force
Existing CephFS mounts are not affected. With --forcecephkernelclient=true they’re kernel mounts, which survive a plugin restart.
Verify
1
2
kubectl -n rook-ceph get pods -w | grep cephfs.csi.*nodeplugin
kubectl -n rook-ceph logs -f <new-pod> -c driver-registrar
1
2
3
4
5
6
7
8
root@coreos-cp-2:/var/home/core# kubectl -n rook-ceph logs -f rook-ceph.cephfs.csi.ceph.com-nodeplugin-wwdxd -c driver-registrar
I1123 09:49:19.247948 1 main.go:145] "Version" version="v2.17.0"
I1123 09:49:19.248281 1 main.go:146] "Running node-driver-registrar" mode=""
E1123 09:49:21.252887 1 connection.go:208] "Lost connection" address="unix:///csi/csi.sock"
I1123 09:49:21.276926 1 node_register.go:56] "Starting Registration Server" socketPath="/registration/rook-ceph.cephfs.csi.ceph.com-reg.sock"
I1123 09:49:21.277842 1 node_register.go:66] "Registration Server started" socketPath="/registration/rook-ceph.cephfs.csi.ceph.com-reg.sock"
I1123 09:49:21.278356 1 node_register.go:96] "Skipping HTTP server"
I1123 09:50:02.686444 1 main.go:102] "Received NotifyRegistrationStatus call" status="plugin_registered:true"
You want to see plugin_registered:true from the registrar. Stuck pods then pick up their mounts on the next kubelet retry (the backoff had grown to about two minutes). Deleting them skips the wait.
Conclusion
Lessons learned
2/2 Runningis not health. A sidecar can sit in CrashLoopBackOff while the pod looks fine, and a driver can be alive but not serving. Check per-container restart counts andcrictl ps -a.- A socket file doesn’t prove a listener. If clients get
connection refusedor timeouts on a socket that exists, suspect the process behind it. - Read the kubelet journal early.
journalctl -u kubelet | grep -iE 'csi|registr'showed the registration failure directly. The pod events only showed a downstream symptom. - Failures here are latent. The plugin broke weeks before any workload needed it. Alert on CSI node plugin containers that are unready or restarting, and on kubelet “not found in the list of registered CSI drivers” errors.