Connectors error io.camunda.common.exception.SdkException: Response not successful: 401

HI!

I got this error in connectors container.

env:

ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS=zeebe:26500
ZEEBE_CLIENT_SECURITY_PLAINTEXT=true
ZEEBE_CLIENT_ID=zeebe
ZEEBE_CLIENT_SECRET=zeebe
ZEEBE_CLIENT_CONFIG_PATH=/tmp/zeebe_auth_cache
ZEEBE_TOKEN_AUDIENCE=zeebe-api
ZEEBE_AUTHORIZATION_SERVER_URL=../auth/realms/camunda-platform/protocol/openid-connect/token
CAMUNDA_IDENTITY_BASE_URL=http://identity:8085
CAMUNDA_IDENTITY_ISSUER=.../auth/realms/camunda-platform
CAMUNDA_IDENTITY_ISSUER_BACKEND_URL=../auth/realms/camunda-platform
CAMUNDA_IDENTITY_CLIENT_ID=connectors
CAMUNDA_IDENTITY_CLIENT_SECRET=..
CAMUNDA_IDENTITY_TYPE=KEYCLOAK
CAMUNDA_IDENTITY_AUDIENCE=operate-api
CAMUNDA_OPERATE_CLIENT_KEYCLOAK-REALM=camunda-platform
CAMUNDA_OPERATE_CLIENT_KEYCLOAK-URL=...
management.endpoints.web.exposure.include=health
management.endpoint.health.probes.enabled=true
"JAVA_TOOL_OPTIONS=-Dlogging.level.io.camunda.zeebe.client.impl.ZeebeCallCredentials=ERROR"
CAMUNDA_OPERATE_CLIENT_URL=http://operate:8080
2024-04-21T22:49:21.333Z ERROR 1 --- [   scheduling-1] i.camunda.common.http.DefaultHttpClient  : Failed POST with responseType class io.camunda.operate.model.SearchResult, parameterType class io.camunda.operate.model.ProcessDefinition, selector io.camunda.operate.model.SearchResult<io.camunda.operate.model.ProcessDefinition>, body io.camunda.operate.search.SearchQuery@61f8d850 due to Response not successful: 401
2024-04-21T22:49:21.333Z ERROR 1 --- [   scheduling-1] i.c.c.r.i.i.ProcessDefinitionImporter    : Failed to import process definitions

io.camunda.common.exception.SdkException: io.camunda.common.exception.SdkException: Response not successful: 401
        at io.camunda.common.http.DefaultHttpClient.post(DefaultHttpClient.java:162)
        at io.camunda.operate.CamundaOperateClient.searchProcessDefinitionResults(CamundaOperateClient.java:46)
        at io.camunda.connector.runtime.inbound.importer.ProcessDefinitionSearch.query(ProcessDefinitionSearch.java:72)
        at io.camunda.connector.runtime.inbound.importer.ProcessDefinitionImporter.scheduleImport(ProcessDefinitionImporter.java:55)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
        at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
        at io.micrometer.observation.Observation.observe(Observation.java:499)
        at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: io.camunda.common.exception.SdkException: Response not successful: 401
        at io.camunda.common.http.DefaultHttpClient.parseAndRetry(DefaultHttpClient.java:295)
        at io.camunda.common.http.DefaultHttpClient.post(DefaultHttpClient.java:153)
        ... 16 common frames omitted

Hi @Zoltan_Karolyi
401 error typically means authorization failure.
Do you really have ZEEBE_CLIENT_SECRET set to zeebe in your environment?

Regards,
Alex

yes: zeebe everywhere

2024-04-24T22:14:27.031Z ERROR 1 — [ scheduling-1] i.c.c.r.i.i.ProcessDefinitionImporter : Failed to import process definitions

io.camunda.common.exception.SdkException: io.camunda.common.exception.SdkException: Response not successful: 401
at io.camunda.common.http.DefaultHttpClient.post(DefaultHttpClient.java:162)
at io.camunda.operate.CamundaOperateClient.searchProcessDefinitionResults(CamundaOperateClient.java:46)
at io.camunda.connector.runtime.inbound.importer.ProcessDefinitionSearch.query(ProcessDefinitionSearch.java:72)
at io.camunda.connector.runtime.inbound.importer.ProcessDefinitionImporter.scheduleImport(ProcessDefinitionImporter.java:55)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
at io.micrometer.observation.Observation.observe(Observation.java:499)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: io.camunda.common.exception.SdkException: Response not successful: 401
at io.camunda.common.http.DefaultHttpClient.parseAndRetry(DefaultHttpClient.java:295)
at io.camunda.common.http.DefaultHttpClient.post(DefaultHttpClient.java:153)
… 16 common frames omitted

Hi, were you able to solve this problem?

Hi, This is not a mistake just if you do not change the bpmn, the camunda 8 cannot deploy it automatically and give this error 401.