View Issue Details

IDProjectCategoryView StatusLast Update
0007818CentOS-7ipa-serverpublic2014-11-13 12:04
Reportersubscribe.becke@gmail.com Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version7.0-1406 
Summary0007818: ipa-server-install: Cannot handle double hyphen "--" in hostname
DescriptionWhen running:
~]# ipa-server-install
...
Server host name [becke-ch--directory--s0-v1.becke.ch]: becke-ch--directory--s0-v1.becke.ch
...
I get:
Invalid hostname 'becke-ch--directory--s0-v1.becke.ch', only letters, numbers, '-' are allowed. DNS label may not start or end with '-'

BUT when I enter:
Server host name [becke-ch--directory--s0-v1.becke.ch]: becke-ch-directory-s0-v1.becke.ch
Then it runs fine.

FYI: It is well allowed to use double hyphens "--" in hostname / domain-name.
Steps To ReproduceSee above: Use a host-name that contains double hyphens "--":
Run:
~]# ipa-server-install
...
Server host name [becke-ch--directory--s0-v1.becke.ch]: becke-ch--directory--s0-v1.becke.ch
...
I get:
Invalid hostname 'becke-ch--directory--s0-v1.becke.ch', only letters, numbers, '-' are allowed. DNS label may not start or end with '-'

Then remove the double hyphens "--" and only use single hyphen "-" and then it runs fine.
TagsNo tags attached.
abrt_hash
URL

Activities

subscribe.becke@gmail.com

subscribe.becke@gmail.com

2014-11-04 19:39

reporter   ~0021544

SOLUTION: Replace regex repetition "?" with "*": See:
]# diff util.py /usr/lib/python2.7/site-packages/ipalib/util.py
231c231
< label_regex = r'^[%(base)s%(extra)s]([%(base)s%(extra)s%(middle)s]?[%(base)s%(extra)s])*$' \
---
> label_regex = r'^[%(base)s%(extra)s]([%(base)s%(extra)s%(middle)s]*[%(base)s%(extra)s])*$' \
subscribe.becke@gmail.com

subscribe.becke@gmail.com

2014-11-08 07:36

reporter   ~0021616

After fixing this issue the installation failed later on due to this fix:
...
[2/22]: configuring certificate server instance
ipa : CRITICAL failed to configure ca instance Command '/usr/sbin/pkispawn -s CA -f /tmp/tmp72m3kU' returned non-zero exit status 1
Configuration of CA failed
...

Which was caused by: /var/log/pki/pki-tomcat/catalina.out
...
WARNING: Catalina.start using conf/server.xml: The string "--" is not permitted within comments.
Nov 07, 2014 10:12:05 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 31 column 40: The string "--" is not permitted within comments.
org.xml.sax.SAXParseException; systemId: file:/var/lib/pki/pki-tomcat/conf/server.xml; lineNumber: 31; columnNumber: 40; The string "--" is not permitted within comments.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
...

So there seems to be an issue with tomcat pki that it cannot double hyphens "--" in hostname!
subscribe.becke@gmail.com

subscribe.becke@gmail.com

2014-11-13 12:04

reporter   ~0021662

This issue is as well tracked and in progress in the following locations:
https://bugzilla.redhat.com/show_bug.cgi?id=1160555
https://bugzilla.redhat.com/show_bug.cgi?id=1162173
https://fedorahosted.org/freeipa/ticket/4710

Issue History

Date Modified Username Field Change
2014-11-03 09:56 subscribe.becke@gmail.com New Issue
2014-11-04 19:39 subscribe.becke@gmail.com Note Added: 0021544
2014-11-08 07:36 subscribe.becke@gmail.com Note Added: 0021616
2014-11-13 12:04 subscribe.becke@gmail.com Note Added: 0021662