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
エキスパート
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン