Bug 1553790 - httpd-config-generator fails during ipa configuration generation
Summary: httpd-config-generator fails during ipa configuration generation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: cfme-httpd-configmap-generator
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.3
Assignee: Joe Vlcek
QA Contact: Ievgen Zapolskyi
Steve Bream
URL:
Whiteboard:
Depends On: 1590301
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-09 14:43 UTC by Ievgen Zapolskyi
Modified: 2018-07-12 14:51 UTC (History)
7 users (show)

Fixed In Version: 5.9.3.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-12 14:51:39 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2183 0 None None None 2018-07-12 14:51:56 UTC

Description Ievgen Zapolskyi 2018-03-09 14:43:38 UTC
Description of problem:
Copied from https://github.com/ManageIQ/httpd_configmap_generator/issues/25
Since blocker BZ(1540641) is resolved, I encounter same issue in CFME httpd-configmap-generator pod.

When I try to generate ipa configuration using latest docker I get the following error:

[root@cfme-smicro-628-b09 cfme-59018-0126]# docker exec $CONFIGMAP_GENERATOR_ID httpd_configmap_generator ipa --host=xz3tto.*** --ipa-server=env-freeipa01.*** --ipa-domain=freeipa01.*** --ipa-realm=freeipa01.*** --ipa-principal=admin --ipa-password=*** -f -d -o /tmp/external-ipa.yaml
Running Command: /usr/bin/hostname
Running Command: /usr/bin/hostname --params xz3tto.***
Running Command: /usr/sbin/ipa-client-install --params -N force_join fixed_primary unattended realm\= FREEIPA01.*** domain\= freeipa01.*** server\= env-freeipa01.*** principal\= admin password\= ***
Configuring IPA HTTP Service
Running Command: /usr/bin/kinit --params admin --stdin-data ***
Command Error: /usr/bin/ipa exit code: 2
stdout:
stderr: ipa: ERROR: The host 'xz3tto.***' does not exist to add a service to.
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/awesome_spawn-1.4.1/lib/awesome_spawn.rb:105:in `run!': /usr/bin/ipa exit code: 2 (AwesomeSpawn::CommandResultError)
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/lib/httpd_configmap_generator/base/command.rb:17:in `command_run!'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/lib/httpd_configmap_generator/base/principal.rb:30:in `request'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/lib/httpd_configmap_generator/base/principal.rb:19:in `register'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/lib/httpd_configmap_generator/ipa.rb:115:in `configure_ipa_http_service'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/lib/httpd_configmap_generator/ipa.rb:63:in `configure'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/lib/httpd_configmap_generator/base.rb:83:in `run_configure'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/bin/httpd_configmap_generator:68:in `run'
        from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/httpd_configmap_generator-0.2.1/bin/httpd_configmap_generator:87:in `<top (required)>'
        from /opt/rubies/ruby-2.3.1/bin/httpd_configmap_generator:23:in `load'
        from /opt/rubies/ruby-2.3.1/bin/httpd_configmap_generator:23:in `<main>'


Version-Release number of selected component (if applicable):
5.9.0.21

How reproducible:
100%

Steps to Reproduce:
1. deploy httpd-configmap-generator pod
2. try to generate ipa configuration following this guide https://github.com/ManageIQ/httpd_configmap_generator


Actual results:
error from description

Expected results:
no such error

Additional info:
When I open shell in docker and run kinit + ipa host-add + ipa service-add manually, next attempt to run httpd_configmap_generator finishes successfully.

Comment 2 Joe Vlcek 2018-03-16 19:05:15 UTC
Ievgen,

Is your IPA serve DNS resolvable on the configmap generator pod?

If not you will need to get it added in DNS.

To test this I recreated the same error you reported by using a IPA
server not in DNS. Then I hacked a DNS resolution by adding the IPA
server to the /etc/hosts file in the configmap generator and was
able to successfully generate the new config map without having to
open shell in and run kinit + ipa host-add + ipa service-add/

Please ensure your IPA server hostname is DNS resolvable.

Thank you.
JoeV

Comment 5 Dave Johnson 2018-04-04 19:21:45 UTC
Ievgen, please see comment 4's request for information.

Comment 6 Ievgen Zapolskyi 2018-04-04 20:00:13 UTC
Dave,

We chatted the other day and I provided all necessary details/logs/credentials/etc.

Comment 7 Joe Vlcek 2018-04-05 20:42:49 UTC
Ievgen,

I've successfully generated the IPA config map using the credentials for your
IPA server. The realm in the IPA server you are using is all uppercase.
I will PM you the command I ran.

JoeV

Comment 9 Ievgen Zapolskyi 2018-04-06 15:25:48 UTC
it turned out after some investigation that this issue happens only to resolvable/pingable hostnames.
When hostname isn't resolvable, configmap generator prepares configmap w/o issues.
The workaround for resolvable hostname is to run in httpd-configmap-generator pod the following commands:

kinit
ipa host-add 2ldn9k.ocp-sprout-01.cmqe.lab.eng.rdu2.redhat.com
ipa service-add HTTP/2ldn9k.ocp-sprout-01.cmqe.lab.eng.rdu2.redhat.com

where 2ldn9k.ocp-sprout-01.cmqe.lab.eng.rdu2.redhat.com is pod hostname.

and re-run configmap generator application once more.
When host and service are added to IPA server, the application works fine.
So, it seems those steps are missed in configmap generator.

Comment 10 Joe Vlcek 2018-04-07 13:46:06 UTC
(In reply to Ievgen Zapolskyi from comment #9)
> it turned out after some investigation that this issue happens only to
> resolvable/pingable hostnames.
> When hostname isn't resolvable, configmap generator prepares configmap w/o
> issues.
> The workaround for resolvable hostname is to run in
> httpd-configmap-generator pod the following commands:
> 
> kinit
> ipa host-add 2ldn9k.ocp-sprout-01.cmqe.lab.eng.rdu2.redhat.com
> ipa service-add HTTP/2ldn9k.ocp-sprout-01.cmqe.lab.eng.rdu2.redhat.com
> 
> where 2ldn9k.ocp-sprout-01.cmqe.lab.eng.rdu2.redhat.com is pod hostname.
> 
> and re-run configmap generator application once more.
> When host and service are added to IPA server, the application works fine.
> So, it seems those steps are missed in configmap generator.

Upon further investigation the issue is not as we initially thought.

I did more research and discovered the root cause of the failures you are
experiencing. The reason is rooted in the QE automated test beds use of
host name aliases. If the canonical name associated with the QE test bed
hostname alias is used the httpd-config-generator successfully generates
the  ipa configuration.

The work around you identified, of using `ipa host-add` and `ipa service-add`,
is not necessary. In fact the httpd-config-generator already does the `ipa service-add`.

The httpd-config-generator will succeed if  you use the canonical hostname.

JoeV

Comment 17 Ievgen Zapolskyi 2018-06-20 10:26:35 UTC
VERIFIED in 5.9.3.2

Comment 19 errata-xmlrpc 2018-07-12 14:51:39 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/RHBA-2018:2183


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