Skip to content

ImageVolumeMountFailed using erofs in v2.3.1 #13534

Closed

Description

@meatuses

Description

Image volume mounting issue turned up when we were running conformance tests on kubernetes 1.36.1 with containerd v2.3.1 with erofs. If we deploy a pod similar to generated by the test https://github.com/kubernetes/kubernetes/blob/v1.36.1/test/e2e/common/node/image_volume.go:

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  restartPolicy: Always
  nodeSelector:
    node.deckhouse.io/group: workercri
  containers:
  - name: test-container
    image: registry.k8s.io/e2e-test-images/busybox:1.36.1-1
    command: ["/bin/sh", "-c", "while true; do echo test; sleep 1; done"]
    volumeMounts:
    - name: volume
      mountPath: /volume
  volumes:
  - name: volume
    image:
      reference: registry.k8s.io/e2e-test-images/kitten:1.7
      pullPolicy: Always

An error is logged in the pod events:

  Warning  Failed     8m43s                  kubelet            Error: failed to mount image volume: ImageVolumeMountFailed: failed to mount image volume component "/run/containerd/io.containerd.grpc.v1.cri/image-volumes/9d4094692b5954bf9c77bab91f78f667afa25199c4594d89ad45d773e9b6823c/03446e7dc02d04378c747bc731fb44249b13bcd836c7ae83aa7690b9e6e57b29": mount source: "overlay", target: "/run/containerd/io.containerd.grpc.v1.cri/image-volumes/9d4094692b5954bf9c77bab91f78f667afa25199c4594d89ad45d773e9b6823c/03446e7dc02d04378c747bc731fb44249b13bcd836c7ae83aa7690b9e6e57b29", fstype: format/mkdir/overlay, flags: 0, data: "workdir=/var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/16/work,upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/16/fs,lowerdir={{ overlay 0 10 }}", err: no such device

And there is no actual files from the images mounted to the pod:

# kubectl exec -it test-pod -- sh
/ # ls /volume
bin    dev    etc    home   lib    media  mnt    opt    proc   root   run    sbin   srv    sys    tmp    usr    var

Problem also reproduces in containerd v2.2.4

If we switch from erofs snapshotter to overlayfs, image mounts successfully:

# kubectl exec -it test-pod -- sh
/ #
/ # ls /volume
agnhost        coredns        etc            lib            media          proc           sbin           tmp            var
agnhost-2      data.json      home           localhost.crt  mnt            root           srv            uploads
bin            dev            kitten.jpg     localhost.key  opt            run            sys            usr
/ # cat /volume/data.json
{
  "image": "kitten.jpg"
}

Steps to reproduce the issue

  1. Kubernetes 1.36.1, containerd v2.3.1 + erofs snapshotter
  2. Deploy a pod with image volume mounted.
  3. No files from image are mounted in the volume path, error in the events err: no such device

Describe the results you received and expected

Expected to mount image volumes to pods successfully with erofs snapshotter.

What version of containerd are you using?

containerd github.com/containerd/containerd/v2 v2.3.1 64b425c

Any other relevant information

ob-kube-update-worker-1   Ready    workercri              29m    v1.36.1   10.128.0.17   <none>        Ubuntu 24.04.4 LTS   6.8.0-124-generic (amd64)   containerd://2.3.1
Linux ob-kube-update-worker-1 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
runc version 1.4.2
commit: v1.4.2-0-gc241c0bb
spec: 1.3.0
go: go1.25.8
libseccomp: 2.6.0
crictl info
{
  "cniconfig": {
    "Networks": [
      {
        "Config": {
          "CNIVersion": "0.3.1",
          "Name": "cni-loopback",
          "Plugins": [
            {
              "Network": {
                "ipam": {},
                "type": "loopback"
              },
              "Source": "{\"type\":\"loopback\"}"
            }
          ],
          "Source": "{\n\"cniVersion\": \"0.3.1\",\n\"name\": \"cni-loopback\",\n\"plugins\": [{\n  \"type\": \"loopback\"\n}]\n}"
        },
        "IFName": "lo"
      },
      {
        "Config": {
          "CNIVersion": "0.3.1",
          "Name": "cilium",
          "Plugins": [
            {
              "Network": {
                "ipam": {},
                "type": "cilium-cni"
              },
              "Source": "{\"enable-debug\":false,\"log-file\":\"/var/run/cilium/cilium-cni.log\",\"type\":\"cilium-cni\"}"
            }
          ],
          "Source": "\n{\n  \"cniVersion\": \"0.3.1\",\n  \"name\": \"cilium\",\n  \"plugins\": [\n    {\n       \"type\": \"cilium-cni\",\n       \"enable-debug\": false,\n       \"log-file\": \"/var/run/cilium/cilium-cni.log\"\n    }\n  ]\n}"
        },
        "IFName": "eth0"
      }
    ],
    "PluginConfDir": "/etc/cni/net.d",
    "PluginDirs": [
      "/opt/cni/bin"
    ],
    "PluginMaxConfNum": 1,
    "Prefix": "eth"
  },
  "config": {
    "cdiSpecDirs": [
      "/etc/cdi",
      "/var/run/cdi"
    ],
    "cni": {
      "binDir": "",
      "binDirs": [
        "/opt/cni/bin"
      ],
      "confDir": "/etc/cni/net.d",
      "confTemplate": "",
      "ipPref": "",
      "maxConfNum": 1,
      "setupSerially": false,
      "useInternalLoopback": false
    },
    "containerd": {
      "defaultRuntimeName": "runc",
      "ignoreBlockIONotEnabledErrors": false,
      "ignoreRdtNotEnabledErrors": false,
      "runtimes": {
        "runc": {
          "ContainerAnnotations": [],
          "PodAnnotations": [],
          "baseRuntimeSpec": "",
          "cgroupWritable": false,
          "cniConfDir": "",
          "cniMaxConfNum": 0,
          "io_type": "",
          "options": {
            "BinaryName": "",
            "CriuImagePath": "",
            "CriuWorkPath": "",
            "IoGid": 0,
            "IoUid": 0,
            "NoNewKeyring": false,
            "Root": "",
            "ShimCgroup": "",
            "SystemdCgroup": true
          },
          "privileged_without_host_devices": false,
          "privileged_without_host_devices_all_devices_allowed": false,
          "runtimePath": "",
          "runtimeType": "io.containerd.runc.v2",
          "sandboxer": "podsandbox",
          "snapshotter": ""
        }
      }
    },
    "containerdEndpoint": "/run/containerd/containerd.sock",
    "containerdRootDir": "/var/lib/containerd",
    "device_ownership_from_security_context": false,
    "disableApparmor": false,
    "disableHugetlbController": true,
    "disableProcMount": false,
    "drainExecSyncIOTimeout": "0s",
    "enableCDI": true,
    "enableSelinux": false,
    "enableUnprivilegedICMP": true,
    "enableUnprivilegedPorts": true,
    "ignoreDeprecationWarnings": [],
    "ignoreImageDefinedVolumes": false,
    "maxContainerLogLineSize": 16384,
    "netnsMountsUnderStateDir": false,
    "restrictOOMScoreAdj": false,
    "rootDir": "/var/lib/containerd/io.containerd.grpc.v1.cri",
    "selinuxCategoryRange": 1024,
    "stateDir": "/run/containerd/io.containerd.grpc.v1.cri",
    "statsCollectPeriod": "",
    "statsRetentionPeriod": "",
    "tolerateMissingHugetlbController": true,
    "unsetSeccompProfile": ""
  },
  "features": {
    "supplemental_groups_policy": true
  },
  "golang": "go1.26.3",
  "lastCNILoadStatus": "OK",
  "lastCNILoadStatus.default": "OK",
  "runtimeHandlers": [
    {
      "features": {
        "recursive_read_only_mounts": true,
        "user_namespaces": true
      }
    },
    {
      "features": {
        "recursive_read_only_mounts": true,
        "user_namespaces": true
      },
      "name": "runc"
    }
  ],
  "status": {
    "conditions": [
      {
        "message": "",
        "reason": "",
        "status": true,
        "type": "RuntimeReady"
      },
      {
        "message": "",
        "reason": "",
        "status": true,
        "type": "NetworkReady"
      },
      {
        "message": "{\"io.containerd.deprecation/cri-registry-configs\":\"The `configs` property of `[plugins.\\\"io.containerd.grpc.v1.cri\\\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.4. Use `config_path` instead.\"}",
        "reason": "ContainerdHasDeprecationWarnings",
        "status": false,
        "type": "ContainerdHasNoDeprecationWarnings"
      }
    ]
  }
}

Show configuration if it is related to CRI plugin.

config.toml
version = 4
root = '/var/lib/containerd'
state = '/run/containerd'
temp = ''
disabled_plugins = []
required_plugins = []
oom_score = 0
imports = ['/etc/containerd/conf.d/*.toml']

[debug]
  level = ''
  format = ''
  log_trace_id = false

[plugins]
  [plugins.'io.containerd.cri.v1.images']
    snapshotter = 'erofs'
    disable_snapshot_annotations = true
    discard_unpacked_layers = false
    max_concurrent_downloads = 3
    concurrent_layer_fetch_buffer = 0
    image_pull_progress_timeout = '5m0s'
    image_pull_with_sync_fs = false
    stats_collect_period = 10
    use_local_image_pull = false

    [plugins.'io.containerd.cri.v1.images'.pinned_images]
      sandbox = 'registry.k8s.io/pause:3.10.2'


    [plugins.'io.containerd.cri.v1.images'.registry]
      config_path = "/etc/containerd/registry.d"

    [plugins."io.containerd.cri.v1.images".registry.configs."dev-registry".auth]
      auth = "=="

    [plugins.'io.containerd.cri.v1.images'.image_decryption]
      key_model = 'node'

  [plugins.'io.containerd.cri.v1.runtime']
    enable_selinux = false
    selinux_category_range = 1024
    max_container_log_line_size = 16384
    disable_apparmor = false
    restrict_oom_score_adj = false
    disable_proc_mount = false
    unset_seccomp_profile = ''
    tolerate_missing_hugetlb_controller = true
    disable_hugetlb_controller = true
    device_ownership_from_security_context = false
    ignore_image_defined_volumes = false
    netns_mounts_under_state_dir = false
    enable_unprivileged_ports = true
    enable_unprivileged_icmp = true
    enable_cdi = true
    cdi_spec_dirs = ['/etc/cdi', '/var/run/cdi']
    drain_exec_sync_io_timeout = '0s'
    ignore_deprecation_warnings = []
    stats_collect_period = ''
    stats_retention_period = ''

    [plugins.'io.containerd.cri.v1.runtime'.containerd]
      default_runtime_name = 'runc'
      ignore_blockio_not_enabled_errors = false
      ignore_rdt_not_enabled_errors = false

      [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes]
        [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc]
          runtime_type = 'io.containerd.runc.v2'
          runtime_path = ''
          pod_annotations = []
          container_annotations = []
          privileged_without_host_devices = false
          privileged_without_host_devices_all_devices_allowed = false
          cgroup_writable = false
          base_runtime_spec = ''
          cni_conf_dir = ''
          cni_max_conf_num = 0
          snapshotter = ''
          sandboxer = 'podsandbox'
          io_type = ''

          [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc.options]
            BinaryName = ''
            CriuImagePath = ''
            CriuWorkPath = ''
            IoGid = 0
            IoUid = 0
            NoNewKeyring = false
            Root = ''
            ShimCgroup = ''
            SystemdCgroup = true

    [plugins.'io.containerd.cri.v1.runtime'.cni]
      bin_dir = ''
      bin_dirs = ['/opt/cni/bin']
      conf_dir = '/etc/cni/net.d'
      max_conf_num = 1
      setup_serially = false
      conf_template = ''
      ip_pref = ''
      use_internal_loopback = false

  [plugins.'io.containerd.differ.v1.erofs']
    mkfs_options = []
    enable_tar_index = false
    enable_dmverity = false

  [plugins.'io.containerd.gc.v1.scheduler']
    pause_threshold = 0.02
    deletion_threshold = 0
    mutation_threshold = 100
    schedule_delay = '0s'
    startup_delay = '100ms'

  [plugins.'io.containerd.grpc.v1.cri']
    disable_tcp_service = true
    stream_server_address = '127.0.0.1'
    stream_server_port = '0'
    stream_idle_timeout = '4h0m0s'
    enable_tls_streaming = false

    [plugins.'io.containerd.grpc.v1.cri'.x509_key_pair_streaming]
      tls_cert_file = ''
      tls_key_file = ''

  [plugins.'io.containerd.image-verifier.v1.bindir']
    bin_dir = '/opt/containerd/image-verifier/bin'
    max_verifiers = 10
    per_verifier_timeout = '10s'

  [plugins.'io.containerd.internal.v1.opt']
    path = '/opt/containerd'

  [plugins.'io.containerd.internal.v1.tracing']

  [plugins.'io.containerd.metadata.v1.bolt']
    content_sharing_policy = 'shared'
    no_sync = false

  [plugins.'io.containerd.metrics.v1.grpc-prometheus']
    grpc_histogram = false

  [plugins.'io.containerd.monitor.container.v1.restart']
    interval = '10s'

  [plugins.'io.containerd.monitor.task.v1.cgroups']
    no_prometheus = false

  [plugins.'io.containerd.mount-handler.v1.erofs']

  [plugins.'io.containerd.nri.v1.nri']
    disable = false
    socket_path = '/var/run/nri/nri.sock'
    plugin_path = '/opt/nri/plugins'
    plugin_config_path = '/etc/nri/conf.d'
    plugin_registration_timeout = '5s'
    plugin_request_timeout = '2s'
    disable_connections = false

    [plugins.'io.containerd.nri.v1.nri'.default_validator]
      enable = false
      reject_oci_hook_adjustment = false
      reject_runtime_default_seccomp_adjustment = false
      reject_unconfined_seccomp_adjustment = false
      reject_custom_seccomp_adjustment = false
      reject_namespace_adjustment = false
      reject_sysctl_adjustment = false
      required_plugins = []
      tolerate_missing_plugins_annotation = ''

  [plugins.'io.containerd.runtime.v2.task']
    platforms = ['linux/amd64']

  [plugins.'io.containerd.server.v1.debug']
    address = ''
    uid = 0
    gid = 0

  [plugins.'io.containerd.server.v1.grpc']
    address = '/run/containerd/containerd.sock'
    uid = 0
    gid = 0
    max_recv_message_size = 16777216
    max_send_message_size = 16777216

  [plugins.'io.containerd.server.v1.grpc-tcp']
    address = ''
    tls_ca = ''
    tls_cert = ''
    tls_key = ''
    tls_common_name = ''
    max_recv_message_size = 16777216
    max_send_message_size = 16777216

  [plugins.'io.containerd.server.v1.metrics']
    address = ''

  [plugins.'io.containerd.server.v1.ttrpc']
    address = '/run/containerd/containerd.sock.ttrpc'
    uid = 0
    gid = 0

  [plugins.'io.containerd.service.v1.diff-service']
    default = ['walking']
    sync_fs = false

  [plugins.'io.containerd.service.v1.tasks-service']
    blockio_config_file = ''
    rdt_config_file = ''

  [plugins.'io.containerd.shim.v1.manager']
    env = []
    socket_dir = ''

  [plugins.'io.containerd.snapshotter.v1.blockfile']
    root_path = ''
    scratch_file = ''
    fs_type = ''
    mount_options = []
    recreate_scratch = false

  [plugins.'io.containerd.snapshotter.v1.btrfs']
    root_path = ''

  [plugins.'io.containerd.snapshotter.v1.devmapper']
    root_path = ''
    pool_name = ''
    base_image_size = ''
    async_remove = false
    discard_blocks = false
    fs_type = ''
    fs_options = ''

  [plugins.'io.containerd.snapshotter.v1.erofs']
    root_path = ''
    ovl_mount_options = []

  [plugins.'io.containerd.snapshotter.v1.native']
    root_path = ''

  [plugins.'io.containerd.snapshotter.v1.overlayfs']
    root_path = ''
    upperdir_label = false
    sync_remove = false
    slow_chown = false
    mount_options = []

  [plugins.'io.containerd.snapshotter.v1.zfs']
    root_path = ''

  [plugins.'io.containerd.tracing.processor.v1.otlp']

  [plugins.'io.containerd.transfer.v1.local']
    max_concurrent_downloads = 3
    concurrent_layer_fetch_buffer = 0
    max_concurrent_uploaded_layers = 3
    check_platform_supported = false
    config_path = ''
    max_concurrent_unpacks = 1

[cgroup]
  path = ''

[timeouts]
  'io.containerd.timeout.bolt.open' = '0s'
  'io.containerd.timeout.cri.defercleanup' = '1m0s'
  'io.containerd.timeout.metrics.shimstats' = '2s'
  'io.containerd.timeout.shim.cleanup' = '5s'
  'io.containerd.timeout.shim.load' = '5s'
  'io.containerd.timeout.shim.shutdown' = '3s'
  'io.containerd.timeout.task.state' = '2s'

[stream_processors]
  [stream_processors.'io.containerd.ocicrypt.decoder.v1.tar']
    accepts = ['application/vnd.oci.image.layer.v1.tar+encrypted']
    returns = 'application/vnd.oci.image.layer.v1.tar'
    path = 'ctd-decoder'
    args = ['--decryption-keys-path', '/etc/containerd/ocicrypt/keys']
    env = ['OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf']

  [stream_processors.'io.containerd.ocicrypt.decoder.v1.tar.gzip']
    accepts = ['application/vnd.oci.image.layer.v1.tar+gzip+encrypted']
    returns = 'application/vnd.oci.image.layer.v1.tar+gzip'
    path = 'ctd-decoder'
    args = ['--decryption-keys-path', '/etc/containerd/ocicrypt/keys']
    env = ['OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf']

Activity

  1. hsiangkao commented on Jun 4, 2026

    @hsiangkao
    Member

    it seems some image volume path still doesn't apply the mount manager infra.

  2. added a commit that references this issue on Jun 8, 2026
    c5bffe7
  3. hsiangkao commented on Jun 8, 2026

    @hsiangkao
    Member

    @meatuses can you confirm if #13542 fixes the issue?
    since I don't have kubernetes local test environment.

  4. added a commit that references this issue on Jun 8, 2026
    d62b6e7
  5. meatuses commented on Jun 8, 2026

    @meatuses
    Author

    @meatuses can you confirm if #13542 fixes the issue? since I don't have kubernetes local test environment.

    @hsiangkao Appears to be working with the fix, thanks. No errors and the expected files are mounted.

    root@ob-kube-update-master-0:~# kubectl exec -it test-pod -- sh
    / # ls /volume
    agnhost        coredns        etc            lib            media          proc           sbin           tmp            var
    agnhost-2      data.json      home           localhost.crt  mnt            root           srv            uploads
    bin            dev            kitten.jpg     localhost.key  opt            run            sys            usr
    / # cat /volume/data.json
    {
      "image": "kitten.jpg"
    }
    
    root@ob-kube-update-worker-1:~# containerd --version
    containerd github.com/containerd/containerd/v2 d62b6e798 d62b6e798907f73f0af7a1a0ea29a01ba43acfc7
    root@ob-kube-update-worker-1:~# grep snapshotter /etc/containerd/config.toml
        snapshotter = 'erofs'
    
  6. added a commit that references this issue on Jun 8, 2026
    f911f59
  7. added 7 commits that reference this issue on Jun 23, 2026
    15945d3
    01e60ef
    69992c4
    fc594bd
    52a5c1b
    41e0645
    670fa53
  8. added a commit that references this issue on Aug 14, 2026
    9224f17
  9. added a commit that references this issue on Sep 11, 2026
    2e1dcc5
  10. added a commit that references this issue on Sep 11, 2026
    74d0c79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions