-
Notifications
You must be signed in to change notification settings - Fork 632
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
AWXBackup: mkdir: cannot create directory '/backups/tower-openshift-backup-2024-04-17-141257': Permission denied #1830
Comments
Hello @PWeverton, can you read through this issue and see if it applies to your case #1775? The new postgres image is expecting to write to your dir as uid-26. There are some workarounds discussed to address the change. |
Hello @jessicamack, thanks for replying.
apiVersion: awx.ansible.com/v1beta1 Even after this change, the issue with the permissions still there. |
This issue is not addressed by #1805 (
So we should implement init container for @rooftopcellist |
hi @kurokobo, any movement here? |
I just made PR #1854 , I'm able to take successful backups now if I run that init container once per PVC |
Please add this chang to the next Release since awxbackup also cannot create directory in my deployment because of permission issues. Changing the permissions on the NFS server to User ID 26 solved it but this is an manuall configuration step das workarround. |
May it helps someone, i workaround this problem by creating a cronjob which crates my backup and added an initcontainer which sets the permissions to 26:26 on the backup folder. |
I hit this issue after upgrading to 2.15.0. As per @pombaer first suggestion, I added another NFS mount and set the owner UID and GID to 26, then created a new PV/PVC and pushed the backup to that. |
Did this issue get resolved? I have the same issue running 2.19.1 Interestingly if I change the Postgres in my awxbackup.yml to
The issue goes away for the "mkdir: cannot create directory '/backups': Permission denied" and I can take a successful backup. However this just shifts my issue to a restore problem of. "pg_restore: error: unsupported version (1.15) in file header" So I went back and modified the permissions to 26 on the /backups and it works, but my hack was dirty so wondering the correct way this will be done.
running k3s. |
The PR still open and seems it will take a while to be merged. roles/backup/templates/management-pod.yml.j2 1 - Add an init container initContainers: 2 - Run the container with privileged user containers:
Once you have it in place, just build the image and set the image url on your operator deployment. |
Please confirm the following
Bug Summary
Upgraded awx operator from 1.1.4 to 2.13.1 and started to get issues when trying to take backups.
Here`s an example of the AWXBackup I have:
apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
name: awx-demo
namespace: awx-test
spec:
deployment_name: awx-demo
backup_pvc: 'backup-pvc'
no_log: false
Once applied, operator tries to create a folder for the backup on the db-management pod. However, its getting the issue permission denied
[backup : Set backup directory name] **************************************\r\ntask path: /opt/ansible/roles/backup/tasks/postgres.yml:55\nok: [localhost] => {"ansible_facts": {"backup_dir": "/backups/tower-openshift-backup-2024-04-17-141257"}, "changed": false}\n\r\nTASK [backup : Create directory for backup] ************************************\r\ntask path: /opt/ansible/roles/backup/tasks/postgres.yml:59\nansible.cfg.\nfatal: [localhost]: FAILED! => {"changed": true, "rc": 1, "return_code": 1, "stderr": "mkdir: cannot create directory '/backups/tower-openshift-backup-2024-04-17-141257': Permission denied\n", "stderr_lines": ["mkdir: cannot create directory '/backups/tower-openshift-backup-2024-04-17-141257': Permission denied"]
AWX Operator version
2.13.1
AWX version
24.0.0
Kubernetes platform
kubernetes
Kubernetes/Platform version
microk8s v1.28.8
Modifications
no
Steps to reproduce
Fresh installation and trying to create a backup using AWXBackup CR.
Expected results
Take the backup successfully
Actual results
Failed backup
Additional information
No response
Operator Logs
No response
The text was updated successfully, but these errors were encountered: