Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1444722

Summary: ipa-server-install throws and unhandled exception when passing integer to `--domain` option
Product: Red Hat Enterprise Linux 7 Reporter: Abhijeet Kasurde <akasurde>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED DUPLICATE QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: akasurde, pasik, pvoborni, rcritten, tscherf
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-15 13:50:44 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:

Description Abhijeet Kasurde 2017-04-24 06:10:41 UTC
Description of problem:
When user tries to install ipa-server-install (DL0) on machine configured FIPS mode, command fails with below error

[root@ipaserver01 ~]# ipa-server-install --ip-address $(ip addr|grep "global"|cut -d " " -f6|cut -d "/" -f1|head -n 1) -r testrelm.test -p 'Secret123' -a 'Secret123' --setup-dns --forwarder 10.10.10.254 -U --domain 0
Checking DNS domain 0, please wait ...

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure DNS (bind)
  * Configure the KDC to enable PKINIT

WARNING: conflicting time&date synchronization service 'chronyd' will be disabled
in favor of ntpd

Warning: skipping DNS resolution of host ipaserver01.testrelm.test
ipa.ipapython.install.cli.install_tool(CompatServerMasterInstall): ERROR    'int' object has no attribute '__getitem__'
ipa.ipapython.install.cli.install_tool(CompatServerMasterInstall): ERROR    The ipa-server-install command failed. See /var/log/ipaserver-install.log for more information



Version-Release number of selected component (if applicable):
# rpm -q freeipa-server freeipa-client ipa-server ipa-client 389-ds-base pki-ca krb5-server
package freeipa-server is not installed
package freeipa-client is not installed
ipa-server-4.5.0-7.el7.x86_64
ipa-client-4.5.0-7.el7.x86_64
389-ds-base-1.3.6.1-9.el7.x86_64
pki-ca-10.4.1-2.el7.noarch
krb5-server-1.15.1-7.el7.x86_64

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

How reproducible:
100%


Steps to Reproduce:
1. Configure FIPS on RHEL 7 machine
2. Install ipa-server-install using `-n 0' or `--domain=0'

Actual results:
Installer fails with above error message

Expected results:
Installer should be successful using domain level 0

Comment 3 Martin Babinsky 2017-04-24 06:46:40 UTC
Abhijeet,

`--domain` options sets/checks the name of primary DNS domain, correct option to set domain level is `--domain-level`.

The reported bug is actually an error in the `--domain` option validator stemming from incorrect usage of installer options.

I would suggest to retry with correct options and if it passes drop the TestBlocker keyword and reword the bug.

Comment 4 Martin Babinsky 2017-04-24 06:53:03 UTC
INterestingly, on freeipa-server-4.4.4-1.fc25.x86_64 I see the same error when passing an integer as domain name.

With ipa-server-4.4.0-12.el7.x86_64 the validator happily sets the DNS domain to '0' and proceeds with installation.

'''
# ipa-server-install -U --domain 0 -p Secret123 -a Secret123 --realm IPA.TEST

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)

WARNING: conflicting time&date synchronization service 'chronyd' will be disabled
in favor of ntpd


The IPA Master Server will be configured with:
Hostname:       vm-103.abc.idm.lab.eng.brq.redhat.com
IP address(es): 10.34.78.103, 2620:52:0:224e:21a:4aff:fe23:14d9
Domain name:    0
Realm name:     IPA.TEST

WARNING: Realm name does not match the domain name.
You will not be able to estabilish trusts with Active Directory unless
the realm name of the IPA server matches its domain name.


Configuring NTP daemon (ntpd)
  [1/4]: stopping ntpd
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
Done configuring NTP daemon (ntpd).
Configuring directory server (dirsrv). Estimated time: 1 minute
  [1/47]: creating directory server user
  [2/47]: creating directory server instance
^C  [error] KeyboardInterrupt:

'''

I have aborted it but it would be interesting to see how the system will behave with domain name '0'.

Comment 6 Abhijeet Kasurde 2017-04-24 07:04:39 UTC
Please read `--domain' for `domain' rather than for domain level. Also, drop FIPS configuration steps as this bug is reproducible irrespective of FIPS setup.

Comment 7 Petr Vobornik 2017-05-03 08:23:19 UTC
# rpm -q ipa-server
ipa-server-4.4.0-14.el7_3.4.x86_64

#ipa-server-install --domain 1
<snip>
ipa.ipapython.install.cli.install_tool(Server): ERROR    'int' object has no attribute '__getitem__'
ipa.ipapython.install.cli.install_tool(Server): ERROR    The ipa-server-install command failed. See /var/log/ipaserver-install.log for more information

I.e. is on RHEL 7.3 -> not a regression in last version.

Comment 8 Petr Vobornik 2017-05-05 12:26:37 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/6932

Comment 9 Petr Vobornik 2018-05-15 13:50:44 UTC
Fixed in Bug 1497334

[root@vm-042 pvoborni]# ipa-replica-install -n 1234
Usage: ipa-replica-install [options] [REPLICA_FILE]

ipa-replica-install: error: option --domain: single label domains are not supported
ipapython.admintool: ERROR    The ipa-replica-install command failed. See /var/log/ipareplica-install.log for more information
[root@vm-042 pvoborni]# rpm -q freeipa-server
freeipa-server-4.6.90.pre1.dev201805020815+gitc925b44f4-0.fc27.x86_64
[root@vm-042 pvoborni]# ipa-replica-install -n 1
Usage: ipa-replica-install [options] [REPLICA_FILE]

ipa-replica-install: error: option --domain: single label domains are not supported
ipapython.admintool: ERROR    The ipa-replica-install command failed. See /var/log/ipareplica-install.log for more information

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