Bug: failing to change ownership of the NFS based PVC for PostgreSQL pod by using kube_pv_chown utility
See original GitHub issueEnvironment info
- NooBaa Version: 4.9.10, 4.10.5 (NooBaa operator version)
- Platform: OpenShift 4.10.22
- Storage class from NetApp filer provided over Trident CSI (backendType: ontap-nas-economy)
Actual behavior
- pod noobaa-db-pg-0 stuck in crash loop of the init container with following error message:
uid change has been identified - will change from uid: 99 to new uid: 10001
setting permissions of /var/lib/pgsql for user 10001
Error:got error when changing ownership of /var/lib/pgsql Error: Operation not permitted
real 0m0.005s
user 0m0.003s
sys 0m0.001s
Error from server (BadRequest): container "initialize-database" in pod "noobaa-db-pg-0" is waiting to start: PodInitializing
Expected behavior
- Pod starts.
Steps to reproduce
- Deploy ODF in standalone MCG mode (or noobaa operator) with postgres DB backend PVC from NFS storage.
More information - Screenshots / Logs / Other output
It might be because NFS storage is exported with root_squash option?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Permission/Owner errors when provisioning application with ...
I've made a nfs-client provider with a StorageClass named default. ... Pod: gitlab-postgresql-701477374-zh52g chown: changing ownership of ...
Read more >Postgresql pod is error when using persistent storage
Bug 1380805 - Postgresql pod is error when using persistent storage ... FATAL: data directory "/var/lib/pgsql/data/userdata" has wrong ownership HINT: The ...
Read more >chown: changing ownership of '/data/db': Operation not ...
The data is persisted to an overlay specific to the pod. Kubernetes mounts all volumes as 0755 root.root, regardless of what the permissions...
Read more >Can't get either Postgres permissions or PVC working in AKS
When using the subPath in volumeMounts , the permission issue is automatically addressed, as the user postgres owns the folder corresponding to the...
Read more >Mounted directory has the wrong ownership
I have the following kubernetes yaml file: 1 apiVersion: apps/v1 1 kind: Deployment 2 metadata: 3 name: postgres-deployment 4 spec: 5 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I just tested it and it could start with no issues with my suggested changes (mounted modified script from the configmap):
Thanks @maratsal
root squash could very much be the root cause, our db init containers are a mess of trying to fix pvc permissions using root group (gid 0) and hacks to overcome postgres hugepages issue.
I wonder if you manually went to that pvc filesystem as root (or as current owner uid 99) and did a
chown -R 10001:0 <db-volume-path>- would the init container run ok?@dannyzaken @jackyalbo and @baum would probably know how to fix this problem.