AWX restore failing with error- " The task includes an option with an undefined variable. “The error was: ‘dict object’ has no attribute ‘backupClaim’”
running awx-operator version 2.5.2 awx version 23.0.0
apiVersion: awx.ansible.com/v1beta1
kind: AWXBackup
metadata:
name: awx-backup-migration
namespace: awx-restore
spec:
deployment_name: awx-iaas-restore
apiVersion: awx.ansible.com/v1beta1
kind: AWXRestore
metadata:
name: awx-backup-restore
namespace: awx-restore
spec:
deployment_name: awx-iaas-restore
backup_name: awx-backup-migration
no_log: False
force_drop_db: true
kubectl get pvc -n awx-restore | grep backup
awx-iaas-restore-backup-claim Bound pvc-4fba7eb6-5c7e-4b75-8aae-228997456ae8 5Gi RWO csi-cinder <unset> 32m
-------------------------------------------------------------------------------
{"level":"error","ts":"2024-10-22T22:52:58Z","logger":"runner","msg":"ansible-playbook 2.9.27\r\n config file = /etc/ansible/ansible.cfg\r\n configured module search path = ['/usr/share/ansible/openshift']\r\n ansible python module location = /usr/local/lib/python3.8/site-packages/ansible\r\n executable location = /usr/local/bin/ansible-playbook\r\n python version = 3.8.13 (default, Jun 14 2022, 17:49:07) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]\r\nUsing /etc/ansible/ansible.cfg as config file\r\nSkipping callback 'actionable', as we already have a stdout callback.\nSkipping callback 'awx_display', as we already have a stdout callback.\nSkipping callback 'counter_enabled', as we already have a stdout callback.\nSkipping callback 'debug', as we already have a stdout callback.\nSkipping callback 'dense', as we already have a stdout callback.\nSkipping callback 'dense', as we already have a stdout callback.\nSkipping callback 'full_skip', as we already have a stdout callback.\nSkipping callback 'json', as we already have a stdout callback.\nSkipping callback 'minimal', as we already have a stdout callback.\nSkipping callback 'null', as we already have a stdout callback.\nSkipping callback 'oneline', as we already have a stdout callback.\nSkipping callback 'selective', as we already have a stdout callback.\nSkipping callback 'skippy', as we already have a stdout callback.\nSkipping callback 'stderr', as we already have a stdout callback.\nSkipping callback 'unixy', as we already have a stdout callback.\nSkipping callback 'yaml', as we already have a stdout callback.\n\r\nPLAYBOOK: 389905579f5146beae48ad45bdf417d1 *************************************\n1 plays in /tmp/ansible-operator/runner/awx.ansible.com/v1beta1/AWXRestore/awx-restore/awx-backup-restore/project/389905579f5146beae48ad45bdf417d1\n[WARNING]: Found variable using reserved name: no_log\n\r\nPLAY [localhost] ***************************************************************\nMETA: ran handlers\n\r\nTASK [common : Get information about the cluster] ******************************\r\ntask path: /opt/ansible/roles/common/tasks/main.yml:3\nok: [localhost] => {\"ansible_facts\": {\"api_groups\": [\"\", \"apiregistration.k8s.io\", \"apps\", \"events.k8s.io\", \"authentication.k8s.io\", \"authorization.k8s.io\", \"autoscaling\", \"batch\", \"certificates.k8s.io\", \"networking.k8s.io\", \"policy\", \"rbac.authorization.k8s.io\", \"storage.k8s.io\", \"admissionregistration.k8s.io\", \"apiextensions.k8s.io\", \"scheduling.k8s.io\", \"coordination.k8s.io\", \"node.k8s.io\", \"discovery.k8s.io\", \"flowcontrol.apiserver.k8s.io\", \"catalog.cattle.io\", \"crd.projectcalico.org\", \"externaldns.nginx.org\", \"helm.cattle.io\", \"k3s.cattle.io\", \"k8s.nginx.org\", \"snapshot.storage.k8s.io\", \"ui.cattle.io\", \"upgrade.cattle.io\", \"awx.ansible.com\", \"appprotect.f5.com\", \"appprotectdos.f5.com\", \"management.cattle.io\", \"metrics.k8s.io\"]}, \"changed\": false}\n\r\nTASK [common : Determine the cluster type] *************************************\r\ntask path: /opt/ansible/roles/common/tasks/main.yml:10\nok: [localhost] => {\"ansible_facts\": {\"is_k8s\": true, \"is_openshift\": false}, \"changed\": false}\n\r\nTASK [common : debug] **********************************************************\r\ntask path: /opt/ansible/roles/common/tasks/main.yml:19\nok: [localhost] => {\r\n \"msg\": \"CLUSTER TYPE: is_openshift=False; is_k8s=True\"\r\n}\n\r\nTASK [restore : Patching labels to AWXRestore kind] ****************************\r\ntask path: /opt/ansible/roles/restore/tasks/main.yml:2\nok: [localhost] => {\"changed\": false, \"method\": \"update\", \"result\": {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"kind\": \"AWXRestore\", \"metadata\": {\"annotations\": {\"kubectl.kubernetes.io/last-applied-configuration\": \"{\\\"apiVersion\\\":\\\"awx.ansible.com/v1beta1\\\",\\\"kind\\\":\\\"AWXRestore\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"awx-backup-restore\\\",\\\"namespace\\\":\\\"awx-restore\\\"},\\\"spec\\\":{\\\"backup_name\\\":\\\"awx-backup-migration\\\",\\\"deployment_name\\\":\\\"awx-iaas-restore\\\",\\\"force_drop_db\\\":true,\\\"no_log\\\":false}}\\n\"}, \"creationTimestamp\": \"2024-10-22T22:52:47Z\", \"generation\": 1, \"labels\": {\"app.kubernetes.io/component\": \"awx\", \"app.kubernetes.io/managed-by\": \"awx-operator\", \"app.kubernetes.io/operator-version\": \"2.5.2\", \"app.kubernetes.io/part-of\": \"awx-backup-restore\"}, \"managedFields\": [{\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:annotations\": {\".\": {}, \"f:kubectl.kubernetes.io/last-applied-configuration\": {}}}, \"f:spec\": {\".\": {}, \"f:backup_name\": {}, \"f:deployment_name\": {}, \"f:force_drop_db\": {}, \"f:image_pull_policy\": {}, \"f:no_log\": {}, \"f:set_self_labels\": {}}}, \"manager\": \"kubectl-client-side-apply\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:52:47Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:labels\": {\".\": {}, \"f:app.kubernetes.io/component\": {}, \"f:app.kubernetes.io/managed-by\": {}, \"f:app.kubernetes.io/operator-version\": {}, \"f:app.kubernetes.io/part-of\": {}}}}, \"manager\": \"OpenAPI-Generator\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:52:49Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:status\": {\".\": {}, \"f:conditions\": {}}}, \"manager\": \"ansible-operator\", \"operation\": \"Update\", \"subresource\": \"status\", \"time\": \"2024-10-22T22:52:54Z\"}], \"name\": \"awx-backup-restore\", \"namespace\": \"awx-restore\", \"resourceVersion\": \"16159639\", \"uid\": \"bd21c2fd-48ba-4012-b379-5848c9e0d6fc\"}, \"spec\": {\"backup_name\": \"awx-backup-migration\", \"deployment_name\": \"awx-iaas-restore\", \"force_drop_db\": true, \"image_pull_policy\": \"IfNotPresent\", \"no_log\": false, \"set_self_labels\": true}, \"status\": {\"conditions\": [{\"lastTransitionTime\": \"2024-10-22T22:52:50Z\", \"reason\": \"\", \"status\": \"False\", \"type\": \"Successful\"}, {\"lastTransitionTime\": \"2024-10-22T22:52:54Z\", \"reason\": \"Failed\", \"status\": \"False\", \"type\": \"Failure\"}, {\"lastTransitionTime\": \"2024-10-22T22:52:54Z\", \"reason\": \"Running\", \"status\": \"True\", \"type\": \"Running\"}]}}}\n\r\nTASK [Look up details for this restore object] *********************************\r\ntask path: /opt/ansible/roles/restore/tasks/main.yml:16\nok: [localhost] => {\"api_found\": true, \"changed\": false, \"resources\": [{\"apiVersion\": \"awx.ansible.com/v1beta1\", \"kind\": \"AWXRestore\", \"metadata\": {\"annotations\": {\"kubectl.kubernetes.io/last-applied-configuration\": \"{\\\"apiVersion\\\":\\\"awx.ansible.com/v1beta1\\\",\\\"kind\\\":\\\"AWXRestore\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"awx-backup-restore\\\",\\\"namespace\\\":\\\"awx-restore\\\"},\\\"spec\\\":{\\\"backup_name\\\":\\\"awx-backup-migration\\\",\\\"deployment_name\\\":\\\"awx-iaas-restore\\\",\\\"force_drop_db\\\":true,\\\"no_log\\\":false}}\\n\"}, \"creationTimestamp\": \"2024-10-22T22:52:47Z\", \"generation\": 1, \"labels\": {\"app.kubernetes.io/component\": \"awx\", \"app.kubernetes.io/managed-by\": \"awx-operator\", \"app.kubernetes.io/operator-version\": \"2.5.2\", \"app.kubernetes.io/part-of\": \"awx-backup-restore\"}, \"managedFields\": [{\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:annotations\": {\".\": {}, \"f:kubectl.kubernetes.io/last-applied-configuration\": {}}}, \"f:spec\": {\".\": {}, \"f:backup_name\": {}, \"f:deployment_name\": {}, \"f:force_drop_db\": {}, \"f:image_pull_policy\": {}, \"f:no_log\": {}, \"f:set_self_labels\": {}}}, \"manager\": \"kubectl-client-side-apply\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:52:47Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:labels\": {\".\": {}, \"f:app.kubernetes.io/component\": {}, \"f:app.kubernetes.io/managed-by\": {}, \"f:app.kubernetes.io/operator-version\": {}, \"f:app.kubernetes.io/part-of\": {}}}}, \"manager\": \"OpenAPI-Generator\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:52:49Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:status\": {\".\": {}, \"f:conditions\": {}}}, \"manager\": \"ansible-operator\", \"operation\": \"Update\", \"subresource\": \"status\", \"time\": \"2024-10-22T22:52:54Z\"}], \"name\": \"awx-backup-restore\", \"namespace\": \"awx-restore\", \"resourceVersion\": \"16159639\", \"uid\": \"bd21c2fd-48ba-4012-b379-5848c9e0d6fc\"}, \"spec\": {\"backup_name\": \"awx-backup-migration\", \"deployment_name\": \"awx-iaas-restore\", \"force_drop_db\": true, \"image_pull_policy\": \"IfNotPresent\", \"no_log\": false, \"set_self_labels\": true}, \"status\": {\"conditions\": [{\"lastTransitionTime\": \"2024-10-22T22:52:50Z\", \"reason\": \"\", \"status\": \"False\", \"type\": \"Successful\"}, {\"lastTransitionTime\": \"2024-10-22T22:52:54Z\", \"reason\": \"Failed\", \"status\": \"False\", \"type\": \"Failure\"}, {\"lastTransitionTime\": \"2024-10-22T22:52:54Z\", \"reason\": \"Running\", \"status\": \"True\", \"type\": \"Running\"}]}}]}\n\r\nTASK [restore : Build `additional_labels_items` labels from `additional_labels`] ***\r\ntask path: /opt/ansible/roles/restore/tasks/main.yml:24\nskipping: [localhost] => {\"changed\": false, \"skip_reason\": \"Conditional result was False\"}\n\r\nTASK [restore : include_tasks] *************************************************\r\ntask path: /opt/ansible/roles/restore/tasks/main.yml:35\nstatically imported: /opt/ansible/roles/restore/tasks/error_handling.yml\nstatically imported: /opt/ansible/roles/restore/tasks/error_handling.yml\nstatically imported: /opt/ansible/roles/restore/tasks/error_handling.yml\nincluded: /opt/ansible/roles/restore/tasks/init.yml for localhost\n\r\nTASK [restore : Look up details for the backup] ********************************\r\ntask path: /opt/ansible/roles/restore/tasks/init.yml:5\nok: [localhost] => {\"api_found\": true, \"changed\": false, \"resources\": [{\"apiVersion\": \"awx.ansible.com/v1beta1\", \"kind\": \"AWXBackup\", \"metadata\": {\"annotations\": {\"kubectl.kubernetes.io/last-applied-configuration\": \"{\\\"apiVersion\\\":\\\"awx.ansible.com/v1beta1\\\",\\\"kind\\\":\\\"AWXBackup\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"awx-backup-migration\\\",\\\"namespace\\\":\\\"awx-restore\\\"},\\\"spec\\\":{\\\"deployment_name\\\":\\\"awx-iaas-restore\\\"}}\\n\"}, \"creationTimestamp\": \"2024-10-22T22:51:21Z\", \"finalizers\": [\"awx.ansible.com/finalizer\"], \"generation\": 1, \"labels\": {\"app.kubernetes.io/component\": \"awx\", \"app.kubernetes.io/managed-by\": \"awx-operator\", \"app.kubernetes.io/operator-version\": \"2.5.2\", \"app.kubernetes.io/part-of\": \"awx-backup-migration\"}, \"managedFields\": [{\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:finalizers\": {\".\": {}, \"v:\\\"awx.ansible.com/finalizer\\\"\": {}}}}, \"manager\": \"ansible-operator\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:51:21Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:annotations\": {\".\": {}, \"f:kubectl.kubernetes.io/last-applied-configuration\": {}}}, \"f:spec\": {\".\": {}, \"f:deployment_name\": {}, \"f:image_pull_policy\": {}, \"f:no_log\": {}, \"f:set_self_labels\": {}}}, \"manager\": \"kubectl-client-side-apply\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:51:21Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:metadata\": {\"f:labels\": {\".\": {}, \"f:app.kubernetes.io/component\": {}, \"f:app.kubernetes.io/managed-by\": {}, \"f:app.kubernetes.io/operator-version\": {}, \"f:app.kubernetes.io/part-of\": {}}}}, \"manager\": \"OpenAPI-Generator\", \"operation\": \"Update\", \"time\": \"2024-10-22T22:51:23Z\"}, {\"apiVersion\": \"awx.ansible.com/v1beta1\", \"fieldsType\": \"FieldsV1\", \"fieldsV1\": {\"f:status\": {\".\": {}, \"f:conditions\": {}}}, \"manager\": \"ansible-operator\", \"operation\": \"Update\", \"subresource\": \"status\", \"time\": \"2024-10-22T22:52:28Z\"}], \"name\": \"awx-backup-migration\", \"namespace\": \"awx-restore\", \"resourceVersion\": \"16159405\", \"uid\": \"12f4ee8a-8340-4add-9ba0-49302d68f145\"}, \"spec\": {\"deployment_name\": \"awx-iaas-restore\", \"image_pull_policy\": \"IfNotPresent\", \"no_log\": true, \"set_self_labels\": true}, \"status\": {\"conditions\": [{\"lastTransitionTime\": \"2024-10-22T22:51:37Z\", \"reason\": \"\", \"status\": \"False\", \"type\": \"Successful\"}, {\"lastTransitionTime\": \"2024-10-22T22:52:28Z\", \"reason\": \"Failed\", \"status\": \"False\", \"type\": \"Failure\"}, {\"lastTransitionTime\": \"2024-10-22T22:52:28Z\", \"reason\": \"Running\", \"status\": \"True\", \"type\": \"Running\"}]}}]}\n\r\nTASK [restore : Set error message] *********************************************\r\ntask path: /opt/ansible/roles/restore/tasks/init.yml:15\nskipping: [localhost] => {\"changed\": false, \"skip_reason\": \"Conditional result was False\"}\n\r\nTASK [restore : Determine the timestamp] ***************************************\r\ntask path: /opt/ansible/roles/restore/tasks/error_handling.yml:3\nskipping: [localhost] => {\"changed\": false, \"skip_reason\": \"Conditional result was False\"}\n\r\nTASK [restore : Emit ocp event with error] *************************************\r\ntask path: /opt/ansible/roles/restore/tasks/error_handling.yml:7\nskipping: [localhost] => {\"changed\": false, \"skip_reason\": \"Conditional result was False\"}\n\r\nTASK [restore : Fail early if pvc is defined but does not exist] ***************\r\ntask path: /opt/ansible/roles/restore/tasks/init.yml:22\nskipping: [localhost] => {\"changed\": false, \"skip_reason\": \"Conditional result was False\"}\n\r\nTASK [restore : Set backup facts] **********************************************\r\ntask path: /opt/ansible/roles/restore/tasks/init.yml:32\nfatal: [localhost]: FAILED! => {\"msg\": \"The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'backupClaim'\\n\\nThe error appears to be in '/opt/ansible/roles/restore/tasks/init.yml': line 32, column 7, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n - name: Set backup facts\\n ^ here\\n\"}\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost : ok=7 changed=0 unreachable=0 failed=1 skipped=5 rescued=0 ignored=0 \r\n\n","job":"3365367498871490098","name":"awx-backup-restore","namespace":"awx-restore","error":"exit status 2","stacktrace":"github.com/operator-framework/operator-sdk/internal/ansible/runner.(*runner).Run.func1\n\t/workspace/internal/ansible/runner/runner.go:269"}