Bug 1163849

Summary: error message which is not understandable when IDNA2003 characters are present in --zonemgr (--zonemgr=Têko@redhat.com)
Product: Red Hat Enterprise Linux 7 Reporter: Kaleem <ksiddiqu>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.1CC: jcholast, mbasti, mkosek, pvoborni, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.1.0-11.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 10:14:42 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: 1168850    

Description Kaleem 2014-11-13 15:01:57 UTC
Description of problem:
error message which is also not understandable when valid IDNA2003 characters are present in --zonemgr (--zonemgr=Têko)

ipa-server-install: error: invalid zonemgr: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Version-Release number of selected component (if applicable):
[root@dhcp207-66 ~]# rpm -q ipa-server 
ipa-server-4.1.0-5.el7.x86_64
[root@dhcp207-66 ~]# 

How reproducible:
Always

Steps to Reproduce:
1.IPA server install with --zonemgr with valid IDNA2003 characters 
ipa-server-install --setup-dns --forwarder=10.65.201.89  -r TESTRELM.TEST -p xxxxxxxx -P xxxxxxxx -a xxxxxxxx --zonemgr=Têko -U

Actual results:
IPA installation should have been successful.

Expected results:
Installation fails with following error message.

ipa-server-install: error: invalid zonemgr: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Comment 2 Petr Vobornik 2014-11-13 17:04:25 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/4724

Comment 3 Martin Bašti 2014-11-13 17:32:19 UTC
Expected result is:

Value is accepted, we support IDNA2003 in DNS plugin.

Comment 6 Kaleem 2014-11-27 11:31:29 UTC
Following error message thrown but while configuring named component.

"ConversionError: invalid 'admin_email': domain name 'Têko.redhat.com' should be normalized to: tãako.redhat.com "

It should throw this error message before installation proceeds.

[root@dhcp207-214 ~]# ipa-server-install --setup-dns --forwarder=10.16.36.29  -r TESTRELM.TEST -p xxxxxxx -P xxxxxxx -a xxxxxxx --zonemgr=Têko -U

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)
...
....
Restarting Directory server to apply updates
  [1/2]: stopping directory server
  [2/2]: starting directory server
Done.
Restarting the directory server
Restarting the KDC
Restarting the certificate server
Configuring DNS (named)
  [1/12]: generating rndc key file
  [2/12]: adding DNS container
  [3/12]: setting up our zone
  [error] ConversionError: invalid 'admin_email': domain name 'Têko.redhat.com' should be normalized to: tãako.redhat.com
Unexpected error - see /var/log/ipaserver-install.log for details:
ConversionError: invalid 'admin_email': domain name 'Têko.redhat.com' should be normalized to: tãako.redhat.com
[root@dhcp207-214 ~]#

[root@dhcp207-214 ~]# rpm -q ipa-server
ipa-server-4.1.0-10.el7.x86_64
[root@dhcp207-214 ~]#

Comment 7 Jan Cholasta 2014-11-27 13:39:16 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/4771

Comment 10 Kaleem 2014-12-12 12:27:26 UTC
Still seeing the crash on strerr stream with return code 2 . Expected is return code 1 with no crash on streer stream also.

[root@dhcp207-1 install-server-cli]# rpm -q ipa-server
ipa-server-4.1.0-12.el7.x86_64
[root@dhcp207-1 install-server-cli]#

[root@dhcp207-1 install-server-cli]# ipa-server-install --setup-dns --forwarder=10.65.201.89  -r TESTRELM.TEST -p xxxxxxxx -P xxxxxxxx -a xxxxxxxx --zonemgr=Têko -U
Usage: ipa-server-install [options]

ipa-server-install: error: invalid zonemgr: domain name 'Têko.redhat.com' should be normalized to: tãako.redhat.com
[root@dhcp207-1 install-server-cli]# echo $?
2
[root@dhcp207-1 install-server-cli]# ipa-server-install --setup-dns --forwarder=10.65.201.89  -r TESTRELM.TEST -p xxxxxxxx -P xxxxxxxx -a xxxxxxxx --zonemgr=Têko -U > /tmp/ipaserverinstall_invalidzonemgr.out 2>&1
[root@dhcp207-1 install-server-cli]# cat /tmp/ipaserverinstall_invalidzonemgr.out Usage: ipa-server-install [options]

Traceback (most recent call last):
  File "/usr/sbin/ipa-server-install", line 1343, in <module>
    safe_options, options = parse_options()
  File "/usr/sbin/ipa-server-install", line 288, in parse_options
    options, args = parser.parse_args()
  File "/usr/lib64/python2.7/optparse.py", line 1399, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1439, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1514, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib64/python2.7/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib64/python2.7/optparse.py", line 808, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/bindinstance.py", line 414, in zonemgr_callback
    parser.error("invalid zonemgr: " + unicode(e))
  File "/usr/lib64/python2.7/optparse.py", line 1583, in error
    self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
  File "/usr/lib64/python2.7/optparse.py", line 1572, in exit
    sys.stderr.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 58-59: ordinal not in range(128)
[root@dhcp207-1 install-server-cli]#

Comment 11 Martin Bašti 2014-12-12 13:04:01 UTC
Why is required to have return code 1? I'm not aware that I changed the return code. Return code 2 is parser option error, and IMO it is the right return code, because installation is terminated during parsing options.

Comment 12 Kaleem 2014-12-12 15:42:52 UTC
(In reply to mbasti from comment #11)
> Why is required to have return code 1? I'm not aware that I changed the
> return code. Return code 2 is parser option error, and IMO it is the right
> return code, because installation is terminated during parsing options.

My bad, just picked from the previous test case (incorrect hostname) where installation proceeded beyond parsing options.

Comment 13 Martin Kosek 2014-12-17 12:36:55 UTC
Moving back to ON_QA. The exception found in Comment 10 is now tracked in

https://fedorahosted.org/freeipa/ticket/4805

and should be fixed in FreeIPA 4.2.

Comment 15 Martin Kosek 2015-01-21 15:01:03 UTC
This is not a regression, IDN is new in RHEL-7.1.

Comment 16 Kaleem 2015-01-22 11:01:39 UTC
Verified.

IPA Version:
============
[root@dhcp207-214 ~]# rpm -q ipa-server
ipa-server-4.1.0-15.el7.x86_64
[root@dhcp207-214 ~]# 

Proper error message displayed now

[root@dhcp207-214 ~]# ipa-server-install --setup-dns --forwarder=10.11.5.19  -r TESTRELM.TEST -p xxxxxxxx -P xxxxxxxx -a xxxxxxxx --zonemgr=Têko -U
Usage: ipa-server-install [options]

ipa-server-install: error: invalid zonemgr: domain name 'Têko.redhat.com' should be normalized to: tãako.redhat.com
[root@dhcp207-214 ~]# 

Observation of Comment 10 is covered in https://fedorahosted.org/freeipa/ticket/4805

Comment 18 errata-xmlrpc 2015-03-05 10:14:42 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://rhn.redhat.com/errata/RHSA-2015-0442.html