Event not getting published

while publishing an event through eventgateway, I am getting following exception:

2024-09-22 15:38:28.337  WARN 16700 --- [grpc-executor-4] i.a.axonserver.grpc.EventStoreService    : Error on connection from client: CANCELLED: client cancelled
2024-09-22 15:38:28.340 ERROR 16700 --- [  data-writer-3] i.a.a.localstorage.LocalEventStore       : Error occurred during store batch operation: 

io.grpc.StatusRuntimeException: CANCELLED: client cancelled
	at io.grpc.Status.asRuntimeException(Status.java:530) ~[grpc-api-1.50.3.jar!/:1.50.3]
	at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onCancel(ServerCalls.java:291) ~[grpc-stub-1.50.3.jar!/:1.50.3]
	at io.grpc.PartialForwardingServerCallListener.onCancel(PartialForwardingServerCallListener.java:40) ~[grpc-api-1.50.3.jar!/:1.50.3]
	at io.grpc.ForwardingServerCallListener.onCancel(ForwardingServerCallListener.java:23) ~[grpc-api-1.50.3.jar!/:1.50.3]
	at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onCancel(ForwardingServerCallListener.java:40) ~[grpc-api-1.50.3.jar!/:1.50.3]
	at io.grpc.Contexts$ContextualizedServerCallListener.onCancel(Contexts.java:96) ~[grpc-api-1.50.3.jar!/:1.50.3]
	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.closedInternal(ServerCallImpl.java:378) ~[grpc-core-1.50.3.jar!/:1.50.3]
	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.closed(ServerCallImpl.java:365) ~[grpc-core-1.50.3.jar!/:1.50.3]
	at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1Closed.runInContext(ServerImpl.java:923) ~[grpc-core-1.50.3.jar!/:1.50.3]
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.50.3.jar!/:1.50.3]
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.50.3.jar!/:1.50.3]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

Not sure what’s wrong. Also, I don’t see any event being published on axon dashboard because of this exception.

Please help.

Could you perhaps share the code snippet performing the publication, @Parth?
If you could add things like the Java version, Axon Framework version, Axon Server version, and other configuration specifics, that might proof helpful to resolve this issue for you.

Added, this is really the only stack trace you are receiving? I would assume the Axon Server instance itself also logs some kind of error at the same point in time. If that is the case, be sure to share that too.

Hi @Steven_van_Beelen, I am sorry but can’t share the code due to company policy but essentially I am just creating an event gateway which uses a context in which I want to publish event to. Exactly like this: Dispatching Events | Axon Reference Guide

Details:

Java version: 22.0.1
Axon framework version: 4.5.9
AxonServer version: 2023.2.4

Also, this stack trace appears on axonserver log and not in my application. There is no error in application logs.

If Axon Server states that the client canceled, then I would assume there is something amiss with your Axon Framework application. Perhaps it is smart to enable DEBUG or TRACE logging on your Axon Framework application to see what passes through.

Next to that, I spot that you’re using a, to be frank, very old version of Axon Framework.

4.5.9 was released over two years ago now. Note that we only provide bug fixes up to two minor releases back. As we are currently on 4.10.1 of Axon Framework, that means it would be a good move to upgrade to a more recent version.

Importantly though, not just for Axon Framework-specific fixes.

Axon Framework uses the Axon Server Connector Java dependency to make the connection with an Axon Server instance. Since the version used by Axon Framework 4.5.9 (which is 4.5.4 of the connector), several connection fixes and heartbeat improvements have been introduced to further solidify the connection between instances.

So, let us know whether the connection issues persist when upgrading your Axon Framework and, by doing, Axon Server Connector Java version!