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

Infinispan client cannot find SaslServerFactory in native mode #19195

Closed
jamesnetherton opened this issue Aug 3, 2021 · 7 comments · Fixed by #19336
Closed

Infinispan client cannot find SaslServerFactory in native mode #19195

jamesnetherton opened this issue Aug 3, 2021 · 7 comments · Fixed by #19336
Labels
area/infinispan Infinispan area/native-image kind/bug Something isn't working
Milestone

Comments

@jamesnetherton
Copy link
Contributor

jamesnetherton commented Aug 3, 2021

Testing the latest Camel Quarkus Infinispan SNAPSHOT with the latest Quarkus Infinispan SNAPSHOT reveals an error in native mode. Seems that Infinispan itests in Quarkus do not use authentication, so maybe this has gone unnoticed since the upgrade to GraalVM 21.2.0.

The client configuration used in the Camel Infinispan itest is here.

I guess there's a typo in the IllegalStateException message, 'now' instead of 'not', which makes things kinda confusing.

2021-08-03 09:29:57,789 WARN  [io.net.cha.ChannelInitializer] (HotRod-client-async-pool-1-4) Failed to initialize a channel. Closing: [id: 0xa7565909]: java.lang.IllegalStateException: SaslClientFactory implementation now found
	at org.infinispan.client.hotrod.impl.transport.netty.ChannelInitializer.getSaslClientFactory(ChannelInitializer.java:203)
	at org.infinispan.client.hotrod.impl.transport.netty.ChannelInitializer.initAuthentication(ChannelInitializer.java:162)
	at org.infinispan.client.hotrod.impl.transport.netty.ChannelInitializer.initChannel(ChannelInitializer.java:80)
	at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
	at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
	at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:938)
	at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
	at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
	at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1463)
	at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1115)
	at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:650)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:514)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:429)
	at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:486)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.lang.Thread.run(Thread.java:829)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:567)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
@jamesnetherton jamesnetherton added the kind/bug Something isn't working label Aug 3, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 3, 2021

/cc @karesti, @wburns

@karesti
Copy link
Member

karesti commented Aug 3, 2021

@jamesnetherton taking a look today

@geoand
Copy link
Contributor

geoand commented Aug 3, 2021

For this Service Loader stuff to work in native mode, one would generate ServiceProviderBuildItem from the appropriate Quarkus build step

@jamesnetherton
Copy link
Contributor Author

For this Service Loader stuff to work in native mode, one would generate ServiceProviderBuildItem from the appropriate Quarkus build step

FWIW I have a SASL issue in a different extension and fixed it by producing NativeImageSecurityProviderBuildItem for com.sun.security.sasl.Provider.

Curious as to why this worked prior to GraalVM 21.2.0 without any special config? Maybe the change is due to this oracle/graal@10cc640#diff-b74986643ea0d26f6a08173f26b9330b4b26d3f4369a7a524b7bc2c36092d56f? Not sure if I'm misunderstanding the docs, but it seems to hint that the providers built into the JDK should have been automatically registered.

@geoand
Copy link
Contributor

geoand commented Aug 3, 2021

@zakkak ^

@zakkak
Copy link
Contributor

zakkak commented Aug 10, 2021

FWIW I have a SASL issue in a different extension and fixed it by producing NativeImageSecurityProviderBuildItem for com.sun.security.sasl.Provider.

Curious as to why this worked prior to GraalVM 21.2.0 without any special config? Maybe the change is due to this oracle/graal@10cc640#diff-b74986643ea0d26f6a08173f26b9330b4b26d3f4369a7a524b7bc2c36092d56f?

Correct.

Not sure if I'm misunderstanding the docs, but it seems to hint that the providers built into the JDK should have been automatically registered.

I have created oracle/graal#3664 to track this. Thanks for bringing it up @jamesnetherton !

@gsmet
Copy link
Member

gsmet commented Aug 11, 2021

I think for now the best solution is to add the security provider ourselves. I created #19336 .

@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infinispan Infinispan area/native-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants