Created attachment 1710334 [details] overcloud_delete_debug.log Description of problem: If a stack fails to create, the `openstack overcloud delete overcloud` command may fail while trying to generate the inventory. Failed to generate inventory: Unexpected error while running command. Command: /usr/bin/tripleo-ansible-inventory --stack overcloud --ansible_ssh_user tripleo-admin --undercloud-connection ssh --undercloud-key-file /var/lib/mistral/.ssh/tripleo-admin-rsa --static-yaml-inventory /home/cloud-user/tripleo-ansible-inventory.yaml Exit code: 1 Stdout: '' Stderr: "Error creating static inventory: argument of type 'NoneType' is not iterable\n" sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.24.2', 35076), raddr=('192.168.24.2', 13000)> Version-Release number of selected component (if applicable): $ rpm -qa | grep tripleo openstack-tripleo-common-containers-11.3.3-0.20200611110656.f7715be.el8ost.noarch openstack-tripleo-image-elements-10.6.2-0.20200528043425.7dc0fa1.el8ost.noarch openstack-tripleo-validations-11.3.2-0.20200611115252.08f469d.el8ost.noarch openstack-tripleo-heat-templates-11.3.2-0.20200616081530.396affd.el8ost.noarch ansible-tripleo-ipa-0.2.1-0.20200611104546.c22fc8d.el8ost.noarch ansible-tripleo-ipsec-9.2.1-0.20200311073016.0c8693c.el8ost.noarch tripleo-ansible-0.5.1-0.20200611113656.34b8fcc.el8ost.noarch python3-tripleoclient-heat-installer-12.3.2-0.20200615103427.6f877f6.el8ost.noarch openstack-tripleo-puppet-elements-11.2.2-0.20200527003426.226ce95.el8ost.noarch python3-tripleoclient-12.3.2-0.20200615103427.6f877f6.el8ost.noarch puppet-tripleo-11.5.0-0.20200616033427.8ff1c6a.el8ost.noarch python3-tripleo-common-11.3.3-0.20200611110656.f7715be.el8ost.noarch openstack-tripleo-common-11.3.3-0.20200611110656.f7715be.el8ost.noarch ansible-role-tripleo-modify-image-1.2.1-0.20200527233426.bc21900.el8ost.noarch How reproducible: Steps to Reproduce: 1. have an overcloud fail to create (state: DPELOYED_FAILED) 2. Attempt to delete the overcloud via `openstack overcloud delete overcloud` Actual results: Cannot use the overcloud delete command Expected results: Delete should still occur or the inventory generation should not be used. Additional info: You can workaround the delete by using: - openstack stack delete overcloud - openstack overcloud plan delete overcloud
This looks like it fails while trying to cleanup the ipa stuff. In this case I don't even have IPA deployed. This should likely be an optional thing where we print a warning if this fails.
`openstack overcloud delete -s overcloud` will skip this as well.
Based on the attached log [0], it looks like this fails because the inventory doesn't exist, but we call get_tripleo_ansible_inventory [1]. I think this is specific to train since we moved all that cleanup into a playbook in later releases [2]. [0] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/osc_lib/shell.py", line 136, in run ret_val = super(OpenStackShell, self).run(argv) File "/usr/lib/python3.6/site-packages/cliff/app.py", line 281, in run result = self.run_subcommand(remainder) File "/usr/lib/python3.6/site-packages/osc_lib/shell.py", line 176, in run_subcommand ret_value = super(OpenStackShell, self).run_subcommand(argv) File "/usr/lib/python3.6/site-packages/cliff/app.py", line 401, in run_subcommand result = cmd.run(parsed_args) File "/usr/lib/python3.6/site-packages/tripleoclient/command.py", line 32, in run super(Command, self).run(parsed_args) File "/usr/lib/python3.6/site-packages/osc_lib/command/command.py", line 41, in run return super(Command, self).run(parsed_args) File "/usr/lib/python3.6/site-packages/cliff/command.py", line 185, in run return_code = self.take_action(parsed_args) or 0 File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_delete.py", line 165, in take_action self._cleanup_ipa(parsed_args.stack) File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_delete.py", line 113, in _cleanup_ipa return_inventory_file_path=True) File "/usr/lib/python3.6/site-packages/tripleoclient/utils.py", line 1128, in get_tripleo_ansible_inventory raise exceptions.InvalidConfiguration(message) tripleoclient.exceptions.InvalidConfiguration: Failed to generate inventory: Unexpected error while running command. Command: /usr/bin/tripleo-ansible-inventory --stack overcloud --ansible_ssh_user tripleo-admin --undercloud-connection ssh --undercloud-key-file /var/lib/mistral/.ssh/tripleo-admin-rsa --static-yaml-inventory /home/cloud-user/tripleo-ansible-inventory.yaml Exit code: 1 Stdout: '' Stderr: "Error creating static inventory: argument of type 'NoneType' is not iterable\n" [1] https://opendev.org/openstack/python-tripleoclient/src/branch/stable/train/tripleoclient/v1/overcloud_delete.py#L112-L113 [2] https://opendev.org/openstack/python-tripleoclient/src/branch/master/tripleoclient/v2/overcloud_delete.py#L78
I've proposed a patch for Train[1] that should eliminate the need to pass -s on non TLS-e environments. [1]: https://review.opendev.org/#/c/746602/
According to our records, this should be resolved by python-tripleoclient-12.3.2-1.20200914164930.el8ost. This build is available now.