question

penky28_147901 avatar image
penky28_147901 asked Erick Ramirez edited

nodetool with Java 8u331 returns "URISyntaxException: 'Malformed IPv6 address at index 7: rmi://[127.0.0.1]:7199'"

Hi All,

To fix one of the vulnerability, Java version is upgraded from java version "1.8.0_301" to "1.8.0_331"

After java upgrade, "nodetool" command is not working.

nodetool: Failed to connect to '127.0.0.1:7199' - URISyntaxException: 'Malformed IPv6 address at index 7: rmi://[127.0.0.1]:7199'.

Cassandra version: 3.11.3

Any suggestions?

nodetool
1 comment
10 |1000

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

penky28_147901 avatar image penky28_147901 commented ·

GitHub has the following fix for version- 8u332


https://github.com/apache/cassandra/pull/1586

0 Likes 0 ·
fruch avatar image
fruch answered Erick Ramirez edited

see https://www.oracle.com/java/technologies/javase/8u331-relnotes.html#JDK-8278972

seem like now the RMI has stricter validations, but can be lower back

3 comments 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.

penky28_147901 avatar image penky28_147901 commented ·
Hi Fruch, I tried the options present in the url but it didn't work.
0 Likes 0 ·
fruch avatar image fruch penky28_147901 commented ·

adding `-Dcom.sun.jndi.rmiURLParsing=legacy` to the nodetool command line worked for me as a workaround

https://github.com/scylladb/scylla-ccm/pull/383

0 Likes 0 ·
penky28_147901 avatar image penky28_147901 fruch commented ·

I tried the above command by adding to Cassandra-env.sh file . Now I see why it didn't work earlier.


one more workaround..


nodetool -h ::FFFF:127.0.0.1 version


0 Likes 0 ·
Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

Thanks to fruch's response, it looks like the URL parser for JNDI providers which includes RMI (used by JMX) has been improved in Oracle Java 8u331 and brackets are only allowed around IPv6 addresses (JDK-8278972).

Attempts to run nodetool with Java 8u331 breaks because the host in the RMI URL is enclosed in square brackets (from NodeProbe.java class):

    private static final String fmtUrl = "service:jmx:rmi:///jndi/rmi://[%s]:%d/jmxrmi";

I have reached out to Jermy Li who posted PR #1586 you linked and requested him to submit a JIRA for the issue so it can be tracked (CASSANDRA-17581).

Thanks to you and fruch for sharing the following workarounds:

OPTION 1 - Add the "legacy" parsing flag when running nodetool, for example:

$ nodetool -Dcom.sun.jndi.rmiURLParsing=legacy status

OPTION 2 - Specify the hostname with an IPv6 subnet prefix, for example:

$ nodetool -h ::FFFF:127.0.0.1 status

Republished to DBA Stack Exchange.

2 comments 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.

dmngaya avatar image dmngaya commented ·

Hi,

Thank you but my problem is not from nodetool but dsetool.

I know this fix for nodetool.

are you sure it works also for destool ?

[atdcassandra1@avelp1219p17 ~]$ dsetool -Dcom.sun.jndi.rmiURLParsing=legacy -h avelp1219p17 core_indexing_status eaa.measurement

error below:

Unknown command: -Dcom.sun.jndi.rmiURLParsing=legacy


0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ dmngaya commented ·

Answered in question #13941. Cheers!

1 Like 1 ·