Application -> Cloudfront 500 error

0

We have an application report called https://www.open.edu/openlearncreate/report/ocwcourseactivity/index.php?course=6954, a custom report within a Moodle application, which is served by CloudFront.

It is a staff facing report that can only be accessed by logging in. Once logged in, it is currently throwing a 500 error on our live system, but not on any of our dev or staging platforms. We tried to investigate the error by turning off the 500 error page rule redirect in our CloudFront distro (we only have one for this account). What resulted was surprising.

The http repsonse returned the report in the code as if the application successfully hadnled the request, whereas, observing the dev tools the actual response itself returned a status of 500. I then investigated both the apache logs and saw that the response from appache was a 200 ok response. When I investigated the CloudFront access logs, I could see that the response was 500.

Therefore, what seemed like an application error on the face of it, now seemed to be an error resulting from a service in between the application and the CloudFront. Could this be the ALB, the container, or Cloudfront itself. The CloudFront logs say it is an originerror. The origin for this particular report would be either... /openlearncreate/report//.php SlowRequestsOLC OR /openlearncreate* olclive-internal.open.edu Both of these origins point to our internal load balancer.

Please can you assist us to find out where the issue may be occuring? If we want to try to troubleshoot this by making a call to obviate CloudFront, is there a recommened way to do this?

DamianH
asked 7 months ago732 views
1 Answer
0

If CloudFront logs are indicating an origin error, it means that when CloudFront is requesting an object from your origin, the origin is returning an 500 status code i.e. there's a problem with communication between CloudFront and your origin.

In this scenario, you can check the access logs of the ALB for the requested path '/openlearncreate/report/ocwcourseactivity/index.php?course=6954'. If the access logs are not enabled on the ALB yet, please refer to the following documentation to enable the same: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html

Access logs contain detailed information about requests sent to your load balancer. Each log contains information such as the time the request was received, the client's IP address, latencies, request paths, and server/backend responses. You can use these access logs to analyze 500 errors. It will help you to conclude whether the requests are originating from the ALB or the target container.

Additionally, I would also request you to reach out to the AWS support team via Support console with CloudFront distribution domain name and request ID and we will investigate the same in detail.

Hope the information provided above is helpful. Have a great day ahead.

AWS
SUPPORT ENGINEER
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions