n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
47.49k stars 7.14k forks source link

Problem in node SerpAPI: Invalid URL #11358

Open smxsm opened 3 hours ago

smxsm commented 3 hours ago

Bug Description

Using the standard "AI Agent Chat" Template, the SerpAPI sub node throws an error, although I have added a valid SERP API credential.

To Reproduce

Clone / use the "AI Agent Chat" Template, enter a valid SERP API credential and click on "CHAT". The call to the SERP API Node will fail and output an error. The error message is:

Workflow execution finished with error {"scope":"executions",
"error":{"level":"warning","tags":{},"context":{"itemIndex":0,"runIndex":0},"functionality":"regular","name":"NodeApiError","timestamp":1729670611753,"node":
{"parameters":{"notice":"","options":{"gl":"us","device":"desktop","no_cache":false,"google_domain":"google.com","hl":"en"}},
"id":"062e7255-07fb-475c-b0af-9ddacb1c1660","name":"SerpAPI","type":"@n8n/n8n-nodes-langchain.toolSerpApi",
"position":[880,893],"typeVersion":1,"credentials":{"serpApi":{"id":"GFHtrcWE2GkMxxCq","name":"SerpAPI account"}}},
"messages":["Invalid URL"],
"httpCode":"ERR_INVALID_URL","message":"Invalid URL",
"stack":"NodeApiError: Invalid URL\n    
at Object.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1186:15)\n    
at Object.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2070:20)\n    
at RoutingNode.rawRoutingRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:336:29)\n    
at RoutingNode.makeRoutingRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:422:28)\n    
at async Promise.allSettled (index 0)\n    
at RoutingNode.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:157:35)\n    
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:773:23)\n    
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:51\n    
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1141:20"},
"workflowId":"ECJyYRFDmaP1VPKW","file":"LoggerProxy.js","function":"exports.debug"}

Expected behavior

The SerpAPI node returns a valid search result

Operating System

Docker 19.03.15 on Debian GNU/Linux 9.13 (stretch)

n8n Version

1.63.4

Node.js Version

v20.18.0

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 3 hours ago

Hey @smxsm,

We have created an internal ticket to look into this which we will be tracking as "GHC-339"