How do I resolve the "bootstrap action returned a non-zero return code" error when my Amazon EMR cluster fails to launch?

1 minute read
0

I want to resolve the "bootstrap action returned a non-zero return code" error when my Amazon EMR cluster fails to launch.

Short description

After Amazon EMR provisions Amazon Elastic Compute Cloud (Amazon EC2) cluster instances, Amazon EMR runs bootstrap actions on the instances. If a bootstrap action returns a non-zero error code, then Amazon EMR terminates the affected instances. If too many instances fail the bootstrap actions, then Amazon EMR deletes the cluster.

Resolution

To identify the cause of the error, check the stderr logs. If the stderr logs don't identify the issue, then modify your script with debugging information. For example, to trace the script's flow within the bootstrap action log files, set the -ex parameters in your Bash script:

#!/bin/bash
set -x -e

If the bootstrap action failed, then check the logs that are stored in the LogUri that you specified when you created the cluster, for example s3://example-log-location/example-cluster-id/node/example-instance-id/bootstrap-actions/.

Related information

Use custom bootstrap actions

Why did my Amazon EMR cluster terminate with an "application provisioning failed" error?

AWS OFFICIAL
AWS OFFICIALUpdated 7 months ago