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.

API calls return `{status: false}` (Error 500) on deploy step

See original GitHub issue

Following guide, on this step: http://serverless-stack.com/chapters/deploy-the-apis.html

Running this piece returns tokens just fine

aws cognito-idp admin-initiate-auth \
  --region us-east-1 \
  --user-pool-id $MY_COGNITO_USER_POOL_ID \
  --client-id $MY_COGNITO_APP_CLIENT_ID \
  --auth-flow ADMIN_NO_SRP_AUTH \
  --auth-parameters USERNAME=admin@example.com,PASSWORD=Passw0rd!

I take the value of idToken returned and put into the example call from the same page of the guide, replacing my values as necessary. Looks similar to:

curl https://<my-app-id>.execute-api.us-west-2.amazonaws.com/prod/notes/ \
  -H "Authorization: <my-identity-token>" \
  -d "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}

But I get back a 500 error with the body of {success: false}

Tests run from CLI using event.json worked fine.

How could I debug this? Typically I would toss a console.log around here: https://github.com/AnomalyInnovations/serverless-stack-demo-api/blob/master/get.js#L27

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
abagasra98commented, Apr 4, 2017

I was having the same issue. Mine was due to a region mismatch since my DynamoDB table was created in us-west-2 while the lambda function was set-up for us-east-1.

Specifically, insert the region where your DyanmoDB table is created in the following line Resource: "arn:aws:dynamodb:DYNAMO_DB_REGION_HERE:*:*" in serverless.yml

1reaction
fwangcommented, Mar 19, 2017

Can you double check in your DynamoDB console and ensure the key names for ‘notes’ table are ‘userId’ and ‘noteId’. Both key names are in camel case with capital ‘I’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

500 Internal Server Error - Backend Server | Apigee Edge
The client application gets an HTTP status code of 500 with the message Internal Server Error as a response for API calls.
Read more >
Troubleshoot "internal server" error status code 500 for API ...
I sent an HTTP request to my Amazon API Gateway API endpoint that integrates with AWS Lambda (for example, /lambda-resource GET).
Read more >
The API is throwing wrong response code 500 internal error ...
A 500 indicates the service crashed. You need to determine where the service crashed. Turning on diagnostic logging to review the stack trace ......
Read more >
How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 Internal Server Error status code occurs when the server encounters an error that prevents it from fulfilling the request.
Read more >
Fixing a 500 internal server error response - Postman
Make sure there is no error in the configuration of your request. Look for typos, whitespaces, or invalid JSON formatting. Compare the API ......
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