Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb dependencies incompartibility in version 2.9.1 #25711

Closed
rahimalizada opened this issue May 21, 2022 · 3 comments · Fixed by #25717
Closed

mongodb dependencies incompartibility in version 2.9.1 #25711

rahimalizada opened this issue May 21, 2022 · 3 comments · Fixed by #25717
Labels
area/mongodb kind/bug Something isn't working
Milestone

Comments

@rahimalizada
Copy link

rahimalizada commented May 21, 2022

Describe the bug

Compared to previous release (in my case version 2.7.3) quarkus bom in 2.9.1 updated mongodb-crypt dependency to 1.4.0 (from 1.2.1) while keeping other mongodb dependencies with previous version (4.3.4).
This results in following error while building native image:

Error: Class initialization of com.mongodb.crypt.capi.CAPI failed. Use the option --initialize-at-run-time=com.mongodb.crypt.capi.CAPI to explicitly request delayed initialization of this class.

Detailed message:

com.oracle.svm.core.util.UserError$UserException: Class initialization of com.mongodb.crypt.capi.CAPI failed. Use the option --initialize-at-run-time=com.mongodb.crypt.capi.CAPI to explicitly request delayed initialization of this class.
Detailed message:
        at com.oracle.svm.core.util.UserError.abort(UserError.java:84)
        at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:249)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:754)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:558)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Class initialization of com.mongodb.crypt.capi.CAPI failed. Use the option --initialize-at-run-time=com.mongodb.crypt.capi.CAPI to explicitly request delayed initialization of this class.
Detailed message:
        at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:751)
        ... 6 more
Caused by: java.lang.UnsatisfiedLinkError: Error looking up function 'mongocrypt_ctx_provide_kms_providers': The specified procedure could not be found.
        at com.sun.jna.Function.<init>(Function.java:252)
        at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:600)
        at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:576)
        at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:562)
        at com.sun.jna.Native.register(Native.java:1876)
        at com.sun.jna.Native.register(Native.java:1747)
        at com.mongodb.crypt.capi.CAPI.<clinit>(CAPI.java:852)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1155)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.ensureClassInitialized(ConfigurableClassInitialization.java:183)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:653)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:136)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.shouldInitializeAtRuntime(ConfigurableClassInitialization.java:164)
        at com.oracle.svm.hosted.SVMHost.isInitialized(SVMHost.java:286)
        at com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:728)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4258)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1646)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1639)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5218)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3358)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3318)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3163)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
        at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:79)
        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:236)
        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 com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
        at com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:586)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:166)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:357)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.createTypeFlow(MethodTypeFlow.java:301)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureTypeFlowCreated(MethodTypeFlow.java:290)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:111)
        at com.oracle.graal.pointsto.DefaultAnalysisPolicy$DefaultVirtualInvokeTypeFlow.onObservedUpdate(DefaultAnalysisPolicy.java:252)
        at com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:552)
        at com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:631)
        at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@rahimalizada rahimalizada added the kind/bug Something isn't working label May 21, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented May 21, 2022

/cc @evanchooly, @loicmathieu

@geoand
Copy link
Contributor

geoand commented May 23, 2022

I have opened #25716 which likely addressed the problem, but without a sample project that exhibits the problem, I can't know for sure.

@gsmet
Copy link
Member

gsmet commented May 23, 2022

@rahimalizada could you provide a simple Maven reproducer so that we can have a look? Also we would use it to include a proper test in the testsuite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mongodb kind/bug Something isn't working
Projects
None yet
3 participants