HttpClientErrorException when executing a command

Hi,

we get randomly the following exception when we execute a command.

org.axonframework.commandhandling.CommandExecutionException: org.springframework.web.client.HttpClientErrorException: 419 419
at org.axonframework.axonserver.connector.ErrorCode.lambda$static$10(ErrorCode.java:88)
at org.axonframework.axonserver.connector.ErrorCode.convert(ErrorCode.java:182)
at org.axonframework.axonserver.connector.command.CommandSerializer.deserialize(CommandSerializer.java:157)
at org.axonframework.axonserver.connector.command.AxonServerCommandBus$1.onNext(AxonServerCommandBus.java:313)
at org.axonframework.axonserver.connector.command.AxonServerCommandBus$1.onNext(AxonServerCommandBus.java:306)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:429)
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33)
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:596)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:581)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.axonframework.axonserver.connector.command.AxonServerRemoteCommandHandlingException: An exception was thrown by the remote message handling component: org.springframework.web.client.HttpClientErrorException: 419 419
Caused by 419 419

And idea what is causing this? It also happens in an integration test somtimes. So it is somehow reproducable…
The command is executed in our rest endpoint which is processed by an Aggregate in the same service.

Best, Michael

Hi I was debugging a little bit more.

it seems when I get the error I do not get to the Aggregate at all.

I’ using the
@CreationPolicy(AggregateCreationPolicy.CREATE_IF_MISSING)

Are there maybe known issues related to that? I use the 4.3.2 framework version.

Best, Michael

I tested also framework 4.3.3 - no difference.

This is the command failing:

Result result = commandGateway.sendAndWait(
    new MyCommand(id), 5000L, TimeUnit.MILLISECONDS);

The stack has change a little bit. It seems simply to timeout once in a while.

org.axonframework.commandhandling.CommandExecutionException: An exception occurred while executing a command
at org.axonframework.commandhandling.gateway.DefaultCommandGateway.asRuntime(DefaultCommandGateway.java:156)
at org.axonframework.commandhandling.gateway.DefaultCommandGateway.sendAndWait(DefaultCommandGateway.java:119)

Best, Michael

If I restart the axon server incl. db the it rest runs fine 100% for exactly 1 time!

After that I get
org.axonframework.commandhandling.CommandExecutionException: org.springframework.web.client.HttpClientErrorException: 419 419

Any ideas?

Hi Michael,

are you using a Spring HTTP client somewhere? It seems that it is doing a request and getting a HTTP 419 back.
As far as I know, Axon itself doesn’t use any HTTP clients, except in the Axon - SpringCloud extension, which I suspect you are not using at this time.

Hi Allard,

The problem was a service which was crashed and still in the background. It was receiving this command and reporting this error. After killing it everything worked like expected.

Best Regards,
Michael