mountpoint-s3-csi-driver: Driver crashes unexpectedly with `Failed to read /host/proc/mounts` requiring pod restart

/kind bug

NOTE: If this is a filesystem related bug, please take a look at the Mountpoint repo to submit a bug report

What happened? Periodically without warning one of my s3 mountpoint driver pods will crash with GRPC errors until I delete it. It will usually cause a dependent pod to fail to start. The replacement immediately after this pod’s deletion works fine, but requires manual intervention after noticing dependent pod crashes due to missing pv.

What you expected to happen? Error not to occur.

How to reproduce it (as minimally and precisely as possible)? Unclear.

Anything else we need to know?: Logs

I1104 11:59:40.249998       1 credential.go:95] NodePublishVolume: Using driver identity
I1104 11:59:40.250015       1 node.go:146] NodePublishVolume: mounting d-cluster at /var/lib/kubelet/pods/97e71fea-b356-4d87-a086-5f06fe651ea7/volumes/kubernetes.io~csi/s3-pv/mount with options [--allow-delete --allow-other --gid=100 --uid=1000]
E1104 11:59:40.250106       1 mount.go:214] Failed to read /host/proc/mounts on try 1: open /host/proc/mounts: invalid argument
E1104 11:59:40.250106       1 mount.go:214] Failed to read /host/proc/mounts on try 1: open /host/proc/mounts: invalid argument
E1104 11:59:40.250106       1 mount.go:214] Failed to read /host/proc/mounts on try 1: open /host/proc/mounts: invalid argument
E1104 11:59:40.250106       1 mount.go:214] Failed to read /host/proc/mounts on try 1: open /host/proc/mounts: invalid argument
E1104 11:59:40.350345       1 mount.go:214] Failed to read /host/proc/mounts on try 2: open /host/proc/mounts: invalid argument
E1104 11:59:40.350345       1 mount.go:214] Failed to read /host/proc/mounts on try 2: open /host/proc/mounts: invalid argument
E1104 11:59:40.350345       1 mount.go:214] Failed to read /host/proc/mounts on
try 2: open /host/proc/mounts: invalid argument
E1104 11:59:40.350345       1 mount.go:214] Failed to read /host/proc/mounts on try 2: open /host/proc/mounts: invalid argument
E1104 11:59:40.450642       1 mount.go:214] Failed to read /host/proc/mounts on try 3: open /host/proc/mounts: invalid argument
E1104 11:59:40.450642       1 mount.go:214] Failed to read /host/proc/mounts on try 3: open /host/proc/mounts: invalid argument
E1104 11:59:40.450642       1 mount.go:214] Failed to read /host/proc/mounts on try 3: open /host/proc/mounts: invalid argument
E1104 11:59:40.450642       1 mount.go:214] Failed to read /host/proc/mounts on try 3: open /host/proc/mounts: invalid argument
E1104 11:59:40.550806       1 driver.go:136] GRPC error: rpc error: code = Internal desc = Could not mount "d-cluster" at "/var/lib/kubelet/pods/97e71fea-b35
6-4d87-a086-5f06fe651ea7/volumes/kubernetes.io~csi/s3-pv/mount": Could not check if "/var/lib/kubelet/pods/97e71fea-b356-4d87-a086-5f06fe651ea7/volumes/kubernetes.io~csi/s3-pv/mount" is a mount point: stat /var/lib/kubelet/pods/97e71fea-b356-4d87-a086-5f06fe651ea7/volumes/kubernetes.io~csi/s3-pv/mount: no such file or directory, Failed to read /host/proc/mounts after 3 tries: open /host/proc/mounts: invalid argument

Environment

  • Kubernetes version (use kubectl version): Client Version: v1.31.1 Server Version: v1.30.5-eks-ce1d5eb

  • Driver version: v1.9.0 Installation of s3 mountpoint driver is through eksctl, i.e. eksctl create addon aws-mountpoint-s3-csi-driver

Was directed by @muddyfish to file this issue here: https://github.com/awslabs/mountpoint-s3-csi-driver/issues/174#issuecomment-2443935264

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

We’ve confirmed the fix on both regular pre-provisioned nodes (it was reproduceable by restarting containerd) and also dynamically spawned GPU nodes with Karpenter using https://github.com/aws-samples/comfyui-on-eks multiple times.

We’re hoping that this will solve the issue for others too, we’ll be sharing here once we release this fix.

We were able to reproduce the issue by using https://github.com/aws-samples/comfyui-on-eks thanks to @Shellmode’s suggestion. We have a potential fix with https://github.com/awslabs/mountpoint-s3-csi-driver/pull/321, we’re working on verifying if this indeed solves the problem.


We’re using hostPath mount for /proc/mounts from the host to find mounts on the host (because Mountpoint processes run on the host using systemd currently, we aim to improve this with https://github.com/awslabs/mountpoint-s3-csi-driver/issues/279). Since /proc/mounts is a symlink for /proc/self/mounts and containerd resolves symlinks for each mount, /host/proc/mounts inside our Pod basically becomes a link to containerd process’ /proc/mounts:

$ cat /proc/`pgrep -f aws-s3-csi-driver`/mountinfo | grep /host/proc/mounts
632 546 0:19 /1657/mounts /host/proc/mounts rw,nosuid,nodev,noexec,relatime - proc proc rw
$ ps -p 1657
    PID TTY          TIME CMD
   1657 ?        00:00:12 containerd

and if containerd process restarts, our /host/proc/mounts basically refers to a non-existent path, and it results EINVAL (invalid argument) if you try to open /host/proc/mounts:

$ cat /proc/`pgrep -f aws-s3-csi-driver`/root/host/proc/mounts > /dev/null # it currently works
$ service containerd restart # restart containerd service
$ cat /proc/`pgrep -f aws-s3-csi-driver`/root/host/proc/mounts > /dev/null # now it fails
cat: /proc/13065/root/host/proc/mounts: Invalid argument
$ ps aux | grep containerd # because containerd got a new pid 13767
root       13767  1.3  1.5 1896628 58808 ?       Ssl  18:08   0:00 /usr/bin/containerd
$ cat /proc/`pgrep -f aws-s3-csi-driver`/mountinfo | grep /host/proc/mounts # but our mount still refers to old pid 8985
1033 1001 0:19 /8985/mounts /host/proc/mounts rw,nosuid,nodev,noexec,relatime - proc proc rw

and the reason this happens more frequently with Karpenter/GPU nodes is that, NVIDIA’s container toolkit sends SIGHUP signal to containerd during its setup, and it causes containerd to restart. See https://github.com/NVIDIA/gpu-operator/issues/991

v1.12.0 of our Helm chart has been released with the fix. We’re working on our EKS add-on v1.12.0 release as well and will share here once its completed.

Thanks for the reports @John-Funcity @fatihmete. Would you be able to share any log that might be relevant from dmesg? Also, could you try accessing /proc/mounts in the host to see if that works for you?