API calls return `{status: false}` (Error 500) on deploy step
See original GitHub issueFollowing 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:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.ymlCan 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’.