Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pending Delete on Demo Inventory #3945

Closed
mrwiora opened this issue May 22, 2019 · 3 comments
Closed

Pending Delete on Demo Inventory #3945

mrwiora opened this issue May 22, 2019 · 3 comments
Labels

Comments

@mrwiora
Copy link

mrwiora commented May 22, 2019

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 dc1bf3e
  • 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 :)

@ryanpetrello
Copy link
Contributor

@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)

@lijok
Copy link

lijok commented May 29, 2019

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

@mrwiora
Copy link
Author

mrwiora commented May 29, 2019

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants