Problem with dynamic HTTP Request urls

Hello,

I believe I’m having a bug while trying to perform a GET Request to an URL. I’ve tried 2 different APIs so I can confirm that the problem is on the n8n side. Also using Curl I’m able to access the results.

What I’m trying to do is to contact an API and send a value through the URL, and this value is dynamic.

I have a node that is going to pull several CVEs from ELK, and then I want to query the nvd to get the details of the vulnerability, for the specific CVE.

In this case the url is the following “https://services.nvd.nist.gov/rest/json/cve/1.0/{{$json[“cve”]}}”

If I remove the variable cve, and use the plaintext url (https://services.nvd.nist.gov/rest/json/cve/1.0/CVE-2022-23271) I’m able to access the JSON I want.

Do you guys know any work around?

The Error:

HTTP Code
rejected
Cause
Data below may contain sensitive information. Proceed with caution when sharing.

{
"status": "rejected",
"reason": {
"message": "404 - {"message":"Unable to find vuln CVE-2022-0609"}",
"name": "Error",
"stack": "Error: Request failed with status code 404 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)"
}
}

Stack:

NodeApiError: UNKNOWN ERROR - check the detailed error for more information
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/HttpRequest.node.js:885:27)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:447:47

Kind regards,
Rob

Information on your n8n setup

  • n8n version:
  • Database you’re using: SQLite
  • Running n8n with the execution process: own
  • Running n8n via: Docker

Worked after updating Docker Container to its latest version.

Hey @robjennings,

That is handy, I just gave it a test and the error you had with CVE-2022-0609 not existing is the same you get when you try that URL as well (https://services.nvd.nist.gov/rest/json/cve/1.0/CVE-2022-0609)

I suspect in this case the issue wasn’t with the version of n8n or the dynamic nature of the requst as such but more that the CVE being searched for isn’t in the NIST DB yet, In this case CVE-2022-0609 is reserved and NIST doesn’t show reserved CVEs but you can find them on the MITRE website.

It may be worth doing a continue on fail then check the message to see if it is Unable to find it.