Courseiva
Question 167 of 724
DeploymentmediumMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A company uses AWS Elastic Beanstalk to deploy a Python web application. After a successful deployment, the environment's health turns 'Severe' and the application returns HTTP 502 errors. What is the most likely cause?

⚠ Common exam trap

Test-takers frequently confuse HTTP 502 with 503 or 504, or assume that a missing dependency would cause a deployment failure rather than a runtime error that still allows the environment to be created but with a broken application.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The application's requirements.txt file is missing a required dependency.

A missing dependency in requirements.txt causes the Python application to fail during startup, leading to the EC2 instances reporting an unhealthy status to the Elastic Load Balancer. Elastic Beanstalk relies on the application process to respond to health checks; if the app crashes due to an ImportError, the load balancer receives no valid HTTP response and returns 502 Bad Gateway errors. The environment health turns 'Severe' because the platform detects that the application process is not running or is failing repeatedly.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The EC2 instances have insufficient storage for the deployment.

    Why it's wrong here

    If EC2 instances have insufficient storage during deployment, the Elastic Beanstalk agent or deployment process would fail to write application files, logs, or dependencies to disk. This typically results in deployment failures, rollback events, or specific disk space errors visible in instance logs, rather than the application failing to start and the proxy returning a 502 Bad Gateway. A 502 error usually indicates a problem with the application server not responding to the proxy.

  • The application's requirements.txt file is missing a required dependency.

    Why this is correct

    When a Python application deployed on Elastic Beanstalk has a missing dependency in its `requirements.txt` file, the application server (e.g., Gunicorn, uWSGI) will fail to start correctly or crash immediately upon startup. The proxy server (e.g., Nginx, Apache) on the EC2 instance will then be unable to establish a connection or forward requests to the unresponsive application server. This common scenario directly leads to a 502 Bad Gateway error, as the proxy cannot communicate with the upstream application process.

  • The load balancer's health check path is incorrectly configured.

    Why it's wrong here

    An incorrectly configured load balancer health check path would cause the load balancer to repeatedly fail its health checks against the EC2 instance. Consequently, the load balancer would mark the instance as unhealthy and stop routing traffic to it, potentially leading to a degraded environment or instances being terminated and replaced. However, this configuration issue itself would not directly cause a 502 Bad Gateway error from the application server; rather, it would prevent traffic from reaching the instance in the first place, or cause the instance to be removed from service.

  • The RDS database connection string is incorrect.

    Why it's wrong here

    If the RDS database connection string is incorrect, the Python web application would typically start successfully but encounter errors when attempting to interact with the database. These errors would manifest as application-level exceptions (e.g., 500 Internal Server Error) within the application's logic, or specific error messages displayed to the user, rather than a 502 Bad Gateway. A 502 indicates that the web server (proxy) cannot communicate with the application server, not an issue within the application's business logic after it has successfully started.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.