AWS Certified Solutions Architect - Associate Exam: Troubleshooting AWS Batch Job Stuck in Runnable State

Troubleshooting AWS Batch Job Stuck in Runnable State

Prev Question Next Question

Question

You have been hired as an AWS Architect in a global financial firm.

They provide daily consolidated reports to their clients for trades in stock markets.

For a large amount of data processing, they store daily trading transaction data in S3 buckets, which triggers the AWS Lambda function.

This function submits a new AWS Batch job in the Job queue.

These queues use EC2 compute resources with this customized AMI and Amazon ECS to complete the job.

You have been working on an application created using the above requirements.

While performing a trial for the application, even though it has enough memory/CPU resources, the job is stuck in a Runnable state.

Which of the following checks would help to resolve the issue?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - A.

If your compute environment contains compute resources, but your jobs don't progress beyond the

RUNNABLE.

status, then there is something preventing the jobs from actually being placed on a compute resource.

Here are some common causes for this issue:

The

awslogs.

log driver isn't configured on your compute resources.

Insufficient resources.

No internet access for compute resources.

Amazon EC2 instance limit reached.

Option A is correct as this is one of the reasons which is preventing the jobs from actually being placed on a compute resource.

Option B is incorrect as AWS Batch supports both customized AMI and Amazon ECS-optimized AMI.

This is not a reason for Job being stuck in the Runnable state.

Option C is incorrect as a Job moves into a Runnable state only after all dependencies are processed.

If there are any dependencies, Job stays in the Pending state, not the Runnable state.

Option D is incorrect as Compute resource can be an On-Demand Instance or a Spot Instance.

In the question, it is given that the application has enough memory/CPU resources, so this is not a reason for Job being stuck in the Runnable state.

For more information on AWS Batch Job state & troubleshooting, if a job is stuck in Runnable state, refer to the following URLs-

https://docs.aws.amazon.com/batch/latest/userguide/job_states.html https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable

The issue that the AWS Architect is facing is that the job submitted to the AWS Batch queue is stuck in a "Runnable" state. This means that the job has been assigned to an EC2 instance, but the instance is unable to start the job.

To resolve this issue, the following checks can be performed:

A. Ensure that AWS logs driver is configured on compute resources: This check is related to logging. AWS logs driver is a tool that can be used to send logs generated by Docker containers running on Amazon ECS or AWS Fargate to AWS services such as Amazon CloudWatch Logs. While it is important to have logs enabled for troubleshooting, this is unlikely to resolve the issue of the job being stuck in a "Runnable" state.

B. AWS Batch does not support customized AMI, use ECS-optimized AMI: This check is related to the use of customized AMI for EC2 instances. It is important to note that AWS Batch supports the use of customized AMI. However, it is recommended to use the ECS-optimized AMI as it has been pre-configured with the necessary components for running Amazon ECS tasks. While this check may improve the performance of the job, it is unlikely to resolve the issue of the job being stuck in a "Runnable" state.

C. Check dependencies for the job which holds the job in Runnable state: This check is related to the dependencies of the job. It is possible that the job is waiting for a resource or service that is not available. This check involves reviewing the dependencies of the job and verifying that all required resources and services are available. This check is likely to identify the root cause of the issue and help in resolving it.

D. Use only On-Demand EC2 instance in compute resources: This check is related to the use of On-Demand EC2 instances for running the job. On-Demand instances are instances that are launched as needed and are billed by the hour. While it is important to use the appropriate EC2 instance type based on the workload requirements, it is unlikely that using On-Demand instances would resolve the issue of the job being stuck in a "Runnable" state.

In conclusion, the check that is most likely to help in resolving the issue of the job being stuck in a "Runnable" state is to review the dependencies of the job and verify that all required resources and services are available.