projectnessie / nessie

Nessie: Transactional Catalog for Data Lakes with Git-like semantics
https://projectnessie.org
Apache License 2.0
1.04k stars 129 forks source link

[Bug]: GC causing "Provider org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider not found" #9943

Open AlekHed opened 19 hours ago

AlekHed commented 19 hours ago

What happened

After updating nessie gc jar to version 0.100.0 started receiving error:

17:27:05,847 |-INFO in ch.qos.logback.classic.util.ContextInitializer@65e98b1c - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 167 milliseconds. ExecutionStatus=DO_NOT_INVOKE_NEXT_IF_ANY
Exception in thread "main" java.util.ServiceConfigurationError: 
java.net.spi.InetAddressResolverProvider: Provider org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider not found
    at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:589)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1215)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1224)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1269)
    at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1305)
    at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1387)
    at java.base/java.util.ServiceLoader.findFirst(ServiceLoader.java:1800)
    at java.base/java.net.InetAddress.loadResolver(InetAddress.java:508)
    at java.base/java.net.InetAddress.resolver(InetAddress.java:488)
    at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1814)
    at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1149)
    at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1806)
    at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1676)
    at java.base/java.net.InetAddress.getByName(InetAddress.java:1578)
    at java.base/java.net.InetSocketAddress.<init>(InetSocketAddress.java:230)
    at org.postgresql.core.PGStream.createSocket(PGStream.java:258)
    at org.postgresql.core.PGStream.<init>(PGStream.java:121)
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:140)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:268)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:273)
    at org.postgresql.Driver.makeConnection(Driver.java:446)
    at org.postgresql.Driver.connect(Driver.java:298)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:225)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:580)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:561)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1570)

Interesting, that I have same problem if i try to run with same configs using docker run on official nessie gc 0.100.0 image.

How to reproduce it

run gc from shell:

AWS_REGION=us-east-1 java -jar nessie-gc.jar gc \
  --jdbc-url jdbc:postgresql://dbhost:5432/db \
  --jdbc-user user \
  --jdbc-password password \
  --uri http://nessie:8181/api/v2 \
  --iceberg=s3.access-key-id=user01,s3.secret-access-key=password,s3.endpoint=https://storage,s3.path-style-access=false

Nessie server type (docker/uber-jar/built from source) and version

uber-jar/docker

Client type (Ex: UI/Spark/pynessie ...) and version

zsh

Additional information

Java:

java 22.0.2 2024-07-16
Java(TM) SE Runtime Environment (build 22.0.2+9-70)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)

OS:

ProductName:        macOS
ProductVersion:     15.0
BuildVersion:       24A335
adutra commented 19 hours ago

Possible cause:

https://github.com/dnsjava/dnsjava/issues/338

adutra commented 19 hours ago

Also: https://github.com/dnsjava/dnsjava/issues/329

dimas-b commented 18 hours ago

I see that those linked discussion mention multi-release jars... Could it be that the Nessie build packages them incorrectly?

adutra commented 18 hours ago

I think it's rather the fact that the user is running Java 22, and dnsjava multi-release jars are broken for Java >= 18 it seems.