LoginSignup
2
0

More than 1 year has passed since last update.

Amazon ECS Execで"The execute command failed due to an internal error. Try again later."と言われた時の対応

Posted at

ECS Execを実行する時に以下のエラーが発生するときがある

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.


An error occurred (TargetNotConnectedException) when calling the ExecuteCommand operation: The execute command failed due to an internal error. Try again later.

まずやるべきこと : Amazon ECS Exec Checkerを使おう

以下からgit cloneしてきましょう
https://github.com/aws-containers/amazon-ecs-exec-checker

使い方などは割と簡単なので割愛します

Amazon ECS Exec Checkerで出てくる3パターン

1.ECSのタスクロールにSSM関連の権限が不足している

以下を参考にして、タスクロールを修正してみてください。

2.「読み取り専用ルートファイルシステム(Read-Only Root Filesystem)」にチェックが入っている

「タスク定義の新しいリビジョンの作成」→ 「コンテナの定義」より、以下の画像のチェックを外してください。

Screenshot from 2022-04-05 15-29-02.png

3.コンテナの定義の環境変数の中にAWS_ACCESS_KEY(AWS_ACCESS_KEY_ID) / AWS_SECRET_ACCESS_KEYが入っている

※2022年4月5日時点で、「Amazon ECS Exec Checker」でも検出出来ない様子。

自分もココでハマりました。どうしても活用しないといけない場合は別の環境変数名に変更して見て下さい。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0