dCache / dcache

dCache - a system for storing and retrieving huge amounts of data, distributed among a large number of heterogenous server nodes, under a single virtual filesystem tree with a variety of standard access methods
https://dcache.org
291 stars 136 forks source link

Unable to parse the boolean system property java.net.preferIPv6Addresses #7056

Closed ageorget closed 1 year ago

ageorget commented 1 year ago

Hello,

I can see this error in pool logs :

Mar 14 10:49:30 ccdcacli372.in2p3.fr dcache@ccdcacli372-pool-atlas-aod-read-li372a-Domain[231548]: 14 Mar 2023 10:49:30 (pool-atlas-aod-read-li372a) [door:webdav-ccdcatli406@webdav-ccdcatli406Domain:AAX22STgtqA pool-atlas-xferout-li421a PoolDeliverFile 00002F115ABB283D498B9923BAC66BE16053] Unable to parse the boolean system property 'java.net.preferIPv6Addresses':system - using the default value: false

Mar 14 11:31:54 ccdcacli375.in2p3.fr dcache@ccdcacli375-pool-atlas-aod-read-li375a-Domain[208189]: 14 Mar 2023 11:31:54 (pool-atlas-aod-read-li375a) [door:xrootd-ccdcacli331@xrootd-ccdcacli331Domain:AAX22SVRM4A pool-atlas-xferout-li300a PoolDeliverFile 000030F68E97F959420B9677705203FE3083] Unable to parse the boolean system property 'java.net.preferIPv6Addresses':system - using the default value: false

We are using the default value -Djava.net.preferIPv6Addresses=system for dcache.java.options. with dCache 8.2.16.

Cheers, Adrien

alrossi commented 1 year ago

It seems to me that the system property should have either true or false values

https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html

'system' is not valid.

paulmillar commented 1 year ago

IIRC, it depends on the JVM/Java version. Support for system is supported in newer Java versions.

ageorget commented 1 year ago

That's the default value used by dCache since the 8.2 version https://github.com/dCache/dcache/commit/da994201f1e90191030a631c54241c8bbe240565

(not-for-services)dcache.java.options=\
    -server \
    -Xmx${dcache.java.memory.heap} \
    -XX:MaxDirectMemorySize=${dcache.java.memory.direct} \
    -Dsun.net.inetaddr.ttl=${dcache.net.inetaddr.lifetime} \
    -Dorg.globus.tcp.port.range=${dcache.net.wan.port.min},${dcache.net.wan.port.max} \
    -Dorg.dcache.dcap.port=${pool.mover.dcap.port} \
    -Dorg.dcache.ftp.log-aborted-transfers=${pool.mover.ftp.enable.log-aborted-transfers} \
    -Dorg.dcache.net.tcp.portrange=${dcache.net.lan.port.min}:${dcache.net.lan.port.max} \
    -Djava.security.krb5.realm=${dcache.authn.kerberos.realm} \
    -Djava.security.krb5.kdc=${dcache.authn.kerberos.key-distribution-center-list} \
    -Djavax.security.auth.useSubjectCredsOnly=false \
    -Djava.security.auth.login.config=${dcache.authn.jaas.config} \
    -Dcontent.types.user.table=${dcache.paths.content-types} \
    -Dzookeeper.sasl.client=false \
    -Dcurator-dont-log-connection-problems=true \
    -XX:+HeapDumpOnOutOfMemoryError \
    -XX:HeapDumpPath=${dcache.java.oom.file} \
    -XX:+ExitOnOutOfMemoryError \
    -XX:+StartAttachListener \
    -XX:+UseCompressedOops \
    -javaagent:${dcache.paths.classes}/aspectjweaver-1.9.2.jar \
    -Djava.net.preferIPv6Addresses=system \
    ${dcache.java.options.common} \
    ${dcache.java.options.extra}
paulmillar commented 1 year ago

java.net.preferIPv6Addresses=system is supported in OpenJDK v11 (and newer), but not in OpenJDK v8.

If you see this message, I assume you are running JDK v8.

According to our download page, all supported dCache versions require JDK v11 (or newer).

If you're currently running JDK v8 then I suggest upgrading to JDK v11 and see if that helps.

ageorget commented 1 year ago

That's strange because we only use OpenJDK v11 on all of our dCache servers :

/usr/bin/java -version
openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.17.0.8-2.el7_9) (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.17.0.8-2.el7_9) (build 11.0.17+8-LTS, mixed mode, sharing)

root     231548  6.3 11.2 17285576 3640608 ?    Ssl  Mar14 107:16 /usr/bin/java -server -Xmx4096m -XX:MaxDirectMemorySize=3072m -Dsun.net.inetaddr.ttl=1800 -Dorg.globus.tcp.port.range=30000,31000 -Dorg.dcache.dcap.port=0 -Dorg.dcache.ftp.log-aborted-transfers=true -Dorg.dcache.net.tcp.portrange=33115:33145 -Djava.security.krb5.realm= -Djava.security.krb5.kdc= -Djavax.security.auth.useSubjectCredsOnly=false -Djava.security.auth.login.config=/etc/dcache/jgss.conf -Dcontent.types.user.table=/etc/dcache/content-types.properties -Dzookeeper.sasl.client=false -Dcurator-dont-log-connection-problems=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/spool/dcache/log/ccdcacli372-pool-atlas-aod-read-li372a-Domain-oom.hprof -XX:+ExitOnOutOfMemoryError -XX:+StartAttachListener -XX:+UseCompressedOops -javaagent:/usr/share/dcache/classes/aspectjweaver-1.9.2.jar -Djava.net.preferIPv6Addresses=system -Djava.awt.headless=true -DwantLog4jSetup=n -Dorg.bouncycastle.dh.allow_unsafe_p_value=true -Ddcache.home=/usr/share/dcache -Ddcache.paths.defaults=/usr/share/dcache/defaults org.dcache.boot.BootLoader start ccdcacli372-pool-atlas-aod-read-li372a-Domain
paulmillar commented 1 year ago

It's not a great test, but could you try the following commands?

paul@sprocket:~$ echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=false -
Hello, world
paul@sprocket:~$ echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=foo -
Hello, world
paul@sprocket:~$ echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=true -
Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(0:0:0:0:0:0:0:1) [...]
[...]
paul@sprocket:~$ echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=system -
Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(0:0:0:0:0:0:0:1) [...]
[...]
paul@sprocket:~$ 

The above example is with Java 11:

paul@sprocket:~$ java -version
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment (build 11.0.18+10-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Debian-1deb11u1, mixed mode, sharing)
paul@sprocket:~$ 

As an explanation, there's a bug in jshell where it crashes if given an IPv6 address to work with.

If preferIPv6Addresses is false or an unknown value (like foo above) then jshell has an IPv4 address (127.0.0.1) and everything is fine. If it is true then it has an IPv6 address (::1) and the bug is triggered.

If your JRE supports preferIPv6Addresses=system then you should see a crash (like my last example above). It system is not supported then jshell should launch without a problem (as system is an unknown value, so treated as false).

ageorget commented 1 year ago

It crashed but with another exception :

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=false -
Hello, world

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=foo -
Hello, world

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=true -
Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(0:0:0:0:0:0:0:1) --
  Exception: java.lang.InternalError: Failed remote listen: java.lang.IllegalArgumentException: unable to parse port number in address @ com.sun.jdi.SocketListen (defaults: timeout=, port=, localAddress=) -- {timeout=timeout=5000, port=port=, localAddress=localAddress=0:0:0:0:0:0:0:1}
                  jdk.jshell/jdk.jshell.execution.JdiInitiator.reportLaunchFail(JdiInitiator.java:300)
                  jdk.jshell/jdk.jshell.execution.JdiInitiator.listenTarget(JdiInitiator.java:199)
                  jdk.jshell/jdk.jshell.execution.JdiInitiator.<init>(JdiInitiator.java:111)
                  jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:103)
                  jdk.jshell/jdk.jshell.execution.JdiExecutionControlProvider.generate(JdiExecutionControlProvider.java:152)
      cause: java.lang.IllegalArgumentException: unable to parse port number in address
FailOverExecutionControlProvider: FAILED: 1:jdi:launch(true) --
  Exception: java.net.SocketTimeoutException: Accept timed out
                  java.base/java.net.PlainSocketImpl.socketAccept(Native Method)
                  java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474)
                  java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565)
                  java.base/java.net.ServerSocket.accept(ServerSocket.java:533)
                  jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116)
FailOverExecutionControlProvider: FAILED: 2:jdi --
  Exception: java.net.SocketTimeoutException: Accept timed out
                  java.base/java.net.PlainSocketImpl.socketAccept(Native Method)
                  java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474)
                  java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565)
                  java.base/java.net.ServerSocket.accept(ServerSocket.java:533)
                  jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116)

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=system -
Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(0:0:0:0:0:0:0:1) --
  Exception: java.lang.InternalError: Failed remote listen: java.lang.IllegalArgumentException: unable to parse port number in address @ com.sun.jdi.SocketListen (defaults: timeout=, port=, localAddress=) -- {timeout=timeout=5000, port=port=, localAddress=localAddress=0:0:0:0:0:0:0:1}
                  jdk.jshell/jdk.jshell.execution.JdiInitiator.reportLaunchFail(JdiInitiator.java:300)
                  jdk.jshell/jdk.jshell.execution.JdiInitiator.listenTarget(JdiInitiator.java:199)
                  jdk.jshell/jdk.jshell.execution.JdiInitiator.<init>(JdiInitiator.java:111)
                  jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:103)
                  jdk.jshell/jdk.jshell.execution.JdiExecutionControlProvider.generate(JdiExecutionControlProvider.java:152)
      cause: java.lang.IllegalArgumentException: unable to parse port number in address
FailOverExecutionControlProvider: FAILED: 1:jdi:launch(true) --
  Exception: java.net.SocketTimeoutException: Accept timed out
                  java.base/java.net.PlainSocketImpl.socketAccept(Native Method)
                  java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474)
                  java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565)
                  java.base/java.net.ServerSocket.accept(ServerSocket.java:533)
                  jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116)
FailOverExecutionControlProvider: FAILED: 2:jdi --
  Exception: java.net.SocketTimeoutException: Accept timed out
                  java.base/java.net.PlainSocketImpl.socketAccept(Native Method)
                  java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474)
                  java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565)
                  java.base/java.net.ServerSocket.accept(ServerSocket.java:533)
                  jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116)

openjdk version "11.0.18" 2023-01-17 LTS OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-1.el7_9) (build 11.0.18+10-LTS) OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-1.el7_9) (build 11.0.18+10-LTS, mixed mode, sharing)java11

alrossi commented 1 year ago

This is a problem with Netty not supporting the system​ value.

I opened a GH issue with them, seems they have corrected the problem:

https://github.com/netty/netty/issues/13300

we will have to update the Netty dependency.

Al


Albert L. Rossi Senior Software Developer Scientific Computing Division, Scientific Data Services, Distributed Data Development WH 566 Fermi National Accelerator Laboratory Batavia, IL 60510 (630) 840-3023


From: ageorget @.> Sent: Wednesday, March 15, 2023 9:53 AM To: dCache/dcache @.> Cc: Albert Rossi @.>; Comment @.> Subject: Re: [dCache/dcache] Unable to parse the boolean system property java.net.preferIPv6Addresses (Issue #7056)

It crashed but with another exception :

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=false - Hello, world

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=foo - Hello, world

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=true - Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(0:0:0:0:0:0:0:1) -- Exception: java.lang.InternalError: Failed remote listen: java.lang.IllegalArgumentException: unable to parse port number in address @ com.sun.jdi.SocketListen (defaults: timeout=, port=, localAddress=) -- {timeout=timeout=5000, port=port=, localAddress=localAddress=0:0:0:0:0:0:0:1} jdk.jshell/jdk.jshell.execution.JdiInitiator.reportLaunchFail(JdiInitiator.java:300) jdk.jshell/jdk.jshell.execution.JdiInitiator.listenTarget(JdiInitiator.java:199) jdk.jshell/jdk.jshell.execution.JdiInitiator.(JdiInitiator.java:111) jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:103) jdk.jshell/jdk.jshell.execution.JdiExecutionControlProvider.generate(JdiExecutionControlProvider.java:152) cause: java.lang.IllegalArgumentException: unable to parse port number in address FailOverExecutionControlProvider: FAILED: 1:jdi:launch(true) -- Exception: java.net.SocketTimeoutException: Accept timed out java.base/java.net.PlainSocketImpl.socketAccept(Native Method) java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474) java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565) java.base/java.net.ServerSocket.accept(ServerSocket.java:533) jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116) FailOverExecutionControlProvider: FAILED: 2:jdi -- Exception: java.net.SocketTimeoutException: Accept timed out java.base/java.net.PlainSocketImpl.socketAccept(Native Method) java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474) java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565) java.base/java.net.ServerSocket.accept(ServerSocket.java:533) jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116)

echo 'System.out.println("Hello, world");' | jshell -J-Djava.net.preferIPv6Addresses=system - Launching JShell execution engine threw: FailOverExecutionControlProvider: FAILED: 0:jdi:hostname(0:0:0:0:0:0:0:1) -- Exception: java.lang.InternalError: Failed remote listen: java.lang.IllegalArgumentException: unable to parse port number in address @ com.sun.jdi.SocketListen (defaults: timeout=, port=, localAddress=) -- {timeout=timeout=5000, port=port=, localAddress=localAddress=0:0:0:0:0:0:0:1} jdk.jshell/jdk.jshell.execution.JdiInitiator.reportLaunchFail(JdiInitiator.java:300) jdk.jshell/jdk.jshell.execution.JdiInitiator.listenTarget(JdiInitiator.java:199) jdk.jshell/jdk.jshell.execution.JdiInitiator.(JdiInitiator.java:111) jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:103) jdk.jshell/jdk.jshell.execution.JdiExecutionControlProvider.generate(JdiExecutionControlProvider.java:152) cause: java.lang.IllegalArgumentException: unable to parse port number in address FailOverExecutionControlProvider: FAILED: 1:jdi:launch(true) -- Exception: java.net.SocketTimeoutException: Accept timed out java.base/java.net.PlainSocketImpl.socketAccept(Native Method) java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474) java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565) java.base/java.net.ServerSocket.accept(ServerSocket.java:533) jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116) FailOverExecutionControlProvider: FAILED: 2:jdi -- Exception: java.net.SocketTimeoutException: Accept timed out java.base/java.net.PlainSocketImpl.socketAccept(Native Method) java.base/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:474) java.base/java.net.ServerSocket.implAccept(ServerSocket.java:565) java.base/java.net.ServerSocket.accept(ServerSocket.java:533) jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.create(JdiDefaultExecutionControl.java:116)

openjdk version "11.0.18" 2023-01-17 LTS OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-1.el7_9) (build 11.0.18+10-LTS) OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-1.el7_9) (build 11.0.18+10-LTS, mixed mode, sharing)java11

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dCache_dcache_issues_7056-23issuecomment-2D1470153097&d=DwMCaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=60rQ0HHqHmEY1P6VSdyuTQ&m=UHphn6yJUCjTrTjYWAjmvjyt4UmdaZu1kxmm9BTN1i2WRP7RvB9dx7PeybWPbOr-&s=ut3MsLesoIIdNe1HwOIfCFOtFVKMI-K18eBnKVPx4LY&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AA6NBHEYNHM6ZM6ASN764SLW4HJWLANCNFSM6AAAAAAV2IK3M4&d=DwMCaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=60rQ0HHqHmEY1P6VSdyuTQ&m=UHphn6yJUCjTrTjYWAjmvjyt4UmdaZu1kxmm9BTN1i2WRP7RvB9dx7PeybWPbOr-&s=UuCpT-2YRbB_VI6gVrNXDSCc_f0Pb3EKtJDA6R2YHaA&e=. You are receiving this because you commented.Message ID: @.***>

ageorget commented 1 year ago

Hello,

Any plans to update the Netty package in the next dCache release? dCache is still using IPv4 protocol by default for transfers as the system value is rejected.

Adrien