Persistent Volume folder permissions

Hi there,

I’m trying to setup Jenkins on Rancher 2.0 from official docker image (jenkins/jenkins:lts) and put its work folder (/var/jenkins_home) on Longhorn Persistent Volume.

Got an error on container creating:
/var/jenkins_home/copy_reference_file.log: Permission denied
Found a GitHub issue with the same problem but since i’m not using bind mounts thats not particularly helpful.

What am i doing wrong? Thanks in advance.

1 Like

I’ve got the same problem.
Persistent storage dir is /data.
Added /data/var/jenkins_home as a volume while creating the workload.

Results in the same Error.
Tried creating a user and group jenkins and chown -R jenkins:jenkins /data/var and chmod 777 these folders.
Same Error still.

I’ve got no clou how to fix this. Any help would be much appreciated.

I’ve this problems too.

To solve you will need to set owner as 1000:1000 at node.
node folder: /var/local/jenkins_home
container folder: /var/jenkins_home

$ chown -R 1000:1000 /var/local/jenkins_home

change this and try again :wink:

I am having a similar issue with Longhorn volumes in a Rancher 2.0 RKE cluster.

My storage class is auto provisioning volumes, the volumes get bound, and the mounts succeed in the Events for the pod, but the volume never actually mounts in the container OS. All the volumes show up in /proc/partitions but not in the “mount” listing. Instead all the persistent volume mounts appear to try to remount /dev/sda.


volumeMounts:
- mountPath: /mssql-data/data
name: data
- mountPath: /mssql-translog/translog
name: transactionlog
- mountPath: /mssql-backup/backup
name: backup
- mountPath: /mssql-data/master
name: master
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: data
persistentVolumeClaim:
claimName: mssql-linux-mssql-linux-data
- name: transactionlog
persistentVolumeClaim:
claimName: mssql-linux-mssql-linux-translog
- name: backup
persistentVolumeClaim:
claimName: mssql-linux-mssql-linux-backup
- name: master
persistentVolumeClaim:
claimName: mssql-linux-mssql-linux-master


root@mssql-linux-mssql-linux-95d987f66-6rz4d:/# mount | grep mssql
/dev/sda on /mssql-data/data type ext4 (rw,relatime,data=ordered)
/dev/sda on /mssql-translog/translog type ext4 (rw,relatime,data=ordered)
/dev/sda on /mssql-backup/backup type ext4 (rw,relatime,data=ordered)
/dev/sda on /mssql-data/master type ext4 (rw,relatime,data=ordered)
root@mssql-linux-mssql-linux-95d987f66-6rz4d:/#
root@mssql-linux-mssql-linux-95d987f66-6rz4d:/# cat /proc/partitions
major minor #blocks name

11 0 102400 sr0
8 0 102400000 sda
8 64 10485760 sde
8 16 1048576 sdb
8 32 1048576 sdc
8 48 1048576 sdd
8 96 1048576 sdg
root@mssql-linux-mssql-linux-95d987f66-6rz4d:/#

Could you please tell, how to access node command line?