I created a custom bootstrap action for my Amazon EMR cluster. The cluster fails to launch, and the bootstrap action returns an error similar to the following:

bootstrap action 1 returned a non-zero return code

Bootstrap actions run after Amazon EMR provisions the Amazon Elastic Compute Cloud (Amazon EC2) instances in the cluster. For more information, see Understanding the Cluster Lifecycle.

When a bootstrap action fails, the instance is terminated. If a bootstrap action fails because of an error in the bootstrap script, the cluster can't launch. For more information, see Bootstrap Action Basics.

To determine why a bootstrap action failed, review the stderr logs for your bootstrap action. This log is located in an Amazon Simple Storage Service (Amazon S3) path similar to the following:


If you can't determine why the script failed after reviewing the stderr logs, modify your script to provide additional debug information. For example, set the bash shell parameters -ex in a bash script. This will allow you to view the bash script flow in your bootstrap action log files.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-05-20

Updated: 2018-10-24