Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-505

dsreplication enable fails when hostname contains an underscore

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6.0
    • Fix Version/s: None
    • Component/s: replication
    • Labels:
    • Environment:
      Mac OS X 10.7, Java 1.6.0_31

      Description

      When dsreplication enable is called with a hostname that contains an underscore, the following exception is thrown:

      ---------------------------------
      bin/dsreplication enable -X --host1 illegal_host_name --port1 4444 --bindDN1 "cn=Directory Manager" \
      --bindPassword1 "secret" --host2 illegal_host_name --port2 5444 --bindDN2 "cn=Directory Manager" \
      --bindPassword2 "secret" --secureReplication1 --secureReplication2 --replicationPort2 8990 \
      -w secret -n -b "dc=example,dc=com"

      Establishing connections ..... Done.
      Checking registration information .....
      Error updating registration information. Details: Registration information
      error. Error type: 'ERROR_UNEXPECTED'. Details:
      javax.naming.directory.InvalidAttributeValueException: 'hostname' has no
      values.; remaining name 'cn=null:4444,cn=Servers,cn=admin data'
      See
      /var/folders/bh/th445qyd0ldcblbf_5xzsxxc0000gn/T/opendj-replication-9171122199231087850.log
      for a detailed log of this operation.

      ---------------------------------

      The reason for this error seems to be the usage of java.net.URI, especially the getHost() method. This method returns null if the hostname contains an underscore.
      As per RFC 2181 it is okay to have underscores in domain names (see http://stackoverflow.com/a/2183140).

      I suggest to use another method/class to derive the hostname from the InitialLdapContext (if possible).

        Attachments

          Activity

            People

            • Assignee:
              matthew Matthew Swift
              Reporter:
              manuelgaupp Manuel Gaupp
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: