# AWX Cleanup Job Details process failed

**URL:** <https://forum.ansible.com/t/awx-cleanup-job-details-process-failed/3214>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [January 9, 2024, 10:30am UTC](https://forum.ansible.com/t/awx-cleanup-job-details-process-failed/3214 "2024-01-09T10:30:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [January 9, 2024, 10:30am UTC](https://forum.ansible.com/t/awx-cleanup-job-details-process-failed/3214/1 "2024-01-09T10:30:35Z")

</div>

Hello,  
I have a problem with AWX (v. 23.3.0) installed on AKS cluster.

The maintenance job “Cleanup Job Details” fails with this error and not clean the job history on AWX:

> Traceback (most recent call last):  
> File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/django/db/backends/base/base.py”, line 313, in \_commit  
> return self.connection.commit()  
> File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/psycopg/connection.py”, line 884, in commit  
> self.wait(self.\_commit\_gen())  
> File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/psycopg/connection.py”, line 957, in wait  
> return waiting.wait(gen, self.pgconn.socket, timeout=timeout)  
> File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/psycopg/waiting.py”, line 283, in wait\_epoll  
> s = gen.send(ready)  
> File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/psycopg/connection.py”, line 532, in \_commit\_gen  
> yield from self.\_exec\_command(b"COMMIT")  
> File “/var/lib/awx/venv/awx/lib64/python3.9/site-packages/psycopg/connection.py”, line 466, in _exec\_command  
> raise e.error\_from\_result(result, encoding=pgconn\_encoding(self.pgconn))  
> psycopg.errors.InternalError_: could not find trigger 38872

In top of stdout log I read this message:

> Table \_unpartitioned\_main\_jobevent has no events in it  
> Dropping table \_unpartitioned\_main\_jobevent since no records are newer than 2024-01-06 13:17:04.163481+00:00  
> jobs: 317 deleted, 12 skipped.

but no jobs was really deleted, I see the same total in jobs view.

Any idea about this error? It’s an issue due to something not clean in AWX db?

Thank you very much.  
Elia

---

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [January 9, 2024, 1:31pm UTC](https://forum.ansible.com/t/awx-cleanup-job-details-process-failed/3214/2 "2024-01-09T13:31:49Z")

</div>

For now I solved running this manual command in awx-task container in bash shell:

```auto
awx-manage shell_plus

```

and then:

```auto
from awx.main.models import Job
for record_id in range(1, 1000):
    try:
        db_object = Job.objects.get(id=record_id)
        db_object.delete()
    except:
        pass

```

Now I can run the job “Cleanup Job Details” from AWX without errors.  
I don’t know if a temporarily solved the issue and it will happens again.

Elia

---

<div class="post-metadata">

**Author:** ![thedoubl3j](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thedoubl3j/32/103_2.png) [@thedoubl3j](https://forum.ansible.com/u/thedoubl3j)\
**Post date:** [January 10, 2024, 7:48pm UTC](https://forum.ansible.com/t/awx-cleanup-job-details-process-failed/3214/3 "2024-01-10T19:48:59Z")

</div>

hey @epi82 thanks for pointing this out, if you hit this again, can you let us know here and also open an issue on [GitHub - ansible/awx: AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.](http://github.com/ansible/awx)

for future triage, [AAP-16926 Delete unpartitioned tables in a separate transaction by AlanCoding · Pull Request #14572 · ansible/awx · GitHub](https://github.com/ansible/awx/pull/14572) might be of interest.
