# Inventories in "Pending Delete" state

**URL:** <https://forum.ansible.com/t/inventories-in-pending-delete-state/28976>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [November 8, 2018, 12:43pm UTC](https://forum.ansible.com/t/inventories-in-pending-delete-state/28976 "2018-11-08T12:43:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![creisor](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@creisor](https://forum.ansible.com/u/creisor)\
**Post date:** [November 8, 2018, 12:43pm UTC](https://forum.ansible.com/t/inventories-in-pending-delete-state/28976/1 "2018-11-08T12:43:03Z")

</div>

AWX version: 1.0.6.23  
Ansible version: 2.6.0  
Clustering is enabled with 3 instances.

I have several inventories whose state in the GUI is “PENDING DELETE” and have been so for weeks (or months).

These can also be seen in the awx-manage shell.

`  
Python 2.7.5 (default, Apr 11 2018, 07:36:10)  
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2  
Type “help”, “copyright”, “credits” or “license” for more information.  
(InteractiveConsole)

> > > Inventory.objects.filter(pending\_deletion=True)  
> > > \<QuerySet [\<Inventory: Telegraf Infrastructure-3\>, \<Inventory: arbitration-service-app-139\>, \<Inventory: arbitration-service-cassandra-141\>, \<Inventory: arbitration-service-db-140\>, \<Inventory: inbox-management-platform-redis-preprod-245\>, \<Inventory: inbox-management-platform-redis-prod-244\>, \<Inventory: inbox-management-platform-redis-staging-72\>, \<Inventory: orders-app-119\>, \<Inventory: orders-app-c2-130\>, \<Inventory: orders-app-sox-c2-131\>, \<Inventory: orders-e2e-137\>, \<Inventory: orders-e2e-prod-167\>, \<Inventory: orders-ext-c2-132\>, \<Inventory: orders-hbase-138\>, \<Inventory: orders-irb-127\>, \<Inventory: orders-irb-c2-133\>, \<Inventory: orders-irb-sox-c2-134\>, \<Inventory: orders-memcache-123\>, \<Inventory: orders-omc-128\>, \<Inventory: orders-omc-sox-c2-136\>, ‘…(remaining elements truncated)…’]\>  
> > > `

I was able to find this in the log on one of the instances:

`  
[2018-09-17 14:19:27,010: ERROR/MainProcess] Task awx.main.tasks.delete\_inventory[ad7a41d0-69e6-49c7-aa6c-454a4fd8906b] raised unexpected: OperationalError(‘cursor “\_django\_curs\_139911362152256\_1” does not exist\n’,)  
Traceback (most recent call last):  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/app/trace.py”, line 240, in trace\_task  
R = retval = fun(\*args, \*\*kwargs)  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/app/trace.py”, line 438, in **protected\_call**  
return self.run(\*args, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/awx/main/tasks.py”, line 554, in delete\_inventory  
for host in i.hosts.iterator():  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py”, line 62, in **iter**  
for row in compiler.results\_iter(results):  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py”, line 844, in results\_iter  
for rows in results:  
File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py”, line 1292, in cursor\_iter  
cursor.close()  
OperationalError: cursor “\_django\_curs\_139911362152256\_1” does not exist

`

I didn’t see anything like this searching the posts on this list, so I’m hoping somebody might have some ideas for troubleshooting further.

Thanks,  
Chris Reisor

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [November 8, 2018, 1:06pm UTC](https://forum.ansible.com/t/inventories-in-pending-delete-state/28976/2 "2018-11-08T13:06:30Z")

</div>

Hey Chris,

Please try out a newer version of awx - we’ve changed and improved a _lot_ of the parts that make up backgrounded inventory deletes, and there’s a good chance we’ve squashed this issue.
