Start camunda process using spring boot api

Hi,

I have spring boot rest api to start the process and the process getting started behind the scene but I am getting below error in console as well in response.
Below are the code that I am using to start the process.

ProcessInstanceResult instanceResult = zeebeClient .newCreateInstanceCommand() .bpmnProcessId(processId) .latestVersion() .variables(processVariables) .withResult() .send() .join();

io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: Time out between gateway and broker: Request ProtocolRequest{id=531, subject=command-api-1, sender=0.0.0.0:26502, payload=byte[]{length=283, hash=-951148236}} to 0.0.0.0:26501 timed out in PT9.999S
	at io.grpc.Status.asRuntimeException(Status.java:539) ~[grpc-api-1.54.1.jar:1.54.1]
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:487) ~[grpc-stub-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:576) ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:757) ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:736) ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.54.1.jar:1.54.1]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

Can anyone please help on this?

TIA.

1 Like

@BerndRuecker could you please assist on the above issue?

Do you get the same error for the same process if you leave out the .withResult() ?

You might get this timeout error if you are trying to mix an async process and a sync process (by using the .withResult )

@yadav1990 - please stop necro-posting on very old threads, and instead start a new thread with your question, or continue your existing thread. This is a community forum and not an official support avenue; if you need priority support for issues, I’d be happy to get you in touch with someone to discuss your support needs.

Please try the suggestion above first. Depending on the results, you can try increasing the timeout on the join method (or through other client settings you can find in the Javadocs). (Reference thread - please continue the conversation and troubleshooting here, however.)

Hi @yadav1990 - looks like a connection problem somewhere - but nothing specifically I can point to. Is the platform running fine in general? What’s your setup (SaaS, self-managed? If the latter, Docker Compose, Kubernetes, …). There is more information needed to hint you in the right direction.

@GotnOGuts: Shouldn’t have to do with withResult (but never say never :wink: )

I have self-managed manual setup for broker, elasticsearch and operate and configured the broker gateway address to 127.0.0.1:26500 in springboot app.

I also tried to increase the time in . join(120,TimeUnit.SECONDS) but didn’t work and got the same error.

Do you get the same error without the .withResult() ?

@yadav1990 - are you able to connect to the Operate web UI without error? Have you tried any other methods of starting a process, such as zbctl? Based on what you’ve shared, it seems to me the issue might be with your environment configuration rather than your application.

no we are not getting any error without .withResult().

yes, I am able to connect with operate without any error. And I can’t see any issue with that.

Only issue is when we are using .withResult() and this issue is reproducible.

@yadav1990 - when you start the process without .withResult(), do you see the instance in Operate? I would assume yes? Then, when you start the process with .withResult(), do you see the instance in Operate? (In other words, is it a timeout waiting for the process to complete, or is it a timeout trying to communicate with the gateway?) Based on the information you’ve just provided, it sounds like @GotnOGuts had the right idea: the process is taking longer than the timeout to complete.

In both the cases I can see the process instance in operate but the only difference is .withResult throwing above mentioned error.Even I tried to increase the timeout using .join(2,TimeUnit.MINUTES) and didn’t worked.

@yadav1990 - that means the process isn’t completing within the timeout window. Are you seeing the process complete before the exception is thrown?

This is not exact (nor 100% correct), but this is the concept of what is causing your error.

this can’t be visualized. But yes, process started behind the scenes, and I can only confirm the process started or not by logging into operate.