Skip to content

Pod Stuck in CreateContainerConfigError When Sharing a Volume on the Same Host #1398

@wolgod

Description

@wolgod

What happened:

I'm encountering an issue where multiple pods from different deployments are scheduled on the same node and use a shared volume. Each pod mounts a different subdirectory of this shared volume.

When one of these pods unexpectedly restarts, it gets stuck in a CreateContainerConfigError state. Upon inspection, it appears that the pods are using the same mount point on the host, but for different subdirectories.

The root cause seems to be a conflict where the mount point for the restarting pod is still being held by another pod, preventing it from being unmounted, remounted, and started. The lsof command on the host shows the mount point is in use by another pod.

The specific error log is as follows:
kubelet: Unmounting arguments: /var/lib/kubelet/pods/a5511304-bcf1-4a3e-abe6-c6bc22aca1e4/volume-subpaths/fs-545358898194812475-106296-pv/sub-volume/0
kubelet: Output: umount: /var/lib/kubelet/pods/a5511304-bcf1-4a3e-abe6-c6bc22aca1e4/volume-subpaths/fs-545358898194812475-106296-pv/sub-volume/0: target is busy.
kubelet: (In some cases useful info about processes that use
kubelet: the device is found by lsof(8) or fuser(1))

pod_workers.go:191] Error syncing pod a5511304-bcf1-4a3e-abe6-c6bc22aca1e4 ("sub-remove-subremove-test-b78cdcb6d-tknmq_ns-106296(a5511304-bcf1-4a3e-abe6-c6bc22aca1e4)"), skipping: failed to "StartContainer" for "sub-volume" with CreateContainerConfigError: "failed to prepare subPath for volumeMount "fs-545358898194812475" of container "sub-volume""

What you expected to happen:
pod restart nornaml

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?

Environment:

  • JuiceFS CSI Driver version (which image tag did your CSI Driver use): 0.25.4
  • Kubernetes version (e.g. kubectl version): 1.20
  • Object storage (cloud provider and region): ceph rbd
  • Metadata engine info (version, cloud provider managed or self maintained):
  • Network connectivity (JuiceFS to metadata engine, JuiceFS to object storage):
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions