Code node working for python but fails for JS. what could be the reasons?

Describe the problem/error/question

n8n on k8s using a multi stage build
worked perfectly fine on local
her eon k8s python node seems to work OK but JS one times out
any help please in this regard?

What is the error message (if any)?

Task request timed out after 60 seconds

Your Code node task was not matched to a runner within the timeout period. This indicates that the task runner is currently down, or not ready, or at capacity, so it cannot service your task.

If you are repeatedly executing Code nodes with long-running tasks across your instance, please space them apart to give the runner time to catch up. If this does not describe your use case, please open a GitHub issue or reach out to support.

If needed, you can increase the timeout using the N8N_RUNNERS_TASK_REQUEST_TIMEOUT environment variable.

Please share your workflow

basic code node with screenshots attached

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.1.1
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker/k8s
  • Operating system: linux

Hey @adarsh-lm, could you share the Docker logs from when your instance started? Usually, if there are issues with your runners, the logs show them during startup.

error logs caught in the k8s pod

```
2026/03/11 15:07:44 INFO [launcher:js] Waiting for task broker to be ready…
2026/03/11 15:07:44 INFO [launcher:js] Waiting for launcher’s task offer to be accepted…
2026/03/11 15:07:44 ERROR [runner:js] node:internal/modules/cjs/loader:1386
2026/03/11 15:07:44 ERROR [runner:js] throw err;
2026/03/11 15:07:44 ERROR [runner:js] ^
2026/03/11 15:07:44 ERROR [runner:js] Error: Cannot find module ‘@n8n/di’
2026/03/11 15:07:44 ERROR [runner:js] Require stack:
2026/03/11 15:07:44 ERROR [runner:js] - /opt/runners/task-runner-javascript/dist/start.js
2026/03/11 15:07:44 ERROR [runner:js] at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
2026/03/11 15:07:44 ERROR [runner:js] at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
2026/03/11 15:07:44 ERROR [runner:js] at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
2026/03/11 15:07:44 ERROR [runner:js] at Function._load (node:internal/modules/cjs/loader:1192:37)
2026/03/11 15:07:44 ERROR [runner:js] at TracingChannel.traceSync (node:diagnostics_channel:328:14)
2026/03/11 15:07:44 ERROR [runner:js] at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
2026/03/11 15:07:44 ERROR [runner:js] at Module.require (node:internal/modules/cjs/loader:1463:12)
2026/03/11 15:07:44 ERROR [runner:js] at require (node:internal/modules/helpers:147:16)
2026/03/11 15:07:44 ERROR [runner:js] at Object. (/opt/runners/task-runner-javascript/dist/start.js:36:14)
2026/03/11 15:07:44 ERROR [runner:js] at Module._compile (node:internal/modules/cjs/loader:1706:14) {
2026/03/11 15:07:44 ERROR [runner:js] code: ‘MODULE_NOT_FOUND’,
2026/03/11 15:07:44 ERROR [runner:js] requireStack: [ ‘/opt/runners/task-runner-javascript/dist/start.js’ ]
2026/03/11 15:07:44 ERROR [runner:js] }
2026/03/11 15:07:44 ERROR [runner:js] Node.js v22.21.1
2026/03/11 15:07:44 ERROR [launcher:js] Runner process exited with error: exit status 1
```

this setup seemingly exact worked on my local. i have only translated to configmaps/secrets otherwise everything else is intact.

what could be the reason it fails here?

seemingly exact setup worked on my local.

It seems that an internal module (@n8n/di) is missing. There could be several reasons for this. First, try upgrading the Node.js version. If that does not resolve the issue, we will need to narrow down the possibilities, so please also share the file you used to deploy the runner.

1 Like

I needed extra dependencies which could not be copied into /node_modules so in the earlier dockerfile made a clean deletion of directory and then copied. this is where inbuilt dependencies were wiped off causing the issue

Updated the implementation to instead copy extra deps to a different directory and point is as a path for node_modules

fixed, thank you!

moving from local to k8s is so much more complex than I thought. The podman local → bitbucket pipelines docker does not always result in a seamless transition

2 Likes

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