URLs extracted Error

Unexpected end of JSON input [line 5]

SyntaxError

What is the error message (if any)?

Please provide the solution

Please share your workflow

Share the output returned by the last node

Error detail

{
“errorMessage”: “Unexpected end of JSON input [line 5]”,
“errorDescription”: “SyntaxError”,
“errorDetails”: {},
“n8nDetails”: {
“n8nVersion”: “2.3.5 (Self Hosted)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“SyntaxError: Unexpected end of JSON input”,
" at JSON.parse ()“,
" at VmCodeWrapper (evalmachine.:5:19)”,
" at evalmachine.:22:2",
" at Script.runInContext (node:vm:149:12)“,
" at runInContext (node:vm:301:6)”,
" at result (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+task-runner@file+packages+@n8n+task-runner_@[email protected]_@opentelemetry_eb51b38615a039445701c88b088f88d0/node_modules/@n8n/task-runner/dist/js-task-runner/js-task-runner.js:185:61)“,
" at new Promise ()”,
" at JsTaskRunner.runForAllItems (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+task-runner@file+packages+@n8n+task-runner_@[email protected]_@opentelemetry_eb51b38615a039445701c88b088f88d0/node_modules/@n8n/task-runner/dist/js-task-runner/js-task-runner.js:178:34)“,
" at JsTaskRunner.executeTask (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+task-runner@file+packages+@n8n+task-runner_@[email protected]_@opentelemetry_eb51b38615a039445701c88b088f88d0/node_modules/@n8n/task-runner/dist/js-task-runner/js-task-runner.js:128:26)”,
" at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"
]
}
}

Hi @Usman_Naz ,

It looks like in your instance the Sora rest call states that it failed for some reason. Since your code node for getting the urls expect a certain format in the variable you’re pulling it is failing. Add an If statement to check for success values as this worked for me when testing. Now just handle the failed instances

In your instance the state is “fail”, which means the “resultJson” property you’re referencing is probably missing during failed states