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.

error from cloudfront | miss from cloudfront

See original GitHub issue

Description

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
hutualivecommented, Jul 31, 2017

@pmuens @horike37 thanks for your help and the latest version works👍 🥇

0reactions
AlastairTaftcommented, Aug 9, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot issues with CloudFront custom object caching
If the X-Cache header is "Miss from cloudfront," then the request was retrieved from the origin and wasn't served by the cache. Review...
Read more >
How to fix X-cache: Miss from Cloudfront | InfinityPP
Fixing Cloudfront miss can be a time-consuming task. But, if you are receiving “Miss from Cloudfront” this is usually because of the headers...
Read more >
Troubleshooting error "X-Cache: Miss from CloudFront"
Once the object is requested through CloudFront, it is cached in the edge location that got the request. In case another request is...
Read more >
How to solve "x-cache: Error from cloudfront" on SPA
From your console logs, it suggests distribution instance is trying to access a forbidden element, page or resource and hence the 403 status ......
Read more >
Lightsail CloudFront distribution returning an “X-Cache:Miss ...
If the X-Cache header is "Miss from cloudfront," then the request was retrieved from the origin and wasn't served by the cache. Review...
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