Skip to content
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

[pvc] /workspace directory is owned by nobody #14003

Closed
Tracked by #7901
WVerlaek opened this issue Oct 19, 2022 · 6 comments · Fixed by #14096 or #14420
Closed
Tracked by #7901

[pvc] /workspace directory is owned by nobody #14003

WVerlaek opened this issue Oct 19, 2022 · 6 comments · Fixed by #14096 or #14420
Assignees
Labels
team: workspace Issue belongs to the Workspace team type: bug Something isn't working

Comments

@WVerlaek
Copy link
Member

WVerlaek commented Oct 19, 2022

Bug description

/workspace directory is owned by nobody

Steps to reproduce

On a workspace with PVC enabled, the /workspace directory is owned by nobody:

$ ls -al /
...
drwxrwsr-x  13 nobody gitpod  4096 Oct 19 13:13 workspace

This prevents e.g. the root user from making a new directory inside /workspace (but it's fine when done from the gitpod user):

$ sudo mkdir -p /workspace/directory
mkdir: cannot create directory ‘/workspace/directory’: Permission denied

With pvc disabled, it's owned by gitpod:

$ ls -al /
...
drwxr-xr-x   7 gitpod gitpod   98 Oct 19 13:41 workspace

Workspace affected

No response

Expected behavior

The prebuild workspace should be up and running.

Example repository

No response

Anything else?

#7901

@WVerlaek WVerlaek added type: bug Something isn't working team: workspace Issue belongs to the Workspace team labels Oct 19, 2022
@kylos101 kylos101 moved this to Breakdown in 🌌 Workspace Team Oct 19, 2022
@sagor999 sagor999 moved this from Breakdown to Scheduled in 🌌 Workspace Team Oct 20, 2022
@sagor999 sagor999 self-assigned this Oct 20, 2022
@sagor999 sagor999 moved this from Scheduled to In Progress in 🌌 Workspace Team Oct 20, 2022
@sagor999
Copy link
Contributor

This is due to the way k8s mounts PVC. It mounts folder as root:root.
We specify FSGroup here when mounting that pvc, so that at least it is owned by gitpod group, but there is no k8s way of specifying user that should be used to mount that folder AFAIK.
One workaround that I know of is to use init container that would do chown on that folder to change ownership to gitpod user. It only needs to do chown on that folder only, not recursive, so it should be very fast.

@jenting @WVerlaek do you guys know a better way?

@WVerlaek
Copy link
Member Author

Not aware of a better solution, I think the init container + chown approach makes sense

@jenting
Copy link
Contributor

jenting commented Oct 21, 2022

Not aware of a better solution, I think the init container + chown approach makes sense

+1

Question: I thought we need to recursive all the files and folders to change the UID, doesn't it?

@sagor999
Copy link
Contributor

Current progress is blocked until we resolve this: #14103

@kylos101
Copy link
Contributor

@sagor999 are you still blocked on this issue? I assume no, because @utam0k shipped #14103.

@sagor999 sagor999 removed the blocked label Oct 28, 2022
@sagor999
Copy link
Contributor

nope. PR with fix is pending review.

Repository owner moved this from In Progress to Awaiting Deployment in 🌌 Workspace Team Nov 2, 2022
@Furisto Furisto moved this from Awaiting Deployment to In Validation in 🌌 Workspace Team Nov 21, 2022
@jenting jenting removed the status in 🌌 Workspace Team Nov 22, 2022
@jenting jenting moved this to Done in 🌌 Workspace Team Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: workspace Issue belongs to the Workspace team type: bug Something isn't working
Projects
No open projects
Status: Done
4 participants