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

[native-iamage] Kafka Avro with Apicurio 2.x fails to build with GraalVM CE 21.1.0 #16837

Closed
zakkak opened this issue Apr 27, 2021 · 4 comments · Fixed by #16839
Closed

[native-iamage] Kafka Avro with Apicurio 2.x fails to build with GraalVM CE 21.1.0 #16837

zakkak opened this issue Apr 27, 2021 · 4 comments · Fixed by #16839
Labels
area/kafka kind/bug Something isn't working
Milestone

Comments

@zakkak
Copy link
Contributor

zakkak commented Apr 27, 2021

Describe the bug

Kafka Avro with Apicurio 2.x fails to build with GraalVM CE 21.1.0

Expected behavior

The test should build and pass.

Actual behavior

Native image generation fails with:

Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  To see how this object got instantiated use --trace-object-instantiation=java.security.SecureRandom. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: 
	at parsing org.apache.http.impl.auth.NTLMEngineImpl.access$000(NTLMEngineImpl.java:51)
Call path from entry point to org.apache.http.impl.auth.NTLMEngineImpl.access$000(): 
	at org.apache.http.impl.auth.NTLMEngineImpl.access$000(NTLMEngineImpl.java:51)
	at org.apache.http.impl.auth.NTLMEngineImpl$Type3Message.<init>(NTLMEngineImpl.java:1505)
	at org.apache.http.impl.auth.NTLMEngineImpl$Type3Message.<init>(NTLMEngineImpl.java:1474)
	at org.apache.http.impl.auth.NTLMEngineImpl.getType3Message(NTLMEngineImpl.java:181)
	at org.apache.http.impl.auth.NTLMEngineImpl.generateType3Msg(NTLMEngineImpl.java:2097)
	at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:142)
	at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:136)
	at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:233)
	at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:213)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:262)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.keycloak.authorization.client.util.HttpMethod.execute(HttpMethod.java:84)
	at org.keycloak.authorization.client.util.HttpMethodResponse$2.execute(HttpMethodResponse.java:50)
	at org.keycloak.authorization.client.AuthzClient.obtainAccessToken(AuthzClient.java:199)
	at io.apicurio.registry.auth.KeycloakAuth.apply(KeycloakAuth.java:46)
	at io.apicurio.registry.rest.client.request.RequestHandler.sendRequest(RequestHandler.java:189)
	at io.apicurio.registry.rest.client.impl.RegistryClientImpl.getContentById(RegistryClientImpl.java:219)
	at io.apicurio.registry.serde.DefaultSchemaResolver.lambda$resolveSchemaByContentId$1(DefaultSchemaResolver.java:163)
	at io.apicurio.registry.serde.DefaultSchemaResolver$$Lambda$1144/0x00000007c1f9e840.apply(Unknown Source)
	at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:291)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VARARGS:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
...

To Reproduce

Steps to reproduce the behavior:

  1. Grab GraalVM CE 21.1.0
  2. export GRAALVM_HOME=/opt/jvms/graalvm-ce-java11-21.1.0
  3. ./mvnw clean verify -Dnative -Dnative.surefire.skip -pl integration-tests/kafka-avro-apicurio2

Environment (please complete the following information):

Key Value
uname -a Linux 5.11.14-200.fc33.x86_64 #1 SMP Wed Apr 14 15:25:53 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
java -version openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment 18.9 (build 11.0.10+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9, mixed mode, sharing)
graalvm java -version openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05)
OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05, mixed mode, sharing)
mvnw --version Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /home/zakkak/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.10, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.10.0.9-0.fc33.x86_64
Default locale: en_IE, platform encoding: UTF-8
OS name: "linux", version: "5.11.14-200.fc33.x86_64", arch: "amd64", family: "unix"

Additional context

NTLMEngineImpl is already being marked for runtime initialization in https://github.com/quarkusio/quarkus/blob/9e917d43364df5467b7cb673dff0294b141e528b/extensions/apache-httpclient/deployment/src/main/java/io/quarkus/apache/http/client/deployment/ApacheHttpClientProcessor.java
but is not being picked up in this case.

@zakkak zakkak added the kind/bug Something isn't working label Apr 27, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 27, 2021

/cc @cescoffier

@zakkak
Copy link
Contributor Author

zakkak commented Apr 27, 2021

/cc @gsmet @Ladicek

@gsmet
Copy link
Member

gsmet commented Apr 27, 2021

See #16839 for discussion.

@Ladicek
Copy link
Contributor

Ladicek commented Apr 27, 2021

I didn't know we have an extension for Apache HTTP Client :-) I guess it doesn't come into play here, because no one depends on it.

gsmet added a commit to gsmet/quarkus that referenced this issue Apr 27, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kafka kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants