Web app working in an EC2 instance but not in another

0

I have built a Python web app that accepts requests through GatewayAPI and sieves them via Lambda functions and SQS. The app also uses Redis and is deployed using an EC2 instance connected to Lambda functions via Load Balancers and Target Groups. Currently, the app is working perfectly as expected. However, when I deploy the same app into a different EC2 instance with the same specs and connect them to the same Lambda functions via different instances Load Balancer and Target Group, it fails to work properly despite having received the correct requests. The two EC2 instances use the same Redis server although with a different key. I have debugged every line of my code and still can't seem to find what or where the bug is. I am almost sure that I am doing something wrong on the AWS end. Could anyone help with where things might have gone wrong?

1 個回答
0

Hi - I would recommend to do the following and find what is happening at each layer based on how you have set up your logs.

  1. Look into your application logs and resources logs. Some of these logs may be your custom logs and some of them would be in cloudwatch
  2. For your lambda functions you can check cloudwatch logs for the same. Reference : https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html
  3. If you are using API gateway then you can also look into cloudwatch logs Reference : https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-cloudwatch-logs/
  4. You can also access logs for your Application Load Balancer. Reference : https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html

Essentially look at the logs should provide where the issue is happening like any network timeout, data error, internal error, system exception etc.

profile pictureAWS
專家
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南