N8N_RUNNERS_ENABLED crash my WF

Describe the problem/error/question

As a good guy, having seen this in my logs

There is a deprecation related to your environment variables. Please take the recommended actions to update your configuration:

    • N8N_RUNNERS_ENABLED → Running n8n without task runners is deprecated. Task runners will be turned on by default in a future version. Please set N8N_RUNNERS_ENABLED=true to enable task runners now and avoid potential issues in the future.*

I’ve enabled it.

BUT…

My workflow previously running well (heavy WF running for days), suddenly and randomly crash

What is the error message (if any)?

Here is the crash report :frowning:
{
“errorMessage”: “Node execution failed”,
“errorDescription”: “This can happen for various reasons. Please try executing the node again. If the problem persists, you can try the following:

1. Reduce the number of items processed at a time, by batching them using a loop node
2. Increase the memory available to the task runner with ‘N8N_RUNNERS_MAX_OLD_SPACE_SIZE’ environment variable”,
“errorDetails”: {},
“n8nDetails”: {
“n8nVersion”: “1.80.5 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“Error: Node execution failed”,
" at InternalTaskRunnerDisconnectAnalyzer.toDisconnectError (/usr/local/lib/node_modules/n8n/dist/task-runners/default-task-runner-disconnect-analyzer.js:26:16)“,
" at InternalTaskRunnerDisconnectAnalyzer.toDisconnectError (/usr/local/lib/node_modules/n8n/dist/task-runners/internal-task-runner-disconnect-analyzer.js:33:28)”,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)“,
" at TaskBrokerWsServer.removeConnection (/usr/local/lib/node_modules/n8n/dist/task-runners/task-broker/task-broker-ws-server.js:114:37)”,
" at WebSocket. (/usr/local/lib/node_modules/n8n/dist/task-runners/task-broker/task-broker-ws-server.js:106:13)"
]
}
}

In the logs, I can see many lines :

ask (s8tblTFv) rejected by Runner with reason “Offer expired and no open task slots”
Task (IQrqNlZZ) rejected by Runner with reason “Offer expired and no open task slots”
Task (OaxqFs1S) rejected by Runner with reason “Offer expired and no open task slots”
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason “Runner timed out”.
Task (yAUpNTve) rejected by Runner with reason “Offer expired and no open task slots”
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason “Runner timed out”.
Task (YQxXuZ-I) rejected by Runner with reason “Offer expired and no open task slots”
Task (gbyTWQeJ) rejected by Runner with reason “Offer expired and no open task slots”
Task (CiCKBF10) rejected by Runner with reason “Offer expired and no open task slots”

And, at the end

Task (Xr7GHajj) rejected by Runner with reason “Offer expired and no open task slots”
[Task Runner]: node:buffer:834
return this.utf8Slice(0, this.length);
^

Error: Cannot create a string longer than 0x1fffffe8 characters
at Buffer.toString (node:buffer:834:17)
at WebSocket.onMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/event-target.js:205:40)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/websocket.js:1220:20)
at Receiver.emit (node:events:518:28)
at Receiver.dataMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:596:14)
at Receiver.getData (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:94:10)
at writeOrBuffer (node:internal/streams/writable:572:12) {
code: ‘ERR_STRING_TOO_LONG’
}

Node.js v20.18.3
Registered runner “JS Task Runner” (YRONcltu3fRapYtmnA-Kk)
[Task Runner]: node:buffer:834
return this.utf8Slice(0, this.length);
^

Error: Cannot create a string longer than 0x1fffffe8 characters
at Buffer.toString (node:buffer:834:17)
at WebSocket.onMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/event-target.js:205:40)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/websocket.js:1220:20)
at Receiver.emit (node:events:518:28)
at Receiver.dataMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:596:14)
at Receiver.getData (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:94:10)
at writeOrBuffer (node:internal/streams/writable:572:12) {
code: ‘ERR_STRING_TOO_LONG’
}

Node.js v20.18.3
Registered runner “JS Task Runner” (yHvD0ks8KlIbRLRLmWDjv)
[Task Runner]: node:buffer:834
return this.utf8Slice(0, this.length);
^

Error: Cannot create a string longer than 0x1fffffe8 characters
at Buffer.toString (node:buffer:834:17)
at WebSocket.onMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/event-target.js:205:40)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/websocket.js:1220:20)
at Receiver.emit (node:events:518:28)
at Receiver.dataMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:596:14)
at Receiver.getData (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/usr/local/lib/node_modules/n8n/node_modules/@n8n/task-runner/node_modules/ws/lib/receiver.js:94:10)
at writeOrBuffer (node:internal/streams/writable:572:12) {
code: ‘ERR_STRING_TOO_LONG’
}

Node.js v20.18.3
Registered runner “JS Task Runner” (Fbd8hiHHyHsgibgPciG9D)
Received SIGTERM. Shutting down…
[Task Runner]: Received SIGTERM signal, shutting down…
[Task Runner]: Task runner stopped

So I’ve disabled the runners, and now it’s working well again.

Tell me if you need more details…

Please share your workflow

Well, it’s a non trivial one, relying on lot of data. I cannot share it.

Information on your n8n setup

  • n8n version: Version 1.80.5
  • Database (default: SQLite): sqlite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): self hosted
  • Operating system: ubuntu
[Task Runner]: node:buffer:834
return this.utf8Slice(0, this.length);
^
Cannot create a string longer than 0x1fffffe8 characters
...
code: ‘ERR_STRING_TOO_LONG’

So the error looks like you’re hitting the string limit in nodejs (0x1fffffe8 = 536,870,904 characters) which is causing the task runner to terminate.

Suggest refactoring to use Buffers instead (they don’t have this hard limit) but it is indeed strange how you’ve not hit this error before and that it’s working outside of task runners.

Hi,

I’m not using that size strings… I think it’s a bug. I can share the code block if you want.

Ah ok thanks for the clarification.

In that case, the issue does seem quite low-level and probably nothing we do here, so I’d recommend opening an issue in the n8n github repository instead with your example code block.

2 Likes

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