Splunk Retrieve Result ERROR

Describe the problem/error/question

I created a search by n8n and tried to retrieve its result by SID and got this error message, details are in the image

What is the error message (if any)?

ERROR: Cannot read properties of undefined (reading ‘toString’)

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:1.1.1
  • **Database (default: SQLite):Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker Compose
  • **Operating system:Ubuntu

Hi @Le_nAm :wave: I’m not too sure exactly what’s happening here without your full workflow (nor am I familiar with Splunk), but are you trying to convert an integer to a string somewhere in your workflow? :eyes: Does Splunk expect a string or an integer for the sid?

Splunk node expects SID, I believe it should be a string and can’t convert a string by using toString() method, just maybe. The weird here is when I execute full workflow, it failed but if I executed that node only, it worked like a champ…

Thanks for confirming that behaviour, and also for sharing your workflow - that doesn’t sound quite right, so I’ve flagged this with our engineers to take a peek into. Whenever I have any updates, I’ll share them with you!

Unfortunately Splunk doesn’t allow trial accounts to access their API, so I can’t build an example for you - but you may be able to get this working by manually creating the request through the HTTP Request node, as a workaround :bowing_man:

1 Like

Hi, I am dealing with the same problem on Splunk. But for me, it won’t run no matter what I do.
Using valid credentials, I get the same error no matter what I’m trying to do:

ERROR: Cannot read properties of undefined (reading ‘toString’)

TypeError: Cannot read properties of undefined (reading 'toString')
    at Parser.exports.Parser.Parser.parseString (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:316:19)
    at Parser.parseString (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:5:59)
    at exports.parseString (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:373:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Splunk/GenericFunctions.js:57:34
    at new Promise (<anonymous>)
    at parseXml (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Splunk/GenericFunctions.js:56:12)
    at Object.splunkApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Splunk/GenericFunctions.js:102:33)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Splunk/Splunk.node.js:235:40)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:658:19)

EDIT: It looks like it was a user error in my case. :slight_smile:
As soon as I added the port (host:8089) to my credentials, it worked. I am leaving this here for anyone else who might encounter the same problem.

4 Likes

Thanks for posting your solution, @CristianG !

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