You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a more recent postgres-socket-factory would give the following output in the native build:
Error: Detected an active instance of Cleanable or jdk.internal.ref.Cleaner in the image heap. This usually means that a resource such as a Timer, native memory, a file descriptor or another resource is reachable which is not available at image runtime. If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=jdk.internal.ref.CleanerImpl$PhantomCleanableRef'
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.
So I followed the tip in the output and ran the build with: quarkus.native.additional-build-args=--trace-object-instantiation=jdk.internal.ref.CleanerImpl$PhantomCleanableRef
This gave me:
Error: Detected an active instance of Cleanable or jdk.internal.ref.Cleaner in the image heap. This usually means that a resource such as a Timer, native memory, a file descriptor or another resource is reachable which is not available at image runtime. Prevent such objects being used during image generation, including by class
The culprit object has been instantiated by the 'com.kenai.jffi.Library$DefaultLibrary' class initializer with the following trace:
at jdk.internal.ref.CleanerImpl$PhantomCleanableRef.<init>(CleanerImpl.java:164)
Describe the bug
When following the guide in https://quarkus.io/guides/deploying-to-google-cloud#using-cloud-sql-with-native-executables on how to use Cloud SQL with native executables. I found that it only worked when the version of my
postgres-socket-factory
dependency was <= 1.15.2 (probably same for other db vendors as well).When using a more recent
postgres-socket-factory
would give the following output in the native build:So I followed the tip in the output and ran the build with:
quarkus.native.additional-build-args=--trace-object-instantiation=jdk.internal.ref.CleanerImpl$PhantomCleanableRef
This gave me:
So I tried doing the build with:
quarkus.native.additional-build-args=--initialize-at-run-time=jnr.ffi.provider.jffi.NativeFinalizer$SingletonHolder\\,com.kenai.jffi.Library$DefaultLibrary
And this works fine. So the guide would need some updating to reflect this.
Expected behavior
The application should work when following the guide.
Actual behavior
The application does not build when following the build using the latest version of suggested dependencies.
How to Reproduce?
Follow the guide in https://quarkus.io/guides/deploying-to-google-cloud to deploy a native build of a Quarkus application that uses Cloud SQL with a JDBC driver.
Output of
uname -a
orver
Linux sto-447975 6.10.12-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Sep 30 21:38:25 UTC 2024 x86_64 GNU/Linux
Output of
java -version
openjdk version "21.0.4" 2024-07-16 OpenJDK Runtime Environment (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7) OpenJDK 64-Bit Server VM (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7, mixed mode, sharing)
Mandrel or GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.15.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd342
Additional information
No response
The text was updated successfully, but these errors were encountered: