'Solving "bootstrap action 1 returned a non-zero return code" errors when creating EMR cluster

Trying to set up EMR cluster on AWS either with console or CLI but by specifying a bootstrap-action file located in s3://ocp8/emr_bootstrap.sh. When I try with the console, I get the following error : "bootstrap action 1 returned a non-zero return code" errors when creating EMR cluster".

Here is the shell script, taken from aws website :

#!/bin/bash

sudo python3 -m pip install boto3 paramiko nltk scipy scikit-learn pandas

The aws CLI query is :

aws emr create-cluster --name test-emr-cluster5 --release-label emr-5.28.0 \ 
--instance-count 3 --instance-type m5.xlarge --applications \
Name=JupyterHub Name=Spark Name=Hadoop --ec2-attributes \
SubnetIds=subnet-04df75983a93c5bec,KeyName=Zephyrus --bootstrap-actions \
 Path="s3://ocp8/emr_bootstrap.sh" --region eu-west-3

I've double checked the regions of the s3 bucket and the emr (eu-west-3).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source