error from cloudfront | miss from cloudfront
See original GitHub issueDescription
Hi, anyone has similiar issue ? I just deploy a simple service for a basic REST API, following a tutorial.
but when call it through CURL, it return errors
I have met similiar issue for many times following different tutorials. the only change is runtime from node4.3 to node6.10 and region from us-east-1 to ap-northeast-2.
–>
HTTP/1.1 502 Bad Gateway Connection: keep-alive Content-Length: 36 Content-Type: application/json Date: Sat, 29 Jul 2017 17:24:45 GMT Via: 1.1 73ca6a49ae80fd49bc58c66f9c46c2bf.cloudfront.net (CloudFront) X-Amz-Cf-Id: 5LHHMS0aOmcyEv78mJBF1J0gwC-u2zL5ltLmGBNwHyEr5yMdIr70Pw== X-Cache: Error from cloudfront x-amzn-RequestId: cf9d4393-7482-11e7-b27e-112c20856a3f
{ “message”: “Internal server error” }
after revised to a complicated handler, I can GET back data as expectation, but the console show info like “miss from cloudfront”, I think something still wrong, so I want to figure out the root cause.
–> HTTP/1.1 200 OK Connection: keep-alive Content-Length: 118 Content-Type: application/json Date: Sat, 29 Jul 2017 18:08:46 GMT Via: 1.1 9dbf78a08b69bf146288843838a8c0c0.cloudfront.net (CloudFront) X-Amz-Cf-Id: uOrzZA0isP3VnCG7OkFWIR_isMGKhPaSrkdVwpM_eSZvYFIUISw5SA== X-Amzn-Trace-Id: sampled=0;root=1-597ccf2c-f5d3be8c0e2fb4bb27af0995 X-Cache: Miss from cloudfront x-amzn-RequestId: f5ac3f7d-7488-11e7-bf1d-d71bfe61d90e
below the yml file and handler: –>
service: candidate-service
frameworkVersion: “>=1.1.0 <2.0.0”
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: ap-northeast-1
functions:
candidateSubmission:
handler: api/candidate.submit
memorySize: 128
description: Submit candidate information and starts interview process.
events:
- http:
path: candidates
method: post
–>
‘use strict’;
module.exports.submit = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: ‘Go Serverless v1.0! Your function executed successfully!’,
input: event,
}),
};
callback(null, response);
};
Additional Data
- Serverless Framework Version you’re using: 1.18.0
- Operating System: MacOS 10.12.5
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
@pmuens @horike37 thanks for your help and the latest version works👍 🥇
Experiencing the same with 1.27.2.
UPDATE: Was due to my function returning a body that was larger than 6mb which is more than the aws limit.