Send Email node gets "Internal error"

Describe the problem/error/question

I’m getting random “Internal error” responses from the Send Email node, for no apparent reason.

There’s some talk online about it being an app passwords issue, but some emails are being sent correctly while others error — all using the same email credentials.

I’ve seen this error with Google Workspace, Outlook, and SMTP.com so I don’t think it’s an SMTP server-specific issue.

Should I try enabling “Ignore SSL issues” or that’s unrelated?

What is the error message (if any)?

“Internal error”

Please share your workflow

Share the output returned by the last node

[
{
“data”: [redacted],
“error”: “Internal error”
}
]

Information on your n8n setup

  • n8n version: 1.47.3
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: MacOS

Hey @fundmore,

Is there a stack trace in the error at all that you can share? I suspect the issue is related to the connection settings but hopefully the trace show more.

Hi Jon, thanks for your input.

I’m not seeing a stack trace in the error (which is odd in itself).

By connection, do you mean credentials?

The thing is I doubt 3 different email providers would use the same exact error message, which makes me think it’s a frontend thing.

But I’m not an expert of course.

Hey @fundmore,

Can you turn off the error branch so you get the big error and that should have more information. We have a fix coming out in the next release which should reduce the number of the internal error messages.

I don’t think it is a front end issue based on it being “internal error” so I think it could just be mail provider settings which normally causes an issue.

I won’t be able to reproduce the error because the email account is not mine.

If I copy the errored execution to editor, and delete the error branch, will it show the big error?

And do I need to edit these settings:

Hey @fundmore,

You would need to set that to Stop Workflow then test the node but if you are not able to reproduce it we won’t be able to see the actual error.

Alright. I haven’t seen it so much recently anyway. When is the fix coming out to reduce the number of internal error messages?

Hi @Jon, this is kind of related. I’ve been trying out the Microsoft Graph API to send emails instead of SMTP.

When I test the workflow, an email is going out correctly, but the http request node (to send the previously created draft email) is getting this error:

{
  "errorMessage": "Internal error",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.47.3 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading 'error')",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:699:64",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1076:20"
    ]
  }
}

To confirm, this error comes from n8n and not the http response?

Hey @fundmore,

Yeah so that is us hiding the error, If you update to 1.51.0 it should be clearer now.

Thanks @Jon. I just updated to 1.51.0 beta.

Now I’m getting a different error:

{
  "errorMessage": "No data found for item-index: \"1\"",
  "errorDetails": {},
  "n8nDetails": {
    "itemIndex": 1,
    "runIndex": 0,
    "parameter": "url",
    "time": "7/19/2024, 8:40:58 AM",
    "n8nVersion": "1.51.0 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "ExpressionError: No data found for item-index: \"1\"",
      "    at Object.get (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:307:31)",
      "    at Proxy.eval (eval at getFunction (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:24:22), <anonymous>:7:77)",
      "    at Proxy.eval (eval at getFunction (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:24:22), <anonymous>:14:3)",
      "    at Tournament.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:33:19)",
      "    at evaluateExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/ExpressionEvaluatorProxy.js:110:16)",
      "    at Expression.renderExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:228:70)",
      "    at Expression.resolveSimpleParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:206:34)",
      "    at Expression.getParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:290:25)",
      "    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1636:42)",
      "    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2354:24)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js:612:30)",
      "    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:728:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1085:20"
    ]
  }
}

Does this mean no items were returned? Here’s the http request node that I’m using to send a draft email:

Hey @fundmore,

That is a lot better so that error means the second item in your input doesn’t have the field you are trying to use.

Thank you @Jon. That’s weird because I see both references show as green, and their values look correct. Plus the email went out so I don’t think the URL or access token could’ve been empty.

Hey @fundmore,

The referecnes will only show the first input item, In this case for some reason the node is running more than once and the second run can’t find the data from the node you are calling.

At a guess the aggregate node has more than one output.

Hi @Jon, I know it’s been a while but I decided to continue working on this workflow and now I’m getting the same hidden error as before.

For context, I’m iterating over a list of funders ie. recipients. For each funder, I want to:

  • create a draft email via Microsoft Graph API
  • send an array of file URLs to a sub-workflow which adds them as attachments to the draft
  • send the previously created draft email

In this test run (screenshot attached), there were 3 funders and 5 files, which is why it says 15 items.

The UI shows “Internal error” (and “Retry On Fail” will run if enabled), but the email goes out correctly and the workflow follows the Success branch.

I’m now on version 1.57.0 self hosted. Thank you for your help.

{
  "errorMessage": "Internal error",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.57.0 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading 'error')",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:709:64",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1104:20"
    ]
  }
}

I set the HTTP Request node to Stop Workflow and found the actual error:

“Forbidden - perhaps check your credentials? [item 0]”

But the email still goes out correctly.

I’m going to reach out to Microsoft about this.

{
  "errorMessage": "Forbidden - perhaps check your credentials? [item 0]",
  "errorDetails": {
    "rawErrorMessage": [
      "403 - {\"error\":{\"code\":\"ErrorAccessDenied\",\"message\":\"Access is denied. Check credentials and try again., Cannot submit message.\"}}"
    ],
    "httpCode": "403"
  },
  "n8nDetails": {
    "nodeName": "microsoft_send_email",
    "nodeType": "n8n-nodes-base.httpRequest",
    "nodeVersion": 1,
    "itemIndex": 0,
    "time": "9/10/2024, 9:44:07 AM",
    "n8nVersion": "1.57.0 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "NodeApiError: Forbidden - perhaps check your credentials?",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V1/HttpRequestV1.node.js:855: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:728:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1104:20"
    ]
  }
}

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