Handle EHOSTUNREACH errors

Describe the problem/error/question

I am working on a workflow where I have a list of IP to contact (30). I perform GET request with HTTP node to each IP. Some IPs are not responding because the device is off (not powered) and this is totally normal. I just want to ignore the errors and get the responding devices.

Example: If on 30 devices, 7 are not responding, the returned object is of size 23.

Is there a way to handle EHOSTUNREACH errors?
Is there a way to ping IPs before performing the requests?

What is the error message (if any)?

ERROR: The host is unreachable, perhaps the server is offline

NodeApiError: The host is unreachable, perhaps the server is offline
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1547:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:696:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53

Share the output returned by the last node

No, sensitive data

Information on your n8n setup

  • n8n version: 1.22.4
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via Docker: n8nio/n8n:latest
  • Operating system: Windows

I believe this was solved on Discord, @LucBerge can you share the solution for this?

Yes. In the node parameters, change the “On Error” strategy.

1 Like

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