You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, firstly, thank you for the wonderful library!
We encountered a problem when initializing ssm in the case when the ExecutionRole is not available for the user-profile, but only for the domain.
The sm-ssh-ide script, fails due to the use of grep within a pipeline combined with set -o pipefail.
The grep command can exit with code 1 if "ExecutionRole" is not found, triggering the pipefail behavior and causing the script to terminate.
Steps to Reproduce:
Run the script in an environment where "ExecutionRole" is not present in the user_profile_json.
Observe that the script fails due to grep exiting with code 1.
Suggested Solution:
Temporarily disable pipefail and re-enable after the condition is processed.
set +o pipefail
# execution_role extractionset -o pipefail
Add || true;
execution_role=$(echo "$user_profile_json"| {grep "ExecutionRole"||true;} \| sed -e 's/^.*"ExecutionRole": \"\([^"]*\)\".*$/\1/')# ...
execution_role=$(echo "$domain_json"| {grep "ExecutionRole"||true;} \| sed -e 's/^.*"ExecutionRole": \"\([^"]*\)\".*$/\1/')
The text was updated successfully, but these errors were encountered:
Hi, @hidemire , thank you for pointing to this bug and to the solutions! I've applied the second solution to the main branch and it will appear in the next release.
Hello, firstly, thank you for the wonderful library!
We encountered a problem when initializing ssm in the case when the ExecutionRole is not available for the user-profile, but only for the domain.
The
sm-ssh-ide
script, fails due to the use of grep within a pipeline combined withset -o pipefail
.The grep command can exit with code 1 if "ExecutionRole" is not found, triggering the pipefail behavior and causing the script to terminate.
Steps to Reproduce:
Suggested Solution:
pipefail
and re-enable after the condition is processed.|| true;
The text was updated successfully, but these errors were encountered: