You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@task.kubernetes fails on non-root images due to /airflow/xcom directory creation #56545
However, in the default Airflow image the container runs as the airflow user, (see HERE) which does not have write permissions to /. As a result, the attempt to create /airflow/xcom fails with a permissions error, and the Kubernetes task cannot start.
The /airflow/xcom directory is currently created unconditionally during initialization, assuming root permissions.
Possible approaches to resolve this:
Create the directory under a writable path such as /tmp/airflow/xcom, or
Make the XCom path configurable for Kubernetes-decorated tasks, or
Check for existence and create the directory only if it’s writable by the current user.
The change you mention was released in 5.2.1 more than 2 years and half ago, I'm surprised no one faced/reported the issue before. This would make sense if we have the folder /airflow created in the Docker image and we removed it recently, but according the blame history, it is not the case:
You can see from the tests of the kubernetes provider that only images with an entrypoint as root are used:
ubuntu:16.04
alpine
bash:5.2
perl:5.34.0
gcr.io/spark-operator/spark:v2.4.4
So the integration tests cannot show this issue.
I have added the links for each image to its layer-details to show the root-style of the image
and the link to the tests where it is used in the kubernetes-provider below.
This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
Hi @Prab-27, please don't apologize! K8s has a steep learning curve and we are all learning here. Taking on an issue is a brave first step, and it is definitely not a mistake. Keep exploring and happy coding! 💪
Hi @Prab-27, please don't apologize! K8s has a steep learning curve and we are all learning here. Taking on an issue is a brave first step, and it is definitely not a mistake. Keep exploring and happy coding! 💪
Activity
hussein-awala commentedon Oct 11, 2025
The change you mention was released in
5.2.1more than 2 years and half ago, I'm surprised no one faced/reported the issue before. This would make sense if we have the folder/airflowcreated in the Docker image and we removed it recently, but according the blame history, it is not the case:Could you try reproduce the issue in the K8S integration tests? That way we can figure out where and how we should fix it.
hussein-awala commentedon Oct 11, 2025
This should be the fastest and easiest solution to implement (it's full b/c), feel free to open a PR.
jhgoebbert commentedon Oct 11, 2025
You can see from the tests of the kubernetes provider that only images with an entrypoint as root are used:
So the integration tests cannot show this issue.
I have added the links for each image to its layer-details to show the root-style of the image
and the link to the tests where it is used in the kubernetes-provider below.
image="ubuntu:16.04"
image="alpine"
image="bash:5.2"
image="perl:5.34.0"
image: "gcr.io/spark-operator/spark:v2.4.4"
jhgoebbert commentedon Oct 11, 2025
Could it be that it is intended that non-root images have no support?
I might miss something here - but I do not see a reason why 🤔
hussein-awala commentedon Oct 11, 2025
In fact, it’s recommended to use rootless mode, which means this is a bug.
jhgoebbert commentedon Oct 13, 2025
@hussein-awala Is there any additional information I can give or can you remove the
pending-responsetag?15 remaining items
github-actions commentedon Nov 16, 2025
This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
Prab-27 commentedon Nov 16, 2025
I sincerely apologize for the delay.
I assure you the PR will be raised very soon.
Prab-27 commentedon Dec 3, 2025
Still in progress ...
Fix XCom directory creation logic in Kubernetes decorator and add tes…
aaron-y-chen commentedon Dec 12, 2025
Hi, my team encountered this issue as well. Since we needed a fix, I've submitted a PR #59347 to address it. Hope this helps!
Prab-27 commentedon Dec 12, 2025
Sorry, I’m still testing with Kubernetes and learning about it, so I couldn’t fix this one.
I won’t make such mistakes again
aaron-y-chen commentedon Dec 12, 2025
Hi @Prab-27, please don't apologize! K8s has a steep learning curve and we are all learning here. Taking on an issue is a brave first step, and it is definitely not a mistake. Keep exploring and happy coding! 💪
potiuk commentedon Dec 13, 2025
Very much so !
Fix XCom directory creation logic in Kubernetes decorator (#56545) (#…
Fix XCom directory creation logic in Kubernetes decorator (apache#56545…
Fix XCom directory creation logic in Kubernetes decorator (apache#56545…
Fix XCom directory creation logic in Kubernetes decorator (apache#56545…