Getting 401 Unauthorized when activating a worker

We are receiving following WARN message from time to time. Our current cluster version is 8.2.8 and spring-zeebe-starter version is 8.2.1. We use Spring Boot 3.0.7. Please help us find the reason.

2023-05-24 02:42:57.095  WARN 1 --- [t-executor-3453] io.camunda.zeebe.client.job.poller       : Failed to activate jobs for worker *****Worker#******** and job type **********

io.grpc.StatusRuntimeException: UNAUTHENTICATED: HTTP status code 401
invalid content-type: text/html
headers: Metadata(:status=401,date=Wed, 24 May 2023 02:42:57 GMT,content-type=text/html,strict-transport-security=max-age=63072000; includeSubDomains,content-length=172)
DATA-----------------------------
<html>
<head><title>401 Authorization Required</title></head>
<body>
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx</center>
</body>
</html>

	at io.grpc.Status.asRuntimeException(Status.java:535) ~[grpc-api-1.49.1.jar!/:1.49.1]
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:487) ~[grpc-stub-1.49.1.jar!/:1.49.1]
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563) ~[grpc-core-1.49.1.jar!/:1.49.1]
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) ~[grpc-core-1.49.1.jar!/:1.49.1]
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744) ~[grpc-core-1.49.1.jar!/:1.49.1]
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723) ~[grpc-core-1.49.1.jar!/:1.49.1]
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.49.1.jar!/:1.49.1]
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.49.1.jar!/:1.49.1]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:1623) ~[na:na]
1 Like

Hi @skiziltas,

I also faced the similar issue when tried first to set up connection with Camunda 8 SaaS platform from my spring boot set up. I have used Spring boot 3.1.3 and Java 17. At the same time, I have used following Camunda dependency in my spring project.

io.camunda.spring
spring-boot-starter-camunda
8.2.3

Also, I generated the API key from Console->Cluster->API and put them in property file.
zeebe.client.cloud.region=given my SaaS region id

zeebe.client.cloud.clusterId=id of my cluster

zeebe.client.cloud.clientId=value taken from API key generation process

zeebe.client.cloud.clientSecret=value taken from API key generation process

Above mentioned steps helped me to set the connection properly without further issue.