Skip to content

Document kubelet subPath mkdir race condition in troubleshooting guide#750

Open
yerzhan7 wants to merge 1 commit into
awslabs:mainfrom
yerzhan7:doc/troubleshooting/subpath-kubelet
Open

Document kubelet subPath mkdir race condition in troubleshooting guide#750
yerzhan7 wants to merge 1 commit into
awslabs:mainfrom
yerzhan7:doc/troubleshooting/subpath-kubelet

Conversation

@yerzhan7
Copy link
Copy Markdown
Contributor

Issue #, if available: N/A

Description of changes: Document kubelet subPath mkdir race condition in troubleshooting guide

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yerzhan7 yerzhan7 requested a review from a team as a code owner March 18, 2026 22:40
@jet-tong jet-tong force-pushed the doc/troubleshooting/subpath-kubelet branch from 87d079e to b1b09b5 Compare March 27, 2026 13:36
@jet-tong jet-tong temporarily deployed to us-east-1-rosa-untrusted March 27, 2026 13:37 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:37 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 13:44 — with GitHub Actions Inactive
@jet-tong jet-tong had a problem deploying to us-east-1-rosa-untrusted March 27, 2026 13:44 — with GitHub Actions Failure
@jet-tong jet-tong temporarily deployed to us-east-1-untrusted March 27, 2026 14:35 — with GitHub Actions Inactive
Comment thread docs/TROUBLESHOOTING.md
This is a [known kubelet bug](https://github.com/kubernetes/kubernetes/issues/94198) where concurrent `subPath` directory creation races. It is more likely with the CSI driver v2 because multiple Pods [share a single Mountpoint instance](./MOUNTPOINT_POD_SHARING.md). A [fix](https://github.com/kubernetes/kubernetes/pull/134540) is pending upstream.

**Workarounds:**
- Use the `--prefix` mount option instead of Kubernetes `subPath` (see above).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np: perhaps link directly to how to use prefix mountOptions / show an example? That'll allow users to find out how to use this workaround quicker.

Comment thread docs/TROUBLESHOOTING.md
Comment on lines +101 to +102
CreateContainerConfigError: failed to create subPath directory for volumeMount "data" of container "app":
cannot create directory /var/lib/kubelet/pods/.../mount/subdir: file exists
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq: Where is this referenced from? In upstream issue the error seems to be slightly different in this format:

failed to create subPath directory for volumeMount "xxx" of container "xxx": cannot create directory /var/lib/kubelet/pods/xxx: file exists

# and finally

... container start failed: CreateContainerConfigError: failed to create subPath directory for volumeMount "xxx" of container "xxx"

Just wanted to make sure for better error match when users search for it.

Comment thread docs/TROUBLESHOOTING.md
cannot create directory /var/lib/kubelet/pods/.../mount/subdir: file exists
```

This is a [known kubelet bug](https://github.com/kubernetes/kubernetes/issues/94198) where concurrent `subPath` directory creation races. It is more likely with the CSI driver v2 because multiple Pods [share a single Mountpoint instance](./MOUNTPOINT_POD_SHARING.md). A [fix](https://github.com/kubernetes/kubernetes/pull/134540) is pending upstream.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np: where concurrent subPath directory creations race (concurrent = multiple)

alt: caused by a race condition during concurrent subPath directory creation.

@jet-tong jet-tong had a problem deploying to us-east-1-rosa-untrusted March 30, 2026 10:25 — with GitHub Actions Failure
@jet-tong jet-tong had a problem deploying to us-east-1-rosa-untrusted April 2, 2026 08:53 — with GitHub Actions Failure
@jet-tong jet-tong had a problem deploying to us-east-1-rosa-untrusted April 7, 2026 15:10 — with GitHub Actions Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants