Issue
If you are using CloudBees CI on modern cloud platforms and you find that the UID of the files in your Persistent Volume (PV) does not match the UID of user running the container, you may be experiencing an issue with the StorageClass configuration.
Also if you try to modify the fsGroup
or use chmod
to change the permissions of the files in the PV, you will find it does not resolve the issue.
One example of a UID mismatch causing issues is After upgrading, git checkouts fail due to JENKINS-70534.
Resolution
Consult the documentation for your chosen StorageClass to determine the correct configuration to set the UID.
If using Amazon EFS CSI Driver there is a uid
parameter, which can be configured in the helm values, under the parameters
for storageClasses
, Storage Class Parameters for Dynamic Provisioning.
Here is the code that sets the UID of the files in the PV to 1000 in the CloudBees CI add-on for Amazon EKS blueprints: https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/pull/193/files#diff-71b6e140f3e821b03b2bfcc484ff130c17b3439e4bd63b0d1d582610df7b04fdR735
The following is an example of a StorageClass configuration that sets the UID (and GID) of the files in the PV to 1000:
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: ... parameters: ... uid: "1000" gid: "1000" ...