# AWX Backup Fails

**URL:** <https://forum.ansible.com/t/awx-backup-fails/7739>\
**Category:** Get Help\
**Tags:** playbook, awx, kubernetes\
**Created:** [August 8, 2024, 11:57am UTC](https://forum.ansible.com/t/awx-backup-fails/7739 "2024-08-08T11:57:44Z")\
**Posts on this page:** 9\
**Page:** 4

<div class="post-metadata">

**Author:** ![jeremytourville](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jeremytourville/32/2448_2.png) [@jeremytourville](https://forum.ansible.com/u/jeremytourville)\
**Post date:** [September 27, 2024, 1:37pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/62 "2024-09-27T13:37:51Z")

</div>

OK, after making that change and confirming that the backup directory is located on the server that is running the pod, I get an issue with restoring for this failed task:

`TASK: Restore database_dump to the new postgresql container`

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 27, 2024, 1:43pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/63 "2024-09-27T13:43:50Z")

</div>

Make some investigations on your side; adding `no_log: false` to your `AWXRestore` may help you 😃

---

<div class="post-metadata">

**Author:** ![jeremytourville](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jeremytourville/32/2448_2.png) [@jeremytourville](https://forum.ansible.com/u/jeremytourville)\
**Post date:** [September 27, 2024, 1:56pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/64 "2024-09-27T13:56:58Z")

</div>

I added the no\_log: false parameter to the spec file. It looks like the job is failing because password authentication fails to database ‘awx’ for user ‘awx’.

I am not understanding how this could be. I thought these values are part of the backup from the old cluster. How can this happen? 🤔

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 27, 2024, 2:01pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/65 "2024-09-27T14:01:39Z")

</div>

Have you confirmed that your PV for your PSQL on the new cluster is empty before restoring?

---

<div class="post-metadata">

**Author:** ![jeremytourville](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jeremytourville/32/2448_2.png) [@jeremytourville](https://forum.ansible.com/u/jeremytourville)\
**Post date:** [September 27, 2024, 2:25pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/66 "2024-09-27T14:25:09Z")

</div>

I read you question but I am confused. How can you do what you are suggesting? I think we have a different understanding from each other but I am trying to understand your way, which will be the correct way!

I thought that AWX needed to be running. How is this possible without PV and PVC?

Also, I see the documentation says:

- delete the persistent volume claim (PVC) for the database from the old deployment, which has a name like `postgres-<postgres version>-`

Is this what you mean?

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 27, 2024, 2:49pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/67 "2024-09-27T14:49:10Z")

</div>

Okay, let me explain…

A new PSQL will be created by the restore, and this PSQL should use the `/var/lib/postgresql/data` of the one of the nodes of the new cluster via PVC.

If, you already have previously attempted to deploy AWX on the new cluster, there may still be data created by PSQL from that time in `/var/lib/postgresql/data` on your nodes.

The AWX Operator does not reset the PSQL password during restoration, nor deletes old data before the restore. Additionally, even if you delete old PVs or PVCs, the actual contents on the directory on your nodes will not be automatically removed.

So, a new PSQL will be created by the restore, but if there is already old data created by PSQL in the PV, the new PSQL may start up using the old data, leading to a potential mismatch in the password.

---

<div class="post-metadata">

**Author:** ![jeremytourville](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jeremytourville/32/2448_2.png) [@jeremytourville](https://forum.ansible.com/u/jeremytourville)\
**Post date:** [September 27, 2024, 3:48pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/68 "2024-09-27T15:48:57Z")

</div>

> [@kurokobo](#):
>
> If, you already have previously attempted to deploy AWX on the new cluster, there may still be data created by PSQL from that time in `/var/lib/postgresql/data` on your nodes.

OK, it took me a moment to digest what I needed to do but I got it to work!  
😂

I can simply delete the contents of the DB at the Postgres PV/PVC path on the node where it is running.

```auto
cd /var/lib/postgres/data/data/pgdata
rm -rf *

```

So here is the overall sequence that should happen:

1. Add the needed PV and PVC to the cluster.
2. Start up AWX using helm
3. Remove the data from the Postgres DB
4. Apply the restore-awx.yml
5. Watch the log as the restore job completes
6. Done!

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 28, 2024, 1:34pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/69 "2024-09-28T13:34:14Z")

</div>

> [@jeremytourville](#):
>
> Start up AWX using helm

It’s not required at all, but it’s okay if it works anyway 🙃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 28, 2024, 1:34pm UTC](https://forum.ansible.com/t/awx-backup-fails/7739/70 "2024-10-28T13:34:41Z")

</div>

Closed on October 28, 2024, 1:34pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.ansible.com/t/awx-backup-fails/7739.md?page=3)
