kubernetes: ConfigMap SubPath Volume Mount failed on `util-linux=2.41`

What happened?

Mount command executes failed when creating a Pod using ConfigMap SubPath volume after upgrading util-linux to 2.41.

kubectl describe pod Events:

Error: failed to generate container "ddcc1d587faca0a37bc7ee0bf46abbf7ce009c31a838f00f7a2a640667b713da" spec: failed to generate spec: failed to mkdir "/var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0": mkdir /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0: file exists

journalctl -u k3s:

Mar 22 14:22:06 archlinux k3s[6466]: Unmounting arguments: /var/lib/kubelet/pods/bf088366-22fe-495e-a0f3-f78aeece8cbf/volume-subpaths/config/demo/0
Mar 22 14:22:06 archlinux k3s[6466]: Output: umount: can't unmount /var/lib/kubelet/pods/bf088366-22fe-495e-a0f3-f78aeece8cbf/volume-subpaths/config/demo/0: Permission denied
Mar 22 14:22:07 archlinux k3s[6466]: E0322 14:22:07.978619    6466 pod_workers.go:1301] "Error syncing pod, skipping" err="failed to \"StartContainer\" for \"demo\" with ImagePullBackOff: \"Back-off pulling image \\\"alpine\\\"\"" pod="default/test" pod>
Mar 22 14:22:32 archlinux k3s[6466]: E0322 14:22:32.833710    6466 mount_linux.go:282] Mount failed: exit status 32
Mar 22 14:22:32 archlinux k3s[6466]: Mounting command: mount
Mar 22 14:22:32 archlinux k3s[6466]: Mounting arguments: --no-canonicalize -o bind /proc/6466/fd/274 /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0
Mar 22 14:22:32 archlinux k3s[6466]: Output: mount: /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0: move_mount() failed: No such file or directory.
Mar 22 14:22:32 archlinux k3s[6466]:        dmesg(1) may have more information after failed mount system call.
Mar 22 14:22:32 archlinux k3s[6466]: E0322 14:22:32.834019    6466 subpath_linux.go:219] Failed to clean subpath "/var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0": error cleaning subpath mount /var/lib/kubelet/po>
Mar 22 14:22:32 archlinux k3s[6466]: E0322 14:22:32.834070    6466 kubelet_pods.go:349] "Failed to prepare subPath for volumeMount of the container" err=<
Mar 22 14:22:32 archlinux k3s[6466]:         error mounting /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volumes/kubernetes.io~configmap/config/..2025_03_22_14_20_59.1325584633/test.conf: mount failed: exit status 32
Mar 22 14:22:32 archlinux k3s[6466]:         Mounting command: mount
Mar 22 14:22:32 archlinux k3s[6466]:         Mounting arguments: --no-canonicalize -o bind /proc/6466/fd/274 /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0
Mar 22 14:22:32 archlinux k3s[6466]:         Output: mount: /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0: move_mount() failed: No such file or directory.
Mar 22 14:22:32 archlinux k3s[6466]:                dmesg(1) may have more information after failed mount system call.
Mar 22 14:22:32 archlinux k3s[6466]:  > containerName="demo" volumeMountName="config"

The dmesg does not show any error messages related to the mount command.

https://github.com/user-attachments/assets/34ea22cb-484b-4a1d-b958-1358ff59dc25

What did you expect to happen?

Pod using ConfigMap SubPath volumes should be created successfully.

How can we reproduce it (as minimally and precisely as possible)?

  1. Bump util-linux version 2.41.
    # pacman -Si util-linux
    Repository      : core
    Name            : util-linux
    Version         : 2.41-2
    ....
    
  2. Install K3s or RKE2.
    # export INSTALL_K3S_MIRROR=cn   # Uncomment if install K3s in China regions.
    curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | \
        INSTALL_K3S_VERSION=v1.31.6+k3s1 \
        sh -s - server \
        --cluster-init
    
    # After the K3s server ready
    mkdir -p ~/.kube/config
    cat /etc/rancher/k3s/k3s.yaml > ~/.kube/config
    
  3. Apply the following example ConfigMap and Pod configuration.
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: test
data:
  test.conf: |
    AAA=FOO
    BBB=BAR
---
apiVersion: v1
kind: Pod
metadata:
  name: test
spec:
  containers:
    - name: demo
      image: alpine
      command: ["sleep", "3600"]
      volumeMounts:
      - name: config
        mountPath: "/config"
        subPath: "test.conf"
  volumes:
  # You set volumes at the Pod level, then mount them into containers inside that Pod
  - name: config
    configMap:
      # Provide the name of the ConfigMap you want to mount.
      name: test
      items:
        - key: test.conf
          path: test.conf

  1. Pod failed to create with following error in events.
# kubectl describe pod test
 Warning  Failed     49m                  kubelet            Error: failed to generate container "ddcc1d587faca0a37bc7ee0bf46abbf7ce009c31a838f00f7a2a640667b713da" spec: failed to generate spec: failed to mkdir "/var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0": mkdir /var/lib/kubelet/pods/ed5ba81a-2777-4ac9-a986-33238d803bdf/volume-subpaths/config/demo/0: file exists

Anything else we need to know?

# kubectl get nodes
NAME        STATUS   ROLES                       AGE     VERSION
archlinux   Ready    control-plane,etcd,master   5h58m   v1.31.6+k3s1

Kubernetes version

# kubectl version
Client Version: v1.32.3
Kustomize Version: v5.5.0
Server Version: v1.31.6+k3s1

Cloud provider

Not using a public cloud.

The RKE2 / K3s are installed on the KVM and bare metal machines.

OS version

[root@archlinux ~]# cat /etc/os-release 
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

$ uname -a
Linux archlinux 6.13.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 13 Mar 2025 18:12:00 +0000 x86_64 GNU/Linux

Install tools

K3s and RKE2

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, …) and versions (if applicable)

About this issue

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

Commits related to this issue

Most upvoted comments

I just got the exact same issue on a server on version 1.32.3 created with kubeadm on Archlinux. All subpath mounts are affected. Everything started working fine again after I rolled back util-linux from 2.41 to 2.40.4.

Hello @lahwaacz nice thanks, for the moment I revert with

pacman -U https://archive.archlinux.org/packages/u/util-linux/util-linux-2.40.4-1-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/u/util-linux-libs/util-linux-libs-2.40.4-1-x86_64.pkg.tar.zst

@jwittekind I’m pretty sure that version of util-linux is affected. I’ve had the same issues on openSUSE MicroOS as you have and they were gone after reverting to a snapshot with an older version of util-linux.

I tried to install util-linux-2.41-4 from the core-testing Arch repositories, but I still get an error

Hi @markusressel, just found that util-linux 2.41-4 and util-linux-libs 2.41-4 are in the core repository now, please ensure that you have upgraded both util-linux and util-linux-libs to 2.41-4 to fix this mount error.

Tested and work perfectly since one hour and half 👌 thanks

I tried to install util-linux-2.41-4 from the core-testing Arch repositories, but I still get an error

Hi @markusressel, just found that util-linux 2.41-4 and util-linux-libs 2.41-4 are in the core repository now, please ensure that you have upgraded both util-linux and util-linux-libs to 2.41-4 to fix this mount error.

@RouxAntoine There is no util-linux release with the fix yet, but Arch Linux has backported the patch in util-linux-2.41-4 (currently in core-testing).

Closed as the util-linux v2.41.1 solves this issue.

System: Raspberry PI - Gentoo - Kubernetes 1.32.3

I faced the same error, suddenly with no other changes except daily Gentoo emerge updates running, but running K8s 1.32.2 initially.

I re-merged util-linx 2.41 patched with the commit referenced in https://github.com/util-linux/util-linux/issues/3474 and performed a kubectl rollout restart for the impacted deployments.

Result: all Pods are running fine again, no “failed to prepare subPath for volumeMount” errors anymore

I am confident that upstream https://github.com/util-linux/util-linux/pull/3479 solves this issue impacting K8s.