google-cloud-java icon indicating copy to clipboard operation
google-cloud-java copied to clipboard

Vertex AI SDK is incompatible with GraalVM native image with --link-at-build-time option.

Open SetoKaiba opened this issue 1 year ago • 7 comments

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

  • Search the issues already opened: https://github.com/googleapis/google-cloud-java/issues
  • Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform

If you are still having issues, please include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title. For example, "[vision]: ..."). General, Core, and Other are also allowed as types
  2. OS type and version: windows 10
  3. Java version: GraalVM 21.0.1
  4. Version(s): vertex 0.1.0

Steps to reproduce

  1. https://github.com/SetoKaiba/gcp_reproduce
  2. Use my project to gradle build native.

Code example

Check the reproduce project.

Stack trace

Caused by: org.graalvm.compiler.debug.GraalError: org.graalvm.compiler.debug.GraalError: org.graalvm.compiler.debug.GraalError: com.oracle.svm.core.util.UserError$UserException: Class initialization of io.grpc.xds.internal.security.SslContextProvider failed. This error is reported at image build time because class io.grpc.xds.internal.security.SslContextProvider is registered for linking at image build time by command line and command line. Use the option

External references such as API reference guides

  • https://github.com/quarkusio/quarkus/discussions/37909
  • https://github.com/grpc/grpc-java/issues/10781
  • https://github.com/grpc/grpc-java/issues/9736

Any additional information below

Quarkus use the flag below.

--link-at-build-time  require types to be fully defined at image build-time. If used
                      without args, all classes in scope of the option are required to
                      be fully defined.

Following these steps guarantees the quickest resolution possible.

Thanks!

SetoKaiba avatar Dec 22 '23 21:12 SetoKaiba

@mpeddada1 @burkedavison @ZhenyiQ

meltsufin avatar Dec 26 '23 03:12 meltsufin

This does not appear to be related to Vertex AI.

Full stack trace:

Caused by: com.oracle.svm.core.util.UserError$UserException: 
    Class initialization of io.grpc.xds.internal.security.SslContextProvider failed. This error is reported at image build time because class io.grpc.xds.internal.security.SslContextProvider is registered for linking at image build time by command line and command line. Use the option 

    '--initialize-at-run-time=io.grpc.xds.internal.security.SslContextProvider'

 to explicitly request initialization of this class at run time.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:187)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:191)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.AllowAllHostedUsagesClassInitializationSupport.computeInitKindAndMaybeInitializeClass(AllowAllHostedUsagesClassInitializationSupport.java:129)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:161)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.maybeInitializeAtBuildTime(ClassInitializationSupport.java:150)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.SVMHost.onTypeReachable(SVMHost.java:310)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.onTypeReachable(AnalysisUniverse.java:699)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.lambda$new$0(AnalysisType.java:310)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        ... 45 more
Caused by: java.lang.NoClassDefFoundError: io/grpc/netty/shaded/io/netty/handler/ssl/util/SimpleTrustManagerFactory
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.defineClass(NativeImageClassLoader.java:500)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.findClassViaClassPath(NativeImageClassLoader.java:452)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.loadClass(NativeImageClassLoader.java:640)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177)
        ... 54 more
Caused by: java.lang.ClassNotFoundException: io.grpc.netty.shaded.io.netty.handler.ssl.util.SimpleTrustManagerFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.loadClass(NativeImageClassLoader.java:652)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        ... 64 more

Issue replicated even after removing Vertex AI dependency from the reproducer project, and replacing with Vision dependency and simple Vision client creation logic:

try (ImageAnnotatorClient client = ImageAnnotatorClient.create()) {
}

Additional notes:

  • ClassNotFoundException generally means GraalVM is not being told to include a class. The reproducer's build.gradle contains configurations { all*.exclude group: 'io.grpc', module: 'grpc-netty-shaded' }. When this is removed from the build file, a different exception ("B") occurs.
  • Exception B refers to a class in the io.grpc.netty.shaded package not being initialized as build time, which is a Quarkus requirement. This can be resolved by in the reproducer with gradle build -Dquarkus.package.type=native -Dquarkus.native.additional-build-args=--initialize-at-build-time=io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider. When this is invoked, a different exception ("C") occurs.
  • Exception C is discussed in this Nov 25, 2022 Graal ticket which has been closed as "Not a GraalVM issue", and points to Quarkus's documentation on recommendations to resolve this type of issue.

Exception B:

Error: An object of type 'io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider' are persisted in the image heap, add 

    '--initialize-at-build-time=io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
  reading field java.util.HashMap$Node.key of constant 
    java.util.LinkedHashMap$Entry@f11d5c6: io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider@2a26c9f2=java.lang.Ob...
  reading field java.util.LinkedHashMap$Entry.before of constant 
    java.util.LinkedHashMap$Entry@ff86e95: io.grpc.netty.UdsNameResolverProvider@364e2fca=java.lang.Object@6e8ffc67
  reading field java.util.LinkedHashMap$Entry.before of constant 
    java.util.LinkedHashMap$Entry@18b972ff: io.quarkus.grpc.runtime.stork.GrpcStorkServiceDiscovery@104fa25=java.lang.Object...
  reading field java.util.LinkedHashMap.tail of constant 
    java.util.LinkedHashMap@2a094624: {io.grpc.grpclb.SecretGrpclbNameResolverProvider$Provider@64f010e=java.lang.Obje...
  reading field java.util.HashSet.map of constant 
    java.util.LinkedHashSet@50c19d5f: [io.grpc.grpclb.SecretGrpclbNameResolverProvider$Provider@64f010e, io.grpc.inter...
  reading field io.grpc.NameResolverRegistry.allProviders of constant 
    io.grpc.NameResolverRegistry@cb29ca6: io.grpc.NameResolverRegistry@cb29ca6
  reading static field io.grpc.NameResolverRegistry.instance
    at io.grpc.NameResolverRegistry.getDefaultRegistry(NameResolverRegistry.java:115)
  parsing method io.grpc.NameResolverRegistry.getDefaultRegistry(NameResolverRegistry.java:115) reachable via the parsing context
    at io.grpc.internal.ManagedChannelImplBuilder.<init>(ManagedChannelImplBuilder.java:136)
    at com.oracle.svm.core.code.FactoryMethodHolder.ManagedChannelImplBuilder_constructor_64bcdb72ec7847ca312ced8099a59e19ac4625a4(generated:0)
    at io.grpc.netty.NettyChannelBuilder.<init>(NettyChannelBuilder.java:195)
    at com.oracle.svm.core.code.FactoryMethodHolder.NettyChannelBuilder_constructor_11c10a380c282e450eaca6715d820181923edf36(generated:0)
    at io.grpc.netty.NettyChannelProvider.builderForTarget(NettyChannelProvider.java:47)
    at root method.(Unknown Source)

Exception C:

Error: Discovered unresolved type during parsing: io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line and command line.
Error encountered while parsing io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42) 
Parsing context:
   at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel.<clinit>(AbstractNioChannel.java:51)
   at static root method.(Unknown Source)

Detailed message:

com.oracle.svm.core.util.UserError$UserException: Discovered unresolved type during parsing: io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line and command line.
Error encountered while parsing io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42) 
Parsing context:
   at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel.<clinit>(AbstractNioChannel.java:51)
   at static root method.(Unknown Source)

Detailed message:

        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:814)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
------------------------------------------------------------------------------------------------------------------------
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:538)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:720)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:142)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:97)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Discovered unresolved type during parsing: io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line and command line.
Error encountered while parsing io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42) 
Parsing context:
   at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
   at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
   at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel.<clinit>(AbstractNioChannel.java:51)
   at static root method.(Unknown Source)

Detailed message:

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:809)
        ... 6 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger. This error is reported at image build time because class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line and command line.
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:548)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:542)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedType(SharedGraphBuilderPhase.java:434)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedNewInstance(SharedGraphBuilderPhase.java:291)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4641)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4634)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5444)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3431)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.iterateBytecodesForBlock(SharedGraphBuilderPhase.java:741)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3391)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3233)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1137)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.build(SharedGraphBuilderPhase.java:161)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1029)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:101)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:115)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:434)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:146)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.parseGraph(AnalysisMethod.java:895)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsedHelper(AnalysisMethod.java:860)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:843)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysisGraphDecoder.java:175)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1211)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1194)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1049)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvokeWithCallTarget(PEGraphDecoder.java:1001)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:987)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:921)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysisGraphDecoder.java:344)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:650)
        at jdk.internal.vm.compiler/org.graalvm.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:892)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:76)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:195)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:621)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:167)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:153)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraphInfo(MethodTypeFlow.java:111)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.lambda$update$0(DefaultStaticInvokeTypeFlow.java:75)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.LightImmutableCollection.forEach(LightImmutableCollection.java:90)
                        5.6s (15.1% of total time) in 81 GCs | Peak RSS: 3.82GB | CPU load: 6.81
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.update(DefaultStaticInvokeTypeFlow.java:74)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:491)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:187)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:171)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

burkedavison avatar Dec 26 '23 16:12 burkedavison

@burkedavison Yes. It's not exactly a Vertex AI issue. But it's an issue related to the grpc-java library that Vertex AI SDK use. I tried the first 2 notes before. But it leads to the exception C. But I can't solve it. But use grpc-netty instead of grpc-netty-shaded will solve the exception C.

SetoKaiba avatar Dec 26 '23 21:12 SetoKaiba

@zakkak Could you please have a look at exception C? And also, I can make it working by including jdbc-oracle to disable link at build time. Then the grpc-netty-shaded is working. The problem is that the io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger can't be parsed because no commons-logging dependency is included.

SetoKaiba avatar Dec 26 '23 21:12 SetoKaiba

The problem is that the io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger can't be parsed because no commons-logging dependency is included.

Did you try adding the missing dependency to your project?

zakkak avatar Jan 08 '24 13:01 zakkak

The problem is that the io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2Logger can't be parsed because no commons-logging dependency is included.

Did you try adding the missing dependency to your project?

Did you mean that I have to add the Log4J2Logger? But it's not used at all in runtime. Do I have to add it?

SetoKaiba avatar Jan 10 '24 18:01 SetoKaiba

Did you mean that I have to add the Log4J2Logger? But it's not used at all in runtime. Do I have to add it?

Yes, it doesn't matter if it does not happen to be used at runtime. If the static analysis considers it reachable it needs to be on the classpath. If you really don't want to include it then you need to understand what's causing it to appear as reachable and change that code, please refer to https://quarkus.io/version/main/guides/native-reference#i-get-a-analysiserrorparsingerror-when-building-a-native-executable-due-to-an-unresolvedelementexception-what-can-i-do for more info.

zakkak avatar Jan 11 '24 09:01 zakkak

Closing as not planned since this issue is very specific to the use of the --link-at-build-time option and the solution provided above is to make the dependency reachable on the classpath.

mpeddada1 avatar Jul 18 '24 16:07 mpeddada1