Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs execute-command fails silently on Apple Silicon (M1) #7214

Closed
jfirebaugh opened this issue Aug 23, 2022 · 6 comments
Closed

ecs execute-command fails silently on Apple Silicon (M1) #7214

jfirebaugh opened this issue Aug 23, 2022 · 6 comments
Assignees
Labels
closed-for-staleness customization Issues related to CLI customizations (located in /awscli/customizations) ecs-execute-command p2 This is a standard priority issue session-manager-plugin

Comments

@jfirebaugh
Copy link

Describe the bug

session-manager-plugin does not supply an aarch64 build. Running it directly on Apple Silicon (without Rosetta 2 installed) produces the error "bad CPU type in executable: session-manager-plugin".

aws-cli catches and ignores OSErrors from executing session-manager-plugin other than ENOENT:

except OSError as ex:
if ex.errno == errno.ENOENT:
logger.debug('SessionManagerPlugin is not present',
exc_info=True)
raise ValueError(''.join(ERROR_MESSAGE))

The "bad CPU type" is an OSError, but not ENOENT. This means that on Apple Silicon aws ecs execute-command ... silently does nothing; it just drops you back to the shell with no indication of the underlying issue.

Expected Behavior

aws ecs execute-command ... should execute the command. Or, until aws/session-manager-plugin#26 is fixed, it should at least give you a hint of why it fails.

Current Behavior

aws ecs execute-command ... fails silently.

Reproduction Steps

Obtain an M1 Mac. Do not install Rosetta 2. Install session-manager-plugin, e.g. via brew install session-manager-plugin. Run some aws ecs execute-command ... command.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.7.23 Python/3.10.6 Darwin/21.6.0 source/arm64 prompt/off

Environment details (OS name and version, etc.)

macOS 12.5.1

@jfirebaugh jfirebaugh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2022
@tim-finnigan
Copy link
Contributor

Hi @jfirebaugh thanks for reaching out. Customizations are owned by service teams so I'll try reaching out to the Session Manager team to get their thoughts on this.

@tim-finnigan tim-finnigan added customization Issues related to CLI customizations (located in /awscli/customizations) session-manager-plugin ecs-execute-command and removed needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2022
@jonodrew
Copy link

Very keen to get a solution to this, and to know if there are any workarounds in the short term

@jfirebaugh
Copy link
Author

One workaround is to install Rosetta 2 (softwareupdate --install-rosetta --agree-to-license). I personally avoid doing that because I need to ensure that software I'm responsible for supporting runs natively on Apple Silicon, and installing Rosetta 2 would make it too easy for an Intel-only binary to slip through.

@tim-finnigan tim-finnigan added the p2 This is a standard priority issue label Nov 11, 2022
@alexisgaziello
Copy link

I am experiencing the same issue on an intel mac.

OSX 12.6.1 Macbook Pro 16' - 6-Core Intel Core i7

➜  Desktop aws --version
aws-cli/2.9.6 Python/3.9.11 Darwin/21.6.0 exe/x86_64 prompt/off
➜  Desktop aws ecs execute-command  --profile user1 --cluster 123 --task 123 --container web --command "/bin/bash" --interactive                                                                            
➜  Desktop 

As you can see, the IDs are wrong but nothing happens.

@thyming
Copy link

thyming commented Feb 8, 2023

This problem also affects Session Manager, e.g. with aws ssm start-session ...

@tim-finnigan
Copy link
Contributor

Version 1.2.463.0 of the session-manage-plugin includes support ARM64 for Apple Mac M1. I think this can now be closed.

@tim-finnigan tim-finnigan self-assigned this Nov 2, 2023
@tim-finnigan tim-finnigan added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed bug This issue is a bug. labels Nov 2, 2023
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 4, 2023
@github-actions github-actions bot closed this as completed Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness customization Issues related to CLI customizations (located in /awscli/customizations) ecs-execute-command p2 This is a standard priority issue session-manager-plugin
Projects
None yet
Development

No branches or pull requests

5 participants