-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Nextflow using Kubernetes and NFS persistent volume with non-root user will result in a permission denied exception #1270
Comments
Try specifying |
The configuration was already there, you can see it here: https://github.com/glmanhtu/nf-workflows/blob/master/nextflow.config |
How are you launching the pipeline? |
nextflow kuberun https://github.com/glmanhtu/nf-workflows -v pride-pv-claim:/mnt -profile kubernetes |
I feat that the config is not properly propagated (similarly to #1050). What if you create a |
I tried and the result is the same.
Command to run: output:
Pod created: nf-30317ad36174f9e2a08dbb6046d8c3e6
|
Can you copy here the |
.command.run
.command.yaml
|
I guess the problem is when it copies the result from the scratch dir to the shared dir
Not sure how much I can help here. You need to have that dir writable. |
Actually, the dir is writeable for the user 2801 as I specified. However, I suspect the securityContext is not applied before the workingDir directive, that caused the permission denied. So, if there is a way to remove the workingDir directive then it should be working fine. |
Can try to hack that yaml and the .commad.run script to make it work. |
I have tried to delete the workingDir directive and update the command from
But the thing is these files are generated by nextflow so, we can't do it all by our self. If you add some sort of options in nextflow that will do it automatically then it will be great. |
That's could be a possible patch, but I can't incorporate it directly in the main code base without more rigorous testing and assessment of pros&cons. I would suggest, you create your own build and test it, then send a PR. |
We found another workaround solution for this problem by setting up the permission to the NFS storage it self. |
Leaving it open because it may be useful to handle this on NF side. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm encountering this issue without Kubernetes, but with an NFS mount. I'm curious what NFS permissions glmanhtu changed here. |
Bug report
Hello guys. I was trying to run nextflow with Kubernetes and have encountered some sort of permission problem with non-root user. Nextflow was trying to initialise the Pod but got an exception of "container init caused "mkdir /mnt/tvu: permission denied". Below is the Kubernetes manifest file generated by nextflow:
I have assigned rw permission for user 2801 to the NFS persistent volume. When I removed the workingDir, the pod was started successfully and I was be able to cd into the /mnt/tvu/work/68/b883e7affa9dc5d6d5e721c75b21c4 folder. So, I suspect that the runAsUser and workingDir couldn't get along.
As my opinion, I think this is the issue of Kubernetes it self because if the given user has rw permission on the workingDir then the pod should be able to start successfully. However, I think Nextflow can do it better by setting the working directory inside the command.run file instead of using workingDir parameter.
Expected behavior and actual behavior
Expect the pod to be able to start successfully.
Steps to reproduce the problem
From here, nextflow should show an exception of unknown reason. Using kubectl get pods command to check which pod was created (it's name should be something like nf-5f444e721a0ca7373744d096756fd62a) and then using kubectl describe pod to see the error message
Program output
Environment
The text was updated successfully, but these errors were encountered: