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
mkdir: cannot create directory '/mnt/app-root.setup-volume': Permission denied #2680
Comments
The PVC is mounted at the /mnt mount point inside the Init container and The PV is mounted at the /opt/app-root point inside the application container. Can I think the two "Permission denied" error all means there is no permission to write the PersistentVolume? |
Have you check that the HostPath configured on your PV is a valid dictorary? |
yes, it's a valid path and I even can see that folder |
The folder means "app-root"? |
no, the /mnt/xx on my host, the app-root as you can see my log |
|
yes, I confirm, I modify the permission to 777 :) |
@jichenjc are you working this issue? |
no, this is something I need some help or want to know whether someone has simliar output to me by using hostPath..., maybe it's invalid due to hostPath for PV/PVC,but need some guide here.. thanks |
@jichenjc could you please mention exact |
I tried to reproduce this, java component gets deployed successfully on my cluster.
|
As discussed with @adisky in slack additional info :
|
@jichenjc as you mentioned this issue is same as #1623, Please try using the project other than As per the comments here #1623 (comment), Its mostly related to some security context related settings with the default project. |
um... I think I switched to default project |
/kind bug
What versions of software are you using?
Operating System:
Output of
odo version
:latest (build from master from last week)
How did you run odo exactly?
this is similar to following
#1623
but I used hostPath and NFS both got same error and I think it's not related to anyuid...
I added logs and showed the pv is mount as root:root and as normal user (1000580000), I can't create things there,
from https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
the files or directories created on the underlying hosts are only writable by root. You either need to run your process as root in a privileged Container or modify the file permissions on the host to be able to write to a hostPath volume
so at least hostPath doesn't work, NFS from my test also doesn't work
so the question is what we did on odo CI , which things are changed or PV used?
[root@infnod-1 ~]# crictl logs 15d0e7b81001e
2020/02/27 06:47:57 [go-init] Pre-start command launched : /opt/odo/bin/s2i-setup
1000580000
uid=1000580000(1000580000) gid=0(root) groups=0(root),1000580000
total 8
lrwxrwxrwx. 1 root root 7 Jan 28 10:42 bin -> usr/bin
dr-xr-xr-x. 2 root root 6 Jan 28 10:42 boot
drwxr-xr-x. 5 root root 360 Feb 27 06:47 dev
drwxr-xr-x. 1 root root 44 Jan 29 14:29 etc
-rw-r--r--. 1 root root 7753 Jan 29 14:29 help.1
drwxr-xr-x. 2 root root 6 Jan 28 10:42 home
lrwxrwxrwx. 1 root root 7 Jan 28 10:42 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jan 28 10:42 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Dec 14 2017 media
drwxr-xr-x. 2 root root 6 Dec 14 2017 mnt
drwxr-xr-x. 1 root root 17 Feb 27 06:47 opt
dr-xr-xr-x. 190 root root 0 Feb 27 06:47 proc
dr-xr-x---. 1 root root 23 Jan 28 10:54 root
drwxr-xr-x. 1 root root 18 Jan 29 14:29 run
lrwxrwxrwx. 1 root root 8 Jan 28 10:42 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Dec 14 2017 srv
dr-xr-xr-x. 13 root root 0 Feb 26 06:52 sys
drwxrwxrwt. 1 root root 6 Jan 29 14:29 tmp
drwxr-xr-x. 1 root root 69 Jan 29 14:13 usr
drwxr-xr-x. 1 root root 52 Jan 28 10:42 var
total 4.0K
-rwx------. 1 root root 836 Jan 28 10:42 ks-script-bn8Lhj
-rw-------. 1 root root 0 Jan 28 10:42 yum.log
ls: cannot open directory /opt/app-root: Permission denied
2020/02/27 06:47:57 [go-init] Pre-start command failed
2020/02/27 06:47:57 [go-init] exit status 2
Actual behavior
Expected behavior
Any logs, error output, etc?
The text was updated successfully, but these errors were encountered: