HTTP Requests throws “Cannot read properties of undefined (reading ‘name’)”

The idea is:

Improve the context of the error causing the problem.

My use case:

As a new user, I had things up and running until hitting this issue and the detail really didn’t help me figure out what was going on.

The error/stack trace was this:

{
  "errorMessage": "Cannot read properties of undefined (reading 'name')",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.76.1 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading 'name')",
      "    at FormData._getContentDisposition (/usr/local/lib/node_modules/n8n/node_modules/form-data/lib/form_data.js:227:40)",
      "    at FormData._multiPartHeader (/usr/local/lib/node_modules/n8n/node_modules/form-data/lib/form_data.js:178:33)",
      "    at FormData.append (/usr/local/lib/node_modules/n8n/node_modules/form-data/lib/form_data.js:71:21)",
      "    at prepareRequestBody (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/GenericFunctions.js:209:22)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:199:95)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:632:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:890:51",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1224:20"
    ]
  }
}

This came out in a workflow that was IMAP → Code → HTTP Post

It turned out the above error was for the 2nd item out of 3 items which had a null value for one of the fields to be posted.

Suggestions/Ideas

  • Indicate the error happened on item 2 out of 3
  • Indicate the error happened when trying to “read this field”

I think it would be beneficial to add this because:

  • Less confusion for users
  • Possibly reduction in question posts about similar errors and incorrect workarounds (using a set node did fix the issue, but it painted over the problem)

Are you willing to work on this?

Possibly

please I have the same error , I put all required fields for an api call but stay give me this error