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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠