An Amazon EMR cluster configured with a custom bootstrap action fails to launch and returns an error message indicating that the bootstrap action returned a nonzero exit code.

Bootstrap actions are scripts that are run on the cluster nodes when Amazon EMR launches the cluster. They run before Amazon EMR installs specified applications and the node begins processing data. If any bootstrap action fails, the instance is considered 'failed' and is terminated. If this is due to an error in the bootstrap script, the cluster will not be able to launch.

To see why a bootstrap action failed, you can view the logs in the S3 log location for the cluster instance bootstrap actions. They will be at the path s3://<log-bucket>/<cluster-id>/node/<instance-id>/bootstrap-actions/. Here you can view the controller, stdout, and stderr logs for your script. The stderr logs for your script should indicate why the script returned a non-zero exit code. If not, you can modify your script to provide additional debug information. For example, you can set the bash shell parameters -ex in a bash script in order to view the bash script flow in your bootstrap action log files. In general, your script should handle the logic of returning the appropriate exit code based on the actions in your script.

bootstrap action, EMR, logs, nonzero, custom, exit code, bash


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