Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1887444

Summary: Running "openstack tripleo validator" without any overcloud leads to an inventory error and crash
Product: Red Hat OpenStack Reporter: Cédric Jeanneret <cjeanner>
Component: openstack-tripleo-validationsAssignee: mathieu bultel <mbultel>
Status: CLOSED CURRENTRELEASE QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: drosenfe, gchamoul, hbrock, jbuchta, jhajyahy, jjoyce, jpodivin, jschluet, jslagle, mburns, slinaber, spower, tvignaud, uemit.seren
Target Milestone: z8Keywords: TestOnly, Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-validations-11.3.2-1.20210803213306.4db92ba.el8ost openstack-tripleo-common-11.4.1-1.20210409103438.75bd92a.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1989743 1989744 (view as bug list) Environment:
Last Closed: 2022-02-17 11:41:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1989743, 1989744    

Description Cédric Jeanneret 2020-10-12 13:45:27 UTC
Description of problem:
If a validator is executed before overcloud is created there is an error about tripleo-ansible-inventory.yaml not being parse-able:

undercloud) [stack@undercloud-0 ~]$ openstack tripleo validator run --group pre-introspection
[WARNING]:  * Failed to parse /home/stack/tripleo-ansible-inventory.yaml with
auto plugin: no root 'plugin' key found, '/home/stack/tripleo-ansible-
inventory.yaml' is not a valid YAML inventory plugin config file
[WARNING]:  * Failed to parse /home/stack/tripleo-ansible-inventory.yaml with
yaml plugin: can't add group to itself
[WARNING]:  * Failed to parse /home/stack/tripleo-ansible-inventory.yaml with
ini plugin: Invalid host pattern 'Undercloud:' supplied, ending in ':' is not
allowed, this character is reserved to provide a port.
[WARNING]: Unable to parse /home/stack/tripleo-ansible-inventory.yaml as an
inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
/usr/lib/python3.6/site-packages/validations_libs/ansible.py:374: ResourceWarning: unclosed file <_io.BufferedWriter name='/var/log/validations/artifacts/85241718-e8e4-42b7-963a-4cde3c6a0179_check-cpu.yaml_2020-10-10T23:50:39.592042Z/artifacts/stdout'>
  status, rc = runner.run()

Version-Release number of selected component (if applicable):
python3-tripleoclient-12.3.2-1.20200914164928.el8ost.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run validator without an overcloud
2.
3.

Actual results:
We see issues with parsing the inventory, and many validations fail

Expected results:
It should gracefully fail without a stacktrace.

Additional info:

Comment 2 Gaël Chamoulaud 2020-11-19 10:10:13 UTC
*** Bug 1897117 has been marked as a duplicate of this bug. ***

Comment 3 Cédric Jeanneret 2021-02-10 10:21:10 UTC
Upstream merged all the way - need to cherry-pick in 16.1-trunk for z5 integration!

Comment 16 Jad Haj Yahya 2021-07-29 05:44:52 UTC
Created inventory file using:
tripleo-ansible-inventory --ansible_ssh_user heat-admin --static-yaml-inventory inventory.yaml

then ran a validation:
openstack tripleo validator run --validation check-cpu --extra-vars minimal_cpu_count=10 --static-inventory inventory.yaml

Comment 17 Jad Haj Yahya 2021-07-29 13:10:02 UTC
Moving back to On_QA as verification was done mistakenly on 16.2 
Also I should not have generate the inventory file myselfm should be done automatically

Comment 18 David Rosenfeld 2021-07-29 14:25:32 UTC
Seeing out of range error when a validation is executed before overcloud is deployed:

openstack tripleo validator run --validation check-ram
Running Validations without Overcloud settings.
Error creating static inventory: list index out of range
Failed to generate inventory

Comment 19 Gaël Chamoulaud 2021-07-29 14:39:30 UTC
*** Bug 1987318 has been marked as a duplicate of this bug. ***

Comment 21 Gaël Chamoulaud 2021-08-04 12:21:13 UTC
new build in FIV is openstack-tripleo-validations-11.3.2-1.20210803213306.4db92ba.el8ost

The one for openstack-tripleo-common is still accurate! No change here.

Comment 22 Lon Hohberger 2021-12-22 16:17:45 UTC
According to our records, this should be resolved by openstack-tripleo-common-11.4.1-1.20210719133310.el8ost.  This build is available now.

Comment 23 Jiri Podivin 2022-02-17 07:12:03 UTC
Manually verified on 17.02.2022 with RHOS 16.1.8, puddle RHOS-16.1-RHEL-8-20220210.n.1.