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

**URL:** <https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914>\
**Category:** Camunda 8 Topics\
**Created:** [April 18, 2024, 11:18am UTC](https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914 "2024-04-18T11:18:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bencaldwell](https://forum.camunda.io/user_avatar/forum.camunda.io/bencaldwell/32/29236_2.png) [@bencaldwell](https://forum.camunda.io/u/bencaldwell)\
**Post date:** [April 18, 2024, 11:18am UTC](https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914/1 "2024-04-18T11:18:24Z")

</div>

I am following the example at [Node.js | Camunda 8 Docs](https://docs.camunda.io/docs/next/apis-tools/node-js-sdk/#further-steps)

I am using self managed camunda 8 with kind as per [Local Kubernetes cluster | Camunda 8 Docs](https://docs.camunda.io/docs/next/self-managed/setup/deploy/local/local-kubernetes-cluster/)

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](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?

---

<div class="post-metadata">

**Author:** ![Alex\_Voloshyn](https://forum.camunda.io/user_avatar/forum.camunda.io/alex_voloshyn/32/14765_2.png) [@Alex\_Voloshyn](https://forum.camunda.io/u/Alex_Voloshyn)\
**Post date:** [April 18, 2024, 11:22am UTC](https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914/2 "2024-04-18T11:22:24Z")

</div>

Hi @bencaldwell  
have you followed these configuration steps? [Node.js | Camunda 8 Docs](https://docs.camunda.io/docs/next/apis-tools/node-js-sdk/#self-managed-configuration)

---

<div class="post-metadata">

**Author:** ![bencaldwell](https://forum.camunda.io/user_avatar/forum.camunda.io/bencaldwell/32/29236_2.png) [@bencaldwell](https://forum.camunda.io/u/bencaldwell)\
**Post date:** [April 19, 2024, 2:54am UTC](https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914/3 "2024-04-19T02:54:52Z")

</div>

Yes that link is the procedure I’ve followed.

---

<div class="post-metadata">

**Author:** ![bencaldwell](https://forum.camunda.io/user_avatar/forum.camunda.io/bencaldwell/32/29236_2.png) [@bencaldwell](https://forum.camunda.io/u/bencaldwell)\
**Post date:** [April 29, 2024, 2:49am UTC](https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914/4 "2024-04-29T02:49:10Z")

</div>

Thanks to @jwulf I have resolved this ([Does not work with local self-managed stack · Issue #6 · camunda-community-hub/c8-sdk-demo · GitHub](https://github.com/camunda-community-hub/c8-sdk-demo/issues/6))

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](https://github.com/camunda/camunda-platform) 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](https://github.com/camunda/camunda-platform/pull/619)

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [May 6, 2024, 2:49am UTC](https://forum.camunda.io/t/node-js-sdk-example-cant-connect-to-tasklist/51914/5 "2024-05-06T02:49:38Z")

</div>

Closed on May 6, 2024, 2:49am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
