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

Does Apache Ignite 3 successfully working with .NET 8? #11958

Closed
Maximys opened this issue Mar 21, 2025 · 4 comments
Closed

Does Apache Ignite 3 successfully working with .NET 8? #11958

Maximys opened this issue Mar 21, 2025 · 4 comments

Comments

@Maximys
Copy link

Maximys commented Mar 21, 2025

I tried to figure out how to use Apache Ignite with a .NET application. I changed solution for this by next commit. But for some reason, when I try to get data from Apache Ignite , I get the following error:

Apache.Ignite.IgniteClientConnectionException
  HResult=0x80131500
  Message=Failed to connect to endpoint: 172.18.0.3:47100
  Source=Apache.Ignite
  StackTrace:
   at Apache.Ignite.Internal.ClientSocket.<ConnectAsync>d__26.MoveNext()
   at Apache.Ignite.Internal.ClientFailoverSocket.<ConnectAsync>d__38.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs:line 812
   at Apache.Ignite.Internal.ClientFailoverSocket.<GetNextSocketAsync>d__36.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs:line 812
   at Apache.Ignite.Internal.ClientFailoverSocket.<ConnectAsync>d__24.MoveNext()
   at Apache.Ignite.IgniteClient.<StartAsync>d__0.MoveNext()
   at Apache.Ignite.IgniteClientGroup.<CreateClientAsync>d__14.MoveNext()
   at Apache.Ignite.IgniteClientGroup.<GetIgniteAsync>d__10.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ValueTask.cs:line 812
   at Apache.Extensions.Caching.Ignite.IgniteDistributedCache.<GetViewAsync>d__20.MoveNext()
   at Apache.Extensions.Caching.Ignite.IgniteDistributedCache.<GetAsync>d__10.MoveNext()
   at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.<GetStringAsync>d__7.MoveNext()
   at RedisForDummies.Infrastructure.Providers.Counters.CounterService.<GetAsync>d__7.MoveNext() in D:\repos\reports\HTC\Redis\src\RedisForDummies\RedisForDummies.Infrastructure\Providers\Counters\CounterService.cs:line 38

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
IgniteClientConnectionException: Invalid magic bytes returned from the server: FF-FF-57-86-00-00-00-00-00-00-00-00-00-00-00-00

In the logs of the ignite_instance container, I see the following messages:

2025-03-21 15:36:45 WARNING: package jdk.internal.access not in java.base
2025-03-21 15:36:45 WARNING: An illegal reflective access operation has occurred
2025-03-21 15:36:45 WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/opt/ignite/apache-ignite/libs/ignite-core-2.17.0.jar) to field java.nio.Buffer.address
2025-03-21 15:36:45 WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2

Could you please tell me what I'm doing wrong?

@ptupitsyn
Copy link
Contributor

ptupitsyn commented Mar 21, 2025

Looks like the server is Ignite 2.x, while the client is Ignite 3. Those are not compatible.

There is no problem with .NET 8.

@Maximys
Copy link
Author

Maximys commented Mar 21, 2025

@ptupitsyn , thanks. After this changes I see some messages after each request to Ignite in Ingine container logs:

2025-03-21 16:44:23 2025-03-21 12:44:23:244 +0000 [ERROR][defaultNode-srv-worker-4][HandshakeHandler] Error when performing handshake
2025-03-21 16:44:23 io.netty.handler.codec.DecoderException: org.apache.ignite.internal.network.NetworkConfigurationException: No serializer provider defined for group type 72 and message type 70
2025-03-21 16:44:23     at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:500)
2025-03-21 16:44:23     at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2025-03-21 16:44:23     at io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2025-03-21 16:44:23     at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
2025-03-21 16:44:23     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2025-03-21 16:44:23     at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
2025-03-21 16:44:23     at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
2025-03-21 16:44:23     at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
2025-03-21 16:44:23     at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
2025-03-21 16:44:23     at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
2025-03-21 16:44:23     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
2025-03-21 16:44:23     at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
2025-03-21 16:44:23     at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2025-03-21 16:44:23     at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2025-03-21 16:44:23     at java.base/java.lang.Thread.run(Unknown Source)
2025-03-21 16:44:23 Caused by: org.apache.ignite.internal.network.NetworkConfigurationException: No serializer provider defined for group type 72 and message type 70
2025-03-21 16:44:23     at org.apache.ignite.internal.network.MessageSerializationRegistryImpl.getFactory(MessageSerializationRegistryImpl.java:79)
2025-03-21 16:44:23     at org.apache.ignite.internal.network.MessageSerializationRegistryImpl.createDeserializer(MessageSerializationRegistryImpl.java:95)
2025-03-21 16:44:23     at org.apache.ignite.internal.network.serialization.SerializationService.createDeserializer(SerializationService.java:72)
2025-03-21 16:44:23     at org.apache.ignite.internal.network.serialization.PerSessionSerializationService.createMessageDeserializer(PerSessionSerializationService.java:116)
2025-03-21 16:44:23     at org.apache.ignite.internal.network.netty.InboundDecoder.decode(InboundDecoder.java:116)
2025-03-21 16:44:23     at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
2025-03-21 16:44:23     at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)

but as you can see, it's still unsuccessfully.
May be there is some instruction for integrating Apache Ignite to .NET application?

@ptupitsyn
Copy link
Contributor

ptupitsyn commented Mar 21, 2025

You should connect the client to port 10800. 3344 is for node-to-node comms.

Here is a detailed getting started guide for .NET developers:
https://ptupitsyn.github.io/Getting-Started-With-Apache-Ignite-Net-3/

Hope this helps!

@Maximys
Copy link
Author

Maximys commented Mar 24, 2025

Thanks, @ptupitsyn . I had not call
Invoke-RestMethod -Uri "http://localhost:10300/management/v1/cluster/init" -Method Post -Headers @{"Content-Type"="application/json"} -Body '{"metaStorageNodes": ["defaultNode"], "clusterName": "myCluster"}'
for initialize Ignite cluster, that's why I had error.

@Maximys Maximys closed this as completed Mar 24, 2025
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