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

Can't connect to AWS MSK Cluster #323

Closed
Ouisticram opened this issue Nov 17, 2023 · 9 comments
Closed

Can't connect to AWS MSK Cluster #323

Ouisticram opened this issue Nov 17, 2023 · 9 comments

Comments

@Ouisticram
Copy link

Describe the bug
When trying to get topics from my MSK Cluster, I have an error from AWS SDK library:

org.apache.kafka.common.KafkaException: Failed to create new KafkaAdminClient
        at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:519)
        at org.apache.kafka.clients.admin.Admin.create(Admin.java:144)
        at org.apache.kafka.clients.admin.AdminClient.create(AdminClient.java:49)
        at io.streamthoughts.jikkou.kafka.internals.admin.DefaultAdminClientFactory.createAdminClient(DefaultAdminClientFactory.java:60)
        at io.streamthoughts.jikkou.kafka.internals.admin.AdminClientContext.getAdminClient(AdminClientContext.java:171)
        at io.streamthoughts.jikkou.kafka.reconcilier.AdminClientKafkaTopicCollector.listAll(AdminClientKafkaTopicCollector.java:143)
        at io.streamthoughts.jikkou.core.DefaultApi.getResources(DefaultApi.java:439)
        at io.streamthoughts.jikkou.client.command.get.GetResourceCommand.call(GetResourceCommand.java:79)
        at io.streamthoughts.jikkou.client.command.get.GetResourceCommand.call(GetResourceCommand.java:43)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at io.streamthoughts.jikkou.client.Jikkou.executionStrategy(Jikkou.java:156)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at io.streamthoughts.jikkou.client.Jikkou.execute(Jikkou.java:146)
        at io.streamthoughts.jikkou.client.Jikkou.main(Jikkou.java:134)
        at java.base@21.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: org.apache.kafka.common.KafkaException: Failed to create new NetworkClient
        at org.apache.kafka.clients.ClientUtils.createNetworkClient(ClientUtils.java:245)
        at org.apache.kafka.clients.ClientUtils.createNetworkClient(ClientUtils.java:185)
        at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:503)
        ... 20 more
Caused by: org.apache.kafka.common.KafkaException: java.lang.IllegalStateException: Cannot create an instance of com.amazonaws.auth.AWS4Signer
        at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:184)
        at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:192)
        at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:81)
        at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:117)
        at org.apache.kafka.clients.ClientUtils.createNetworkClient(ClientUtils.java:217)
        ... 22 more
Caused by: java.lang.IllegalStateException: Cannot create an instance of com.amazonaws.auth.AWS4Signer
        at com.amazonaws.auth.SignerFactory.createSigner(SignerFactory.java:178)
        at com.amazonaws.auth.SignerFactory.createSigner(SignerFactory.java:132)
        at com.amazonaws.auth.SignerFactory.lookupAndCreateSigner(SignerFactory.java:120)
        at com.amazonaws.auth.SignerFactory.getSigner(SignerFactory.java:89)
        at com.amazonaws.AmazonWebServiceClient.computeSignerByServiceRegion(AmazonWebServiceClient.java:458)
        at com.amazonaws.AmazonWebServiceClient.computeSignerByURI(AmazonWebServiceClient.java:430)
        at com.amazonaws.AmazonWebServiceClient.setEndpoint(AmazonWebServiceClient.java:318)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.init(AWSSecurityTokenServiceClient.java:344)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:302)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:285)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClientBuilder.build(AWSSecurityTokenServiceClientBuilder.java:61)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClientBuilder.build(AWSSecurityTokenServiceClientBuilder.java:27)
        at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.createSTSRoleCredentialProvider(MSKCredentialProvider.java:316)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.lambda$getStsRoleProvider$4(MSKCredentialProvider.java:308)
        at java.base@21.0.1/java.util.Optional.map(Optional.java:260)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.getStsRoleProvider(MSKCredentialProvider.java:284)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.getProviders(MSKCredentialProvider.java:246)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider.<init>(MSKCredentialProvider.java:103)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider.<init>(MSKCredentialProvider.java:99)
        at software.amazon.msk.auth.iam.IAMClientCallbackHandler.lambda$configure$1(IAMClientCallbackHandler.java:54)
        at java.base@21.0.1/java.util.Optional.map(Optional.java:260)
        at software.amazon.msk.auth.iam.IAMClientCallbackHandler.configure(IAMClientCallbackHandler.java:54)
        at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:151)
        ... 26 more
Caused by: java.lang.InstantiationException: com.amazonaws.auth.AWS4Signer
        at java.base@21.0.1/java.lang.Class.newInstance(DynamicHub.java:719)
        at com.amazonaws.auth.SignerFactory.createSigner(SignerFactory.java:175)
        ... 49 more
Caused by: java.lang.NoSuchMethodException: com.amazonaws.auth.AWS4Signer.<init>()
        at java.base@21.0.1/java.lang.Class.checkMethod(DynamicHub.java:1065)
        at java.base@21.0.1/java.lang.Class.getConstructor0(DynamicHub.java:1228)
        at java.base@21.0.1/java.lang.Class.newInstance(DynamicHub.java:706)
        ... 50 more

Error: KafkaException: Failed to create new KafkaAdminClient

To Reproduce
Here is configuration to connect to MSK:

{
  "currentContext" : "dev",
  "dev" : {
    "configFile" : null,
    "configProps" : {
      "kafka.client.bootstrap.servers" : "<OMITTED>",
      "kafka.client.security.protocol" : "SASL_SSL",
      "kafka.client.sasl.mechanism" : "AWS_MSK_IAM",
      "kafka.client.sasl.jaas.config" : "software.amazon.msk.auth.iam.IAMLoginModule required awsRoleArn=\"<OMITTED>\" awsStsRegion=\"eu-west-3\";",
      "kafka.client.sasl.client.callback.handler.class" : "software.amazon.msk.auth.iam.IAMClientCallbackHandler"
    }
  }

Note the awsRoleArn

execute jikkou get kafkatopics

Expected behavior
I expect that jikkou cli display MSK topics

Runtime environment

  • OS: Jikkou dockerhub image
  • Jikkou: 0.31.0
  • Kafka Cluster Version: 2.7.1

Additional context
When I execute this command line jikkou health get kafkabroker, I get this error :

Error: NoSuchExtensionException: No extension registered for type 'interface io.streamthoughts.jikkou.core.health.HealthIndicator', and qualifier '@Named(kafkabroker)'.
@fhussonnois
Copy link
Member

Hi @Ouisticram, regarding the java.lang.NoSuchMethodException: com.amazonaws.auth.AWS4Signer, I've update trhe project configuration to register that class for reflection. Unfortunately, aws-msk-iam-auth doesn't support graalvm (see aws/aws-msk-iam-auth#117). So depending on your configuration some classes can be not registered.

Once, the GitHub build is done you should be able to test the fix using the streamthoughts/jikkou:main Docker image.

For healthcheck use: jikkou health get kafka. You can use the jikkou health get-indicators command to list all supported healthcheck.

@Ouisticram
Copy link
Author

Hello, thanks a lot for the fix !
Now I've got a new error:

jikkou health get kafka
10:44:05.871 [main] ERROR i.s.j.k.internals.KafkaBrokersReady - Error while listing Kafka nodes: org.apache.kafka.common.errors.TimeoutException: The AdminClient thread has exited. Call: listNodes
10:44:05.871 [kafka-admin-client-thread | adminclient-1] ERROR o.a.kafka.common.utils.KafkaThread - Uncaught exception in thread 'kafka-admin-client-thread | adminclient-1':
org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [org.apache.http.conn.ConnectionRequest, com.amazonaws.http.conn.Wrapped] without it being registered for runtime reflection. Add [org.apache.http.conn.ConnectionRequest, com.amazonaws.http.conn.Wrapped] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:176)
        at java.base@21.0.1/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47)
        at java.base@21.0.1/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034)
        at com.amazonaws.http.conn.ClientConnectionRequestFactory.wrap(ClientConnectionRequestFactory.java:45)
        at com.amazonaws.http.conn.ClientConnectionManagerFactory$Handler.invoke(ClientConnectionManagerFactory.java:78)
        at com.amazonaws.http.conn.$Proxy63.requestConnection(Unknown Source)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:176)
        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:56)
        at com.amazonaws.http.apache.client.impl.SdkHttpClient.execute(SdkHttpClient.java:72)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1346)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1157)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:781)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:755)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:715)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:697)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:561)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:541)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.doInvoke(AWSSecurityTokenServiceClient.java:1731)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.invoke(AWSSecurityTokenServiceClient.java:1698)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.invoke(AWSSecurityTokenServiceClient.java:1687)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.executeAssumeRole(AWSSecurityTokenServiceClient.java:532)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.assumeRole(AWSSecurityTokenServiceClient.java:501)
        at com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider.newSession(STSAssumeRoleSessionCredentialsProvider.java:348)
        at com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider.access$000(STSAssumeRoleSessionCredentialsProvider.java:44)
        at com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider$1.call(STSAssumeRoleSessionCredentialsProvider.java:93)
        at com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider$1.call(STSAssumeRoleSessionCredentialsProvider.java:90)
        at com.amazonaws.auth.RefreshableTask.refreshValue(RefreshableTask.java:295)
        at com.amazonaws.auth.RefreshableTask.forceGetValue(RefreshableTask.java:208)
        at com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider.refresh(STSAssumeRoleSessionCredentialsProvider.java:325)
        at com.amazonaws.auth.AWSCredentialsProviderChain.refresh(AWSCredentialsProviderChain.java:149)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider.refresh(MSKCredentialProvider.java:219)
        at software.amazon.msk.auth.iam.IAMClientCallbackHandler.handleCallback(IAMClientCallbackHandler.java:99)
        at software.amazon.msk.auth.iam.IAMClientCallbackHandler.handle(IAMClientCallbackHandler.java:77)
        at software.amazon.msk.auth.iam.internals.IAMSaslClient.generateClientMessage(IAMSaslClient.java:139)
        at software.amazon.msk.auth.iam.internals.IAMSaslClient.evaluateChallenge(IAMSaslClient.java:96)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.lambda$createSaslToken$1(SaslClientAuthenticator.java:534)
        at java.base@21.0.1/java.security.AccessController.executePrivileged(AccessController.java:114)
        at java.base@21.0.1/java.security.AccessController.doPrivileged(AccessController.java:714)
        at java.base@21.0.1/javax.security.auth.Subject.doAs(Subject.java:525)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.createSaslToken(SaslClientAuthenticator.java:534)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendSaslClientToken(SaslClientAuthenticator.java:433)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendInitialToken(SaslClientAuthenticator.java:332)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.authenticate(SaslClientAuthenticator.java:273)
        at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:181)
        at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543)
        at org.apache.kafka.common.network.Selector.poll(Selector.java:481)
        at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:571)
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1381)
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1312)
        at java.base@21.0.1/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21.0.1/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:832)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
10:44:06.871 [main] ERROR i.s.j.k.internals.KafkaBrokersReady - Error while listing Kafka nodes: org.apache.kafka.common.errors.TimeoutException: The AdminClient thread has exited.
10:44:07.872 [main] ERROR i.s.j.k.internals.KafkaBrokersReady - Error while listing Kafka nodes: org.apache.kafka.common.errors.TimeoutException: The AdminClient thread has exited.

Do you want me to create a new GitHub issue ?
Regards,
@Ouisticram

@fhussonnois
Copy link
Member

Hi @Ouisticram, could you try the new early-access release ? or the streamthoughts/jikkou:main Docker image. I've added the missing reflection configuration. Thanks

@Ouisticram
Copy link
Author

Hello @fhussonnois, thanks a lot for your prompt response.
I tried the new release and I have a new error now :

/app # ./jikkou health get kafka
---
apiVersion: "core.jikkou.io/v1"
kind: "ApiHealthResult"
name: "kafka"
status:
  name: "DOWN"
details:
  error: "org.apache.kafka.common.KafkaException: Failed to create new KafkaAdminClient"

/app # ./jikkou get kafkatopics --default-configs
org.apache.kafka.common.KafkaException: Failed to create new KafkaAdminClient
        at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:519)
        at org.apache.kafka.clients.admin.Admin.create(Admin.java:144)
        at org.apache.kafka.clients.admin.AdminClient.create(AdminClient.java:49)
        at io.streamthoughts.jikkou.kafka.internals.admin.DefaultAdminClientFactory.createAdminClient(DefaultAdminClientFactory.java:60)
        at io.streamthoughts.jikkou.kafka.internals.admin.AdminClientContext.getAdminClient(AdminClientContext.java:171)
        at io.streamthoughts.jikkou.kafka.reconcilier.AdminClientKafkaTopicCollector.listAll(AdminClientKafkaTopicCollector.java:143)
        at io.streamthoughts.jikkou.core.DefaultApi.getResources(DefaultApi.java:439)
        at io.streamthoughts.jikkou.client.command.get.GetResourceCommand.call(GetResourceCommand.java:79)
        at io.streamthoughts.jikkou.client.command.get.GetResourceCommand.call(GetResourceCommand.java:43)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at io.streamthoughts.jikkou.client.Jikkou.executionStrategy(Jikkou.java:156)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at io.streamthoughts.jikkou.client.Jikkou.execute(Jikkou.java:146)
        at io.streamthoughts.jikkou.client.Jikkou.main(Jikkou.java:134)
        at java.base@21.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: org.apache.kafka.common.KafkaException: Failed to create new NetworkClient
        at org.apache.kafka.clients.ClientUtils.createNetworkClient(ClientUtils.java:245)
        at org.apache.kafka.clients.ClientUtils.createNetworkClient(ClientUtils.java:185)
        at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:503)
        ... 20 more
Caused by: org.apache.kafka.common.KafkaException: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [org.apache.http.conn.HttpClientConnectionManager, org.apache.http.pool.ConnPoolControl, com.amazonaws.http.conn.Wrapped] without it being registered for runtime reflection. Add [org.apache.http.conn.HttpClientConnectionManager, org.apache.http.pool.ConnPoolControl, com.amazonaws.http.conn.Wrapped] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
        at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:184)
        at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:192)
        at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:81)
        at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:117)
        at org.apache.kafka.clients.ClientUtils.createNetworkClient(ClientUtils.java:217)
        ... 22 more
Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [org.apache.http.conn.HttpClientConnectionManager, org.apache.http.pool.ConnPoolControl, com.amazonaws.http.conn.Wrapped] without it being registered for runtime reflection. Add [org.apache.http.conn.HttpClientConnectionManager, org.apache.http.pool.ConnPoolControl, com.amazonaws.http.conn.Wrapped] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:176)
        at java.base@21.0.1/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47)
        at java.base@21.0.1/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034)
        at com.amazonaws.http.conn.ClientConnectionManagerFactory.wrap(ClientConnectionManagerFactory.java:54)
        at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:56)
        at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:38)
        at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:347)
        at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:331)
        at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:239)
        at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:225)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:299)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:285)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClientBuilder.build(AWSSecurityTokenServiceClientBuilder.java:61)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClientBuilder.build(AWSSecurityTokenServiceClientBuilder.java:27)
        at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.createSTSRoleCredentialProvider(MSKCredentialProvider.java:316)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.lambda$getStsRoleProvider$4(MSKCredentialProvider.java:308)
        at java.base@21.0.1/java.util.Optional.map(Optional.java:260)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.getStsRoleProvider(MSKCredentialProvider.java:284)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider$ProviderBuilder.getProviders(MSKCredentialProvider.java:246)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider.<init>(MSKCredentialProvider.java:103)
        at software.amazon.msk.auth.iam.internals.MSKCredentialProvider.<init>(MSKCredentialProvider.java:99)
        at software.amazon.msk.auth.iam.IAMClientCallbackHandler.lambda$configure$1(IAMClientCallbackHandler.java:54)
        at java.base@21.0.1/java.util.Optional.map(Optional.java:260)
        at software.amazon.msk.auth.iam.IAMClientCallbackHandler.configure(IAMClientCallbackHandler.java:54)
        at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:151)
        ... 26 more

Error: KafkaException: Failed to create new KafkaAdminClient

Do we continue in this Github issue ?

@fhussonnois
Copy link
Member

Hi @Ouisticram, my bad, I didn't configure well the proxy reflection for graalvm. You can try again the new early access.

@Ouisticram
Copy link
Author

Re, je me permet de parler en Français car je vois que vous êtes Parisien.
Je suis désolé mais j'ai toujours la même erreur que précédemment même avec votre dernier commit.
Je me demande pourquoi vous avez mis software.amazon.awssdk.http.apache.internal.conn.Wrapped plutôt que com.amazonaws.http.conn.Wrapped ?
J'ai essayé de builder une nouvelle image Docker en local en remettant com.amazonaws.http.conn.Wrapped mais impossible de la builder, j'ai cette erreur :

Failed generating 'jikkou-cli-0.32.0-SNAPSHOT-runner' after 4m 6s.

The build process encountered an unexpected error:

> java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1

Linker command executed:
/usr/bin/gcc -z noexecstack -Wl,--gc-sections -Wl,--version-script,/tmp/SVM-7204335291410745368/exported_symbols.list -Wl,-x -o /home/quaug/git/jikkou/jikkou-cli/target/jikkou-cli-0.32.0-SNAPSHOT-runner jikkou-cli-0.32.0-SNAPSHOT-runner.o /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64/liblibchelper.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libnet.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libjaas.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libextnet.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libnio.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libmanagement_ext.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libjava.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libzip.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64/libjvm.a -Wl,--export-dynamic -v -L/tmp/SVM-7204335291410745368 -L/usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc -L/usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64 -lz -ldl -lpthread -lrt -Wl,-u,JNU_CallMethodByName -Wl,-u,JNU_CallStaticMethodByName -Wl,-u,JNU_GetEnv -Wl,-u,JNU_GetStaticFieldByName -Wl,-u,JNU_GetStringPlatformChars -Wl,-u,JNU_IsInstanceOfByName -Wl,-u,JNU_NewObjectByName -Wl,-u,JNU_NewStringPlatform -Wl,-u,JNU_ReleaseStringPlatformChars -Wl,-u,JNU_SetFieldByName -Wl,-u,JNU_ThrowArrayIndexOutOfBoundsException -Wl,-u,JNU_ThrowByName -Wl,-u,JNU_ThrowIllegalArgumentException -Wl,-u,JNU_ThrowInternalError -Wl,-u,JNU_ThrowNullPointerException -Wl,-u,JNU_ThrowOutOfMemoryError -Wl,-u,JNI_CreateJavaVM -Wl,-u,JNI_GetCreatedJavaVMs -Wl,-u,JNI_GetDefaultJavaVMInitArgs -Wl,-u,jio_fprintf -Wl,-u,jio_snprintf

Linker command output:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-z' 'noexecstack' '-o' '/home/quaug/git/jikkou/jikkou-cli/target/jikkou-cli-0.32.0-SNAPSHOT-runner' '-v' '-L/tmp/SVM-7204335291410745368' '-L/usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc' '-L/usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64' '-mtune=generic' '-march=x86-64' '-dumpdir' '/home/quaug/git/jikkou/jikkou-cli/target/jikkou-cli-0.32.0-SNAPSHOT-runner.'
 /usr/lib/gcc/x86_64-linux-gnu/11/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/tmp/ccyaFlkh.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o /home/quaug/git/jikkou/jikkou-cli/target/jikkou-cli-0.32.0-SNAPSHOT-runner -z noexecstack /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/tmp/SVM-7204335291410745368 -L/usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc -L/usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64 -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. --gc-sections --version-script /tmp/SVM-7204335291410745368/exported_symbols.list -x jikkou-cli-0.32.0-SNAPSHOT-runner.o /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64/liblibchelper.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libnet.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libjaas.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libextnet.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libnio.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libmanagement_ext.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libjava.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libzip.a /usr/local/graalvm-community-openjdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64/libjvm.a --export-dynamic -lz -ldl -lpthread -lrt -u JNU_CallMethodByName -u JNU_CallStaticMethodByName -u JNU_GetEnv -u JNU_GetStaticFieldByName -u JNU_GetStringPlatformChars -u JNU_IsInstanceOfByName -u JNU_NewObjectByName -u JNU_NewStringPlatform -u JNU_ReleaseStringPlatformChars -u JNU_SetFieldByName -u JNU_ThrowArrayIndexOutOfBoundsException -u JNU_ThrowByName -u JNU_ThrowIllegalArgumentException -u JNU_ThrowInternalError -u JNU_ThrowNullPointerException -u JNU_ThrowOutOfMemoryError -u JNI_CreateJavaVM -u JNI_GetCreatedJavaVMs -u JNI_GetDefaultJavaVMInitArgs -u jio_fprintf -u jio_snprintf -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld : ne peut pas trouver -lz : Aucun fichier ou dossier de ce type
collect2: error: ld returned 1 exit status

Please inspect the generated error report at:
/home/<OMITTED>/git/jikkou/jikkou-cli/target/svm_err_b_20231121T172037.348_pid47977.md

If you are unable to resolve this problem, please file an issue with the error report at:
https://graalvm.org/support
com.oracle.svm.driver.NativeImage$NativeImageError
        at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.showError(NativeImage.java:2336)
        at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.build(NativeImage.java:1919)
        at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1878)
        at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.main(NativeImage.java:1852)
        at java.base@21.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Jikkou Project 0.32.0-SNAPSHOT:
[INFO] 
[INFO] Jikkou Project ..................................... SUCCESS [  0.494 s]
[INFO] Jikkou :: Core ..................................... SUCCESS [  6.041 s]
[INFO] jikkou-resource-generator .......................... SUCCESS [  0.409 s]
[INFO] Jikkou REST :: API Data ............................ SUCCESS [  0.692 s]
[INFO] Jikkou REST :: API Client .......................... SUCCESS [  0.939 s]
[INFO] Jikkou Template :: Jinja ........................... SUCCESS [  0.570 s]
[INFO] Jikkou Extension :: Core ........................... SUCCESS [  1.292 s]
[INFO] Jikkou Extension :: Kafka .......................... SUCCESS [  6.311 s]
[INFO] jikkou-extension-rest-client ....................... SUCCESS [  0.879 s]
[INFO] Jikkou Extension :: Schema Registry ................ SUCCESS [  2.340 s]
[INFO] Jikkou Extension :: Aiven .......................... SUCCESS [  2.547 s]
[INFO] Jikkou Extension :: Kafka Connect .................. SUCCESS [  1.835 s]
[INFO] Jikkou :: CLI ...................................... FAILURE [04:13 min]
[INFO] Jikkou REST :: API Server .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:39 min
[INFO] Finished at: 2023-11-21T17:20:38+01:00
[INFO] ------------------------------------------------------------------------

Je ne sais pas si ça vous parle ?

@Ouisticram
Copy link
Author

Super merci pour le fix, je n'ai plus l'erreur MissingReflectionRegistrationError
J'en suis là actuellement, j'ai un timeout mais l'erreur précise ne s'affiche pas à cause d'un NoSuchMethodException :

/app # ./jikkou get kafkatopics --default-configs
08:21:15.654 [main] ERROR i.s.j.k.internals.KafkaBrokersReady - Error while listing Kafka nodes: org.apache.kafka.common.errors.TimeoutException: The AdminClient thread has exited. Call: listNodes
08:21:15.655 [kafka-admin-client-thread | adminclient-1] ERROR o.a.kafka.common.utils.KafkaThread - Uncaught exception in thread 'kafka-admin-client-thread | adminclient-1':
java.lang.ExceptionInInitializerError: null
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.createSaslToken(SaslClientAuthenticator.java:537)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendSaslClientToken(SaslClientAuthenticator.java:433)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendInitialToken(SaslClientAuthenticator.java:332)
        at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.authenticate(SaslClientAuthenticator.java:273)
        at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:181)
        at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543)
        at org.apache.kafka.common.network.Selector.poll(Selector.java:481)
        at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:571)
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1381)
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1312)
        at java.base@21.0.1/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21.0.1/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:832)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Caused by: org.apache.kafka.common.KafkaException: Kerberos exceptions could not be initialized
        at org.apache.kafka.common.security.kerberos.KerberosError.<clinit>(KerberosError.java:63)
        ... 14 common frames omitted
Caused by: java.lang.NoSuchMethodException: sun.security.krb5.KrbException.returnCode()
        at java.base@21.0.1/java.lang.Class.checkMethod(DynamicHub.java:1065)
        at java.base@21.0.1/java.lang.Class.getMethod(DynamicHub.java:1050)
        at org.apache.kafka.common.security.kerberos.KerberosError.<clinit>(KerberosError.java:61)
        ... 14 common frames omitted
08:21:16.654 [main] ERROR i.s.j.k.internals.KafkaBrokersReady - Error while listing Kafka nodes: org.apache.kafka.common.errors.TimeoutException: The AdminClient thread has exited.
08:21:17.655 [main] ERROR i.s.j.k.internals.KafkaBrokersReady - Error while listing Kafka nodes: org.apache.kafka.common.errors.TimeoutException: The AdminClient thread has exited.

@fhussonnois
Copy link
Member

Hello @Ouisticram, je t'invite à rejoindre le nouveau slack dedié au projet ce sera plus simple pour échanger : https://join.slack.com/t/jikkou-io/shared_invite/zt-27c0pt61j-F10NN7d7ZEppQeMMyvy3VA

@fhussonnois
Copy link
Member

Fixed in 0.32.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants