Skip to content

[PVC] the files and folders under .git/ permission is incorrect #12420

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

Closed
Tracked by #7901
jenting opened this issue Aug 26, 2022 · 5 comments · Fixed by #12422 or #12896
Closed
Tracked by #7901

[PVC] the files and folders under .git/ permission is incorrect #12420

jenting opened this issue Aug 26, 2022 · 5 comments · Fixed by #12422 or #12896
Assignees
Labels
component: content-service team: workspace Issue belongs to the Workspace team type: bug Something isn't working

Comments

@jenting
Copy link
Contributor

jenting commented Aug 26, 2022

Bug description

The files and folders under .git/ permission are incorrect. Some files and folders permission under .git/* with correct permission gitpod:gitpod, but some folders permission under .git/object/* is root:root.

It causes when we want to git add the change, we encounter the permission error.

$ git add .
error: insufficient permission for adding an object to repository database .git/objects
error: go.mod: failed to insert into database
error: unable to index file 'go.mod'
fatal: updating files failed
.git/* files and folders permission
$ ls -al .git/
total 68
drwxr-xr-x  8 gitpod gitpod 4096 Aug 26 02:25 .
drwxr-xr-x 10 gitpod gitpod 4096 Aug 26 02:25 ..
-rw-r--r--  1 root   root     41 Aug 26 02:25 AUTO_MERGE
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 branches
-rw-r--r--  1 gitpod gitpod  643 Aug 26 02:25 config
-rw-r--r--  1 gitpod gitpod   73 Aug 10 05:17 description
-rw-r--r--  1 gitpod gitpod  111 Aug 26 02:25 FETCH_HEAD
-rw-r--r--  1 root   root     39 Aug 26 02:25 HEAD
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 hooks
-rw-r--r--  1 root   root   4753 Aug 26 02:25 index
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 info
drwxr-xr-x  3 gitpod gitpod 4096 Aug 10 05:17 logs
drwxr-xr-x 80 gitpod gitpod 4096 Aug 26 02:25 objects
-rw-r--r--  1 gitpod gitpod   41 Aug 24 03:12 ORIG_HEAD
-rw-r--r--  1 gitpod gitpod  808 Aug 24 03:12 packed-refs
drwxr-xr-x  5 gitpod gitpod 4096 Aug 26 02:25 refs
.git/objects/ files and folders permission
$ ls -al .git/objects/
total 320
drwxr-xr-x 80 gitpod gitpod 4096 Aug 26 02:25 .
drwxr-xr-x  8 gitpod gitpod 4096 Aug 26 02:25 ..
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 08
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 09
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 0d
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 10
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 12
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 13
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 1a
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 1b
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 1c
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 1d
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 1e
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 1f
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 20
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 25
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 28
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 2a
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 2b
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 2e
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 33
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 34
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 35
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 3e
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 41
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 42
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 43
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 44
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 45
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 46
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 4d
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 4f
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 56
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 5b
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 64
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 7b
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 7d
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 82
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 83
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 87
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 88
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 89
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 8e
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 92
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 95
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 96
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 9d
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 9e
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 a1
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 a3
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 a6
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 a8
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 ae
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 b3
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 b8
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 b9
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 bd
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 c8
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 ca
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 cb
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 cc
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 d0
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 d1
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 d2
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 d5
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 d6
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 d7
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 da
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 de
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 e2
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 e4
drwxr-xr-x  2 root   root   4096 Aug 26 02:25 ea
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 ec
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 ef
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 f9
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 fb
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 fd
drwxr-xr-x  2 gitpod gitpod 4096 Aug 24 03:12 ff
drwxr-xr-x  2 gitpod gitpod 4096 Aug 10 05:17 info
drwxr-xr-x  2 gitpod gitpod 4096 Aug 26 02:25 pack

Steps to reproduce

  • Enable the PVC feature flag
  • Open my project's PR with Gitpod
  • Check the .git/objects folders permission

Workspace affected

No response

Expected behavior

No response

Example repository

No response

Anything else?

#7901

@jenting jenting added the type: bug Something isn't working label Aug 26, 2022
@jenting jenting added team: workspace Issue belongs to the Workspace team component: content-service labels Aug 26, 2022
@jenting jenting changed the title [PVC] the folderss under .git/ permission is incorrect [PVC] the files and folders under .git/ permission is incorrect Aug 26, 2022
@sagor999
Copy link
Contributor

Caused by this PR: #12238

@jenting jenting moved this to In Progress in 🌌 Workspace Team Aug 26, 2022
@jenting jenting self-assigned this Aug 26, 2022
Repository owner moved this from In Progress to Awaiting Deployment in 🌌 Workspace Team Aug 26, 2022
@jenting jenting moved this from Awaiting Deployment to In Progress in 🌌 Workspace Team Sep 8, 2022
@jenting jenting moved this from In Progress to In Validation in 🌌 Workspace Team Sep 8, 2022
@jenting
Copy link
Contributor Author

jenting commented Sep 10, 2022

If the repo is without submodules, the issue is fixed.
If the repo is with submodules, the issue is still open.

If the repo opens from prebuild, the issue is still open.
If the repo is not open from prebuild, the issue is fixed.

@jenting jenting reopened this Sep 10, 2022
@jenting jenting moved this from In Validation to Breakdown in 🌌 Workspace Team Sep 10, 2022
@kylos101 kylos101 moved this from Breakdown to Scheduled in 🌌 Workspace Team Sep 11, 2022
@kylos101
Copy link
Contributor

👋 @jenting I moved this issue from Breakdown to Scheduled, as you identified the reason this is still open here. Thank you for the find!

@sagor999
Copy link
Contributor

Since I spend a bit of time debugging a wrong issue, for posterity:
PVC prebuild -> PVC workspace = works
regular prebuild -> PVC workspace = broken

@jenting
Copy link
Contributor Author

jenting commented Sep 13, 2022

Since I spend a bit of time debugging a wrong issue, for posterity: PVC prebuild -> PVC workspace = works regular prebuild -> PVC workspace = broken

Thank you @sagor999.

I forget to mention it happens in regular prebuild -> PVC workspace.
But it's good that you have verified PVC prebuild -> PVC workspace works because I missed testing this case yesterday.

Repository owner moved this from In Progress to Awaiting Deployment in 🌌 Workspace Team Sep 13, 2022
@sagor999 sagor999 moved this from Awaiting Deployment to In Validation in 🌌 Workspace Team Sep 21, 2022
@sagor999 sagor999 moved this from In Validation to Done in 🌌 Workspace Team Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: content-service team: workspace Issue belongs to the Workspace team type: bug Something isn't working
Projects
No open projects
Status: Done
3 participants