Can't see logs of Lambda@Edge
See original GitHub issueDescribe the bug
I am trying to create a prototype using this package. My serverless.yml
looks like this
todosDB:
component: '@serverless/aws-dynamodb'
inputs:
name: todos
attributeDefinitions:
- AttributeName: id
AttributeType: S
keySchema:
- AttributeName: id
KeyType: HASH
region: us-east-1
dcrestiniMe:
component: "@sls-next/serverless-component@1.19"
inputs:
build:
env:
DATABASE_URL: ${todosDB.name}
runtime:
defaultLambda: "nodejs14.x"
apiLambda: "nodejs14.x"
imageLambda: "nodejs14.x"
region: us-east-1
When I deploy, everything seems fine and I can access the default route which renders absolutely fine. The DynamoDB is also created with no problem. In my app though, I have implemented a small todos API, which has 2 routes, a GET /api/todos
and a POST api/todos/new
, as well as a page /todos
which fetches the todos (I call the function rather than using the REST endpoint) and renders them. My problem is that this function is not working, as I get back 503. When I go onto AWS Lambda, I can see the 3 lambdas being deployed and udpated but when I look at the logs to understand what’s wrong, it looks as if none of those Lambda are invoked. I can not understand why no logs are appearing would anyone be able to help?
Actual behavior
No logs are found in Cludwatch
Expected behavior
I would expect to see some logs that could help debug wha’ts going on
Steps to reproduce
Screenshots/Code/Logs
Versions
- OS/Environment: Mac OS Sierra (although this issue happen on the Lambda, not my laptop)
- @sls-next/serverless-component version: tested with
1.19.0
and1.20.0-alpha.6
- Next.js version: 10.2.0
Additional context
I have a checked in every single region of AWS and I have not been able to find logs anywhere. In the Dashboard of Lambda I can see that something is being invoked, but when I use “go to logs” nothing shows up
Checklist
- You have reviewed the README and FAQs, which answers several common questions.
- Please first try using the most recent
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
The logs should be in same region from where you accessed the endpoint, since it is Lambda@Edge it is replicated to multiple CloudFront regions. Also ensure sure you are checking right function (there could be 3 for Lambda@Edge: one for API, default and image lambda). For example, I am in Seattle area, even though the Lambda would show as in us-east-1, but the Lambda@Edge logs would actually be in CloudWatch in the us-west-2 region (Oregon) since that’s closest to me.
Closing old issue - hopefully you were able to find the logs