AWS Lambda - Missing Authentication Token

Describe the problem/error/question

I was trying to use the AWS Lambda node but I am getting the following error messages:

Forbidden - perhaps check your credentials?
{“message”:“Missing Authentication Token”}

This turned out to be a misleading error as I spent ages trying to reconfigure my permissions but it turned out there was an issue with my JSON input (similar to what Jamaal found here I’ve checked my AWS credentials and there is no issue, does anyone have any suggestions?.

After spending more than a day going down the wrong rabbit hole, I wanted share this feedback so in case it was possible to improve the error messages to make them more accurate. Also I think it would be helpful to update your the instructions in n8n’s docs for setting up AWS Credentials to include the invokeFunction permissions that need to be appleed as Resource-based policy statements.

Lastly, I ultimately fixed this by applying the JSON.stringify() to my JSON input, without which it was including the Object notation (e.g. [Object: {…} instead of just {…}]. Given its an explicit JSON field, there ought to be scope to include this in the error testing for the node to help easier diagnosis (or automate the stringify conversion / provide a toggle button to do this).

What is the error message (if any)?

Here was the full error message I was receiving before
{
“errorMessage”: “Forbidden - perhaps check your credentials?”,
“errorDescription”: “{"message":"Missing Authentication Token"}”,
“errorDetails”: {
“rawErrorMessage”: [
“Forbidden - perhaps check your credentials?”
],
“httpCode”: “403”
},
“n8nDetails”: {
“nodeName”: “AWS Lambda”,
“nodeType”: “n8n-nodes-base.awsLambda”,
“nodeVersion”: 1,
“operation”: “invoke”,
“time”: “26/04/2024, 11:34:13”,
“n8nVersion”: “1.36.4 (Cloud)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“NodeApiError: Forbidden - perhaps check your credentials?”,
" at Object.awsApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/GenericFunctions.js:23:15)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at Object.awsApiRequestREST (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/GenericFunctions.js:28:22)“,
" at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Aws/AwsLambda.node.js:156:38)”,
" 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:660:53”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1062:20"
]
}
}

Please share your workflow

Here’s what my Lambda node looks like in n8n:

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

see error message above

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