Awx: Pending Delete on Demo Inventory

Created on 22 May 2019  ยท  3Comments  ยท  Source: ansible/awx

ISSUE TYPE
  • Bug Report
SUMMARY

I delete all the Demo configured items via towercli:

tower-cli project delete -n "Demo Project"
tower-cli inventory delete -n "Demo Inventory"
tower-cli credential delete -n "Demo Credential"
tower-cli job_template delete -n "Demo Job Template"

but with the deletion of the Demo Inventory something went wrong. It still remains "pending deletion". Surviving server reboots.
Deleting the only existing Host "localhost" in this inventory is denied by the message:

error : The inventory for this host is already being deleted."
ENVIRONMENT
  • AWX version: 4.0.0 - commit dc1bf3ef
  • AWX install method: docker on linux
  • Ansible version: 2.7.9
  • Operating System: Debian 9 - latest updates
  • Web Browser: Chrome
STEPS TO REPRODUCE

Happened once out of 3 environments - but I would like to know how to handle that

EXPECTED RESULTS

Inventory gets deleted

ACTUAL RESULTS

Inventory remained in the Setup - pending deletion
http://towerhost/api/v2/unified_jobs/?status=running
returns 0 on count

But I am able to find the stuck job when running:

awx-manage shell_plus
....
Inventory.objects.filter(pending_deletion=True)
<QuerySet [<Inventory: Demo Inventory-1>]>

I welcome any ideas :)

bug

Most helpful comment

@mwiora if I had to guess, something probably interrupted the deletion, and it got stuck in this pending state.

Try running this in the shell_plus?

Inventory.objects.filter(pending_deletion=True).update(pending_deletion=False)

All 3 comments

@mwiora if I had to guess, something probably interrupted the deletion, and it got stuck in this pending state.

Try running this in the shell_plus?

Inventory.objects.filter(pending_deletion=True).update(pending_deletion=False)

Ran into the same issue while nuking the test environment, running Inventory.objects.filter(pending_deletion=True).update(pending_deletion=False) worked
The inventory had a source script running every 60s, the inventory script (not the source) was deleted right before i tried to delete the inventory

@ryanpetrello NICE! worked like a charm and I could delete the inventory afterwards without any issues.
In my case I assume, that I've been rebooting the AWX tower host during the pending deletion job as my scripts are doing it automatically. Maybe there would be an option to "cleanup" all stucked jobs which are in pending state on a machine startup.
Thanks!

Was this page helpful?
0 / 5 - 0 ratings