Error: Connection refused: /0.0.0.0:26500 when connecting spring boot starter to Zeebe docker compose simple monitor

Dear Team,

I’m trying to deploy simple spring-boot zeebe client using docker. But as soon as the application starts, I get connection refused error as below. I have docker compose zeebe broker (simple monitor) already running successfully. Below is the source code I’m using to build the docker containers.

Zeebe broker: zeebe-docker-compose/simple-monitor at master · zeebe-io/zeebe-docker-compose · GitHub

Zeebe springboot client: spring-zeebe/examples/starter at master · zeebe-io/spring-zeebe · GitHub

Note: I’m able to successfully connect to zeebe broker from java client container from this source code in Github:
zeebe-io/zeebe-get-started-java-client
But however I would like to use a spring boot zeebe client. Could you please help.

Below is the error I get:
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-02-18 22:15:57.210 ERROR 1 — [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.context.ApplicationContextException: Failed to start bean ‘zeebeClientLifecycle’; nested exception is io.zeebe.client.api.command.Cl
ientStatusException: io exception
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at io.zeebe.spring.example.StarterApplication.main(StarterApplication.java:23)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:598)
Caused by: io.zeebe.client.api.command.ClientStatusException: io exception
at io.zeebe.client.impl.ZeebeClientFutureImpl.transformExecutionException(ZeebeClientFutureImpl.java:93)
at io.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:50)
at io.zeebe.spring.client.config.processor.DeploymentPostProcessor.lambda$apply$3(DeploymentPostProcessor.java:49)
at io.zeebe.spring.client.ZeebeClientLifecycle.lambda$start$0(ZeebeClientLifecycle.java:51)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at io.zeebe.spring.client.ZeebeClientLifecycle.start(ZeebeClientLifecycle.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
… 20 common frames omitted
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at io.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:48)
… 25 common frames omitted
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at io.grpc.Status.asRuntimeException(Status.java:533)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478)
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:464)
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:428)
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:461)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:617)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:803)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:782)
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: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /0.0.0.0:26500
Caused by: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)

I tried this application configuration
zeebe.client.broker.gatewayAddress:127.0.0.1:26500
zeebe.client.security.plaintext:true
or
zeebe.client.broker.contactPoint: 127.0.0.1:26500

but still I get this error:Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:26500
Caused by: java.net.ConnectException: Connection refused

Thanks in Advance,
Ravi

You are connecting to the wrong address. You need to configure your client application with the address of the Zeebe Gateway.

I face the same issue too .

I tried this config :
zeebe.client.broker.gatewayAddress:127.0.0.1:26500
zeebe.client.security.plaintext:true

Do we need to change anything in this ?

1 Like

@jwulf
What’s the correct address ? Isn’t it 127.0.0.1:26500 ?

1 Like

Hi, Initially I had this issue, Later it worked for me after I updated spring zeebe starter version to latest in my spring zeebe client. Below is the config I have
zeebe:
client:
broker.contactPoint: 127.0.0.1:26500
security.plaintext: true
worker.name: “worker-name”

Thanks @Ravitheja .
I am using the latest version of spring-zeebe-starter : 1.0.0-rc1

And it still gives me the same error .
Which specific version are you using ?

@siva_rk, install Portainer or similar and examine the docker network and port configuration on your machine.

What OS are you doing this on?

I downgraded to 0.26 version of spring-zeebe . It’s working now.
May be because the zeebe version mentioned in Zeebe-docker-compose is 0.26 .

Will check the docker network and try the latest version again.
I am using Ubuntu 20.04

Am also getting the same error. We are using docker for the camunda self hosted environment, and when spring boot runs from eclipse, it’s working fine. But when deployed in docker container, it fails as connection refused.

If you run everything in docker, you should use docker-compose to bring everything up, and then you get container resolution via DNS by service name.

Otherwise, if you bring up your Springboot application in its own container, it will be trying to connect with itself on 0.0.0.0, whereas you want it connecting to the container that is running the Zeebe Gateway: