question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

500 error on running serverless invoke local

See original GitHub issue

When running

$ serverless invoke local --function create --path mocks/create-event.json from https://serverless-stack.com/chapters/add-a-create-note-api.html

I get

{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

I added a log and get: { UnrecognizedClientException: The security token included in the request is invalid.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mmjosedanielcommented, Jul 7, 2020

I had this error. It was because I forgot to create the table in DynamoDB

1reaction
iamsaurabhccommented, Jan 7, 2019

Yup , get same error:

   [7] external "babel-runtime/core-js/json/stringify" 42 bytes {0} [not cacheable]
{ UnrecognizedClientException: The security token included in the request is invalid.
provider:
  name: aws
  runtime: nodejs6.10
  stage: prod
  region: eu-west-2
  profile: personal

and in ~/.aws/credentials:

[personal]
aws_access_key_id

for some reasons image uploads dont work

Found the following steps to be the solution to the exact problem -

  1. Remove the current aws config and credentials by : sudo rm ~/.aws/config and sudo rm ~/.aws/credentials
  2. Recreate an access key for the User, from the IAM Console
  3. Reconfigure your AWS CLI with aws configure and make sure you put the correct region

Worked for me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Lambda 502 and 500 errors - AWS
First, identify the specific Lambda Invoke API error that you receive. Then, follow the troubleshooting steps listed for that error.
Read more >
Serverless invoke test returns status 500 when using Vandium
Serverless invoke test returns status 500 when using Vandium: Expected event type of apigateway but identified as unknown ; endpoint = (event, ...
Read more >
Node8 Lambda function fails with "Internal Server Error" and ...
It runs perfectly on local ( npm run dev ) but when deployed, all I get is internal server error. The Cloudwatch logs...
Read more >
Why does my Serverless Function work locally but not when ...
One of the common reasons for different behavior across environments is whether or not your Serverless Functions depend on packages with native dependencies....
Read more >
Fix the Most Common API Gateway Request Errors - Dashbird
The next source for this error is inconsistent error mapping. Many of the errors we talked about here can become a 500 error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found