aws-samples / aws-samples/aws-lambda-edge-workshops

ws-lambda-at-edge-generate-card-page causing 500

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
110
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Hi,

I was trying followup this tutorial, but I'm failing at https://github.com/aws-samples/aws-lambda-edge-workshops/tree/master/Workshop1/Lab2_ContentGeneration#12-validate-the-function-works-in-lambda-console

The test returns 500 error with following message:

```
Response:
{
"status": "500",
"headers": {
"content-type": [
{
"value": "application/json"
}
],
"strict-transport-security": [
{
"value": "max-age=31536000; includeSubDomains"
}
],
"content-security-policy": [
{
"value": "default-src 'self'"
}
],
"x-xss-protection": [
{
"value": "1; mode=block"
}
],
"x-content-type-options": [
{
"value": "nosniff"
}
],
"x-frame-options": [
{
"value": "DENY"
}
]
},
"body": "{\n \"code\": \"ENOTFOUND\",\n \"errno\": \"ENOTFOUND\",\n \"syscall\": \"getaddrinfo\",\n \"hostname\": \"https://d32at75m0fmpm0.cloudfront.net\",\n \"host\": \"https://d32at75m0fmpm0.cloudfront.net\",\n \"port\": 443\n}"
}

Request ID:
"d6a29760-6816-46d5-a1f6-0a06314b3893"

Function Logs:
START RequestId: d6a29760-6816-46d5-a1f6-0a06314b3893 Version: $LATEST
2019-01-11T16:04:06.342Z d6a29760-6816-46d5-a1f6-0a06314b3893 Event: {
"Records": [
{
"cf": {
"config": {
"distributionDomainName": "https://d32at75m0fmpm0.cloudfront.net",
"distributionId": "E123EXAMPLE2",
"eventType": "origin-request"
},
"request": {
"clientIp": "2620:101:8030:74:9f2b:d246:c6e1:1d6a",
"headers": {
"user-agent": [
{
"key": "User-Agent",
"value": "Amazon CloudFront"
}
],
"host": [
{
"key": "Host",
"value": "alien-cards-be0359c0.s3.us-east-1.amazonaws.com"
}
]
},
"method": "GET",
"uri": "/card/da8398f4",
"querystring": ""
}
}
}
]
}
2019-01-11T16:04:06.380Z d6a29760-6816-46d5-a1f6-0a06314b3893 DynamoDB get params: {
"TableName": "AlienCards-7010b760",
"Key": {
"CardId": "da8398f4"
}
}
2019-01-11T16:04:06.402Z d6a29760-6816-46d5-a1f6-0a06314b3893 Couldn't fetch https://d32at75m0fmpm0.cloudfront.net/templates/card.html : getaddrinfo ENOTFOUND https://d32at75m0fmpm0.cloudfront.net https://d32at75m0fmpm0.cloudfront.net:443
2019-01-11T16:04:06.419Z d6a29760-6816-46d5-a1f6-0a06314b3893 response: {"status":"500","headers":{"content-type":[{"value":"application/json"}],"strict-transport-security":[{"value":"max-age=31536000; includeSubDomains"}],"content-security-policy":[{"value":"default-src 'self'"}],"x-xss-protection":[{"value":"1; mode=block"}],"x-content-type-options":[{"value":"nosniff"}],"x-frame-options":[{"value":"DENY"}]},"body":"{\n \"code\": \"ENOTFOUND\",\n \"errno\": \"ENOTFOUND\",\n \"syscall\": \"getaddrinfo\",\n \"hostname\": \"https://d32at75m0fmpm0.cloudfront.net\",\n \"host\": \"https://d32at75m0fmpm0.cloudfront.net\",\n \"port\": 443\n}"}
END RequestId: d6a29760-6816-46d5-a1f6-0a06314b3893
REPORT RequestId: d6a29760-6816-46d5-a1f6-0a06314b3893 Duration: 132.38 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 34 MB
```

When I'm opening https://d32at75m0fmpm0.cloudfront.net/templates/card.html in my browser, it returns the template, so I'm not sure what it is wrong.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.