Bug 1643912 - The validator can't find ironic conf file
Summary: The validator can't find ironic conf file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-validations
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 14.0 (Rocky)
Assignee: Gaël Chamoulaud
QA Contact: Andrey Fiodorov
URL:
Whiteboard:
Depends On: 1655491
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-29 12:33 UTC by Andrey Fiodorov
Modified: 2019-01-11 11:54 UTC (History)
7 users (show)

Fixed In Version: openstack-tripleo-validations-9.3.1-0.20181008110755.4064fb7.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-11 11:54:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 613952 0 None None None 2018-10-29 15:03:47 UTC
OpenStack gerrit 615540 0 None None None 2018-11-13 07:43:19 UTC
OpenStack gerrit 619603 0 None None None 2018-11-22 15:58:05 UTC
OpenStack gerrit 619731 0 None None None 2018-12-05 13:56:54 UTC
OpenStack gerrit 621341 0 None None None 2018-12-05 13:59:12 UTC
OpenStack gerrit 622140 0 None None None 2018-12-05 13:59:46 UTC
Red Hat Product Errata RHEA-2019:0045 0 None None None 2019-01-11 11:54:40 UTC

Description Andrey Fiodorov 2018-10-29 12:33:49 UTC
Description of problem:
The validation fails with Error Message: Could not open the ini file: '/etc/ironic-inspector/inspector.conf'

Version-Release number of selected component (if applicable):
openstack-tripleo-validations-9.3.1-0.20181008110747.4064fb7.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install OSP14 from 2018-10-19.1
2. Go to GUI and run the validation "DHCP on the Introspection Network"

Actual results:
The validation fails with Error Message: Could not open the ini file: '/etc/ironic-inspector/inspector.conf'

Expected results:
The validation should fails/passes with clear message

Additional info:
I think that happen because the "Ironic" is in the container for now.

Comment 1 Gaël Chamoulaud 2018-10-29 13:07:28 UTC

*** This bug has been marked as a duplicate of bug 1635335 ***

Comment 18 Udi Kalifon 2018-11-22 13:59:23 UTC
The validator fails with a permission denied error.

Task 'Look up the introspection interface' failed:
Host: undercloud
Message: Could not open the ini file: '/var/lib/config-data/ironic_inspector/etc/ironic-inspector/inspector.conf'

Failure! The validation failed for all hosts:
* undercloud


When I try manually, I have to use 'sudo' to access this file. Also, I think the correct path to the file should be a bit different (with "puppet-generated" in it because that's what's actually mounted inside the containers - but check me on that):
/var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/inspector.conf

Comment 19 Gaël Chamoulaud 2018-11-22 15:58:05 UTC
Yes Udi, you're right! my mistake.

Comment 21 Andrey Fiodorov 2018-11-27 16:47:43 UTC
Checked on relevant version:

[stack@undercloud-0 ~]$ rpm -q openstack-tripleo-validations
openstack-tripleo-validations-9.3.1-0.20181008110752.4064fb7.el7ost.noarch


Still fails with error:

Task 'Look up the introspection interface' failed:
Host: undercloud
Message: Could not open the ini file: '/var/lib/config-data/ironic_inspector/puppet-generated/etc/ironic-inspector/inspector.conf'

Failure! The validation failed for all hosts:
* undercloud

**** I think you have a mistake in path ****
the inspector.conf file is not there, I ran the find command:

[stack@undercloud-0 ~]$ sudo find / -name inspector.conf
/var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/inspector.conf
/var/lib/config-data/ironic_inspector/etc/ironic-inspector/inspector.conf

Comment 22 Andrey Fiodorov 2018-11-28 08:11:29 UTC
Hey Gael, after retest with your changes it seems that the path to inspector file still wrong, please change it to "/var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/inspector.conf".

After changing the path to correct, the validator passes from CLI:

(undercloud) [stack@undercloud-0 ~]$ ansible-playbook -i /usr/bin/tripleo-ansible-inventory /usr/share/openstack-tripleo-validations/validations/dhcp-introspection.yaml 

PLAY [undercloud] *************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [undercloud]

TASK [Look up the introspection interface] ************************************************************************************************************************************************************************
ok: [undercloud]

TASK [Look up the introspection interface from the deprecated option] *********************************************************************************************************************************************
ok: [undercloud]

TASK [Look for rogue DHCP servers] ********************************************************************************************************************************************************************************
ok: [undercloud]

PLAY RECAP ********************************************************************************************************************************************************************************************************
undercloud                 : ok=4    changed=0    unreachable=0    failed=0   


***But it still fails with same error***
Task 'Look up the introspection interface' failed:
Host: undercloud
Message: Could not open the ini file: '/var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/inspector.conf'

Failure! The validation failed for all hosts:
* undercloud

I think it is because permission, You can see that the file exist, but has permission:

(undercloud) [stack@undercloud-0 ~]$ sudo ls -la /var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/ | grep inspector.conf
-rw-r-----. 1 42461 42461 40006 Nov 27 09:01 inspector.conf
(undercloud) [stack@undercloud-0 ~]$ ls -la /var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/ | grep inspector.conf
ls: cannot open directory /var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/: Permission denied
(undercloud) [stack@undercloud-0 ~]$ sudo ls -la /var/lib/config-data/puppet-generated/ironic_inspector/etc/ironic-inspector/ | grep inspector.conf
-rw-r-----. 1 42461 42461 40006 Nov 27 09:01 inspector.conf

Comment 23 Gaël Chamoulaud 2018-11-28 16:11:45 UTC
In the inventory, the undercloud is known as 'localhost' and the validation is trying to read the ironic_inspector configuration file in the mistral_executor container instead of the undercloud host. It works if we run the validation through ansible-playbook on the undercloud host, but not from mistral.

I've proposed a patch on tripleo-heat-templates to add a bind-mount of /var/lib/config-data/puppet-generated to the mistral_executor container.

Comment 27 Andrey Fiodorov 2018-12-13 07:14:34 UTC
Verified.

[stack@undercloud-0 ~]$ rpm -q openstack-tripleo-validations
openstack-tripleo-validations-9.3.1-0.20181008110756.4064fb7.el7ost.noarch

Comment 31 errata-xmlrpc 2019-01-11 11:54:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:0045


Note You need to log in before you can comment on or make changes to this bug.