Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

dmngaya avatar image
dmngaya asked Erick Ramirez answered

dsetool returns InvalidNameException, "Malformed IPv6 address at index 7"

Hi,

Since we upgraded to openjdk version "1.8.0_332", we are getting error below with dsetool:

$ dsetool core_indexing_status eaa.measurement

java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.InvalidNameException: Malformed IPv6 address at index 7: rmi://[avelp1219p17]:7199 [Root exception is java.lang.IllegalArgumentException: Malformed IPv6 address at index 7: rmi://[avelp1219p17]:7199]
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
    at org.apache.cassandra.tools.NodeProbe.connect(NodeProbe.java:195)
    at org.apache.cassandra.tools.NodeProbe.<init>(NodeProbe.java:148)
    at com.datastax.bdp.tools.DseTool.run(DseTool.java:269)
    at com.datastax.bdp.tools.DseTool.run(DseTool.java:201)
    at com.datastax.bdp.tools.DseTool.main(DseTool.java:320)
Caused by: javax.naming.InvalidNameException: Malformed IPv6 address at index 7: rmi://[avelp1219p17]:7199 [Root exception is java.lang.IllegalArgumentException: Malformed IPv6 address at index 7: rmi://[avelp1219p17]:7199]
    at com.sun.jndi.url.rmi.rmiURLContext$Parser.newNamingException(rmiURLContext.java:295)
    at com.sun.jndi.url.rmi.rmiURLContext$Parser.parseCompat(rmiURLContext.java:223)
    at com.sun.jndi.url.rmi.rmiURLContext$Parser.parse(rmiURLContext.java:109)
    at com.sun.jndi.url.rmi.rmiURLContext.getRootURLContext(rmiURLContext.java:314)
    at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:215)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)
    at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)
    ... 6 more
Caused by: java.lang.IllegalArgumentException: Malformed IPv6 address at index 7: rmi://[avelp1219p17]:7199
    at java.net.URI.create(URI.java:852)
    at com.sun.jndi.url.rmi.rmiURLContext$Parser.parseCompat(rmiURLContext.java:213)
    ... 13 more
Caused by: java.net.URISyntaxException: Malformed IPv6 address at index 7: rmi://[avelp1219p17]:7199
    at java.net.URI$Parser.fail(URI.java:2847)
    at java.net.URI$Parser.parseIPv6Reference(URI.java:3468)
    at java.net.URI$Parser.parseServer(URI.java:3218)
    at java.net.URI$Parser.parseAuthority(URI.java:3154)
    at java.net.URI$Parser.parseHierarchical(URI.java:3096)
    at java.net.URI$Parser.parse(URI.java:3052)
    at java.net.URI.<init>(URI.java:588)
    at java.net.URI.create(URI.java:850)

How to resolve that ?

Thanks,

dse
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

steve.lacerda avatar image
steve.lacerda answered

Please refer to this answer:

https://community.datastax.com/questions/13764/java-version-for-cassandra-3113.html

Also, please note the latest versions of DSE have resolved this issue.

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

Background

The Java logic behind the dsetool command constructs the the JMX RMI uniform resource ID (URI) with the target hostname enclosed in square brackets ([]):

    rmi://[host]:jmx_port

From Java 8 update 331, the URL parser for JNDI providers which includes RMI (used by JMX) is a lot stricter and brackets are only allowed around IPv6 addresses (JDK-8278972).

Workaround

Override the new logic in the new URL parser by editing bin/dsetool and modify this last command in the shell script:

"$JAVA" $JAVA_AGENT \
        $JVM_OPTS \
        $DSE_OPTS \
        -cp "$CP" \
        -Dcassandra.storagedir=$cassandra_storagedir \
        -Dstorage-config=$CASSANDRA_CONF \
        -Dlogback.configurationFile=logback-tools.xml \
        $JVM_ARGS \
        com.datastax.bdp.tools.DseTool $DSE_JMX_CREDENTIALS $DSETOOL_CREDENTIALS --jmxport=$JMX_PORT $ARGS

to include this Java VM option which tells Java to use the legacy parser:

    -Dcom.sun.jndi.rmiURLParsing=legacy

Solution

This issue has been fixed by DSP-22474 in DSE 5.1.31, 6.0.18, 6.7.17 and 6.8.23.

Upgrade to the latest version of DataStax Enterprise. If you need assistance or have follow up questions, please log a ticket with DataStax Support so one of our engineers can assist you directly. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.