"Develop Workers (Java) Course" Project Fail to Run due to the 401 Unauthorized Error

Greetings everyone,

The project in Camunda 8 - Develop Workers (Java) course won’t run after preparing the env as described in Prepare Environment step.

Last time, I had 404 error with this project, but I managed to solve it somehow.

Now I’m getting 401 even though following the steps, which is simply downloading the project and inserting the credentials.

The credentials are correct because:

  • I have tried them with another application and also in Postman.
  • I also tried debugging to check that the credentials used are the ones I inserted.

Logs

[main] INFO com.camunda.academy.OrderApplication - Starting: 1 process instances for process: orderProcess
[main] INFO com.camunda.academy.OrderApplication - Generating Order(3c3e4ef)
io.camunda.zeebe.client.api.command.ClientStatusException
	at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.transformExecutionException(ZeebeClientFutureImpl.java:116)
	at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:54)
	at com.camunda.academy.OrderApplication.startProcessInstances(OrderApplication.java:99)
	at com.camunda.academy.OrderApplication.main(OrderApplication.java:58)
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: CANCELLED
	at java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(CompletableFuture.java:347)
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:442)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2119)
	at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:52)
	... 2 more
Caused by: io.grpc.StatusRuntimeException: CANCELLED
	at io.grpc.Status.asRuntimeException(Status.java:532)
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481)
	at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489)
	at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:453)
	at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:486)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:564)
	at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:729)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:710)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619)
	at java.base/java.lang.Thread.run(Thread.java:1447)
Caused by: java.io.IOException: Failed while requesting access token with status code 401 and message Unauthorized.
	at io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProvider.fetchCredentials(OAuthCredentialsProvider.java:157)
	at io.camunda.zeebe.client.impl.oauth.OAuthCredentialsCache.computeIfMissingOrInvalid(OAuthCredentialsCache.java:123)
	at io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProvider.applyCredentials(OAuthCredentialsProvider.java:79)
	at io.camunda.zeebe.client.impl.ZeebeCallCredentials.lambda$applyRequestMetadata$0(ZeebeCallCredentials.java:49)
	... 3 more

Thanks!

The problem was solved after creating a new cluster.
Unfortunately, I couldn’t determine the reason why it didn’t work with the old cluster.