Node-js-sdk example can't connect to tasklist

I am following the example at Node.js | Camunda 8 Docs

I am using self managed camunda 8 with kind as per Local Kubernetes cluster | Camunda 8 Docs

I have port forwards:
kubectl port-forward svc/camunda-platform-zeebe-gateway 26500:26500
kubectl port-forward svc/camunda-platform-operate 8082:80

When I run the full node-js-sdk example I get this output:

Starting worker…
Starting human task poller…
[Zeebe] Deployed process c8-sdk-demo
[Zeebe Worker] handling job of type service-task
camunda:tasklist Requesting tasks/search +3s
/node_modules/got/dist/source/as-promise/index.js:118
request._beforeError(new types_1.HTTPError(response));
^
HTTPError: Response code 401 (Unauthorized) (request to http://localhost:8082/v1/tasks/search)
at Request. (/node_modules/got/dist/source/as-promise/index.js:118:42)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: ‘ERR_NON_2XX_3XX_RESPONSE’,
timings: {
start: 1713435068468,
socket: 1713435068469,
lookup: 1713435068470,
connect: 1713435068470,
secureConnect: undefined,
upload: 1713435068470,
response: 1713435068499,
end: 1713435068501,
error: undefined,
abort: undefined,
phases: {
wait: 1,
dns: 1,
tcp: 0,
tls: undefined,
request: 0,
firstByte: 29,
download: 2,
total: 33
}
}
}

Is there something missing from the example?

Hi @bencaldwell
have you followed these configuration steps? Node.js | Camunda 8 Docs

Yes that link is the procedure I’ve followed.

Thanks to @jwulf I have resolved this (Does not work with local self-managed stack · Issue #6 · camunda-community-hub/c8-sdk-demo · GitHub)

The issue is that I was using the docker-compose.yaml in the repo GitHub - camunda/camunda-platform: Links to Camunda Platform 8 resources, releases, and local development config to define my local cluster. This docker compose file does not include permissions for the zeebe client to connect to tasklist etc. apis.

I think that the docker-compose file should include these permissions so local development works out of the box. I’ve raised a PR that does this Add keycloak permissions so zeebe client can access tasklist etc. by bencaldwell · Pull Request #619 · camunda/camunda-platform · GitHub

2 Likes