aws-ssmaws-session-manager

aws start-session end with **Cannot perform start session: EOF**


I try to using Session Manager within my CI (with a vanilla configuration, so nothing too fancy).

All inputs (keys, etc.) and configurations (user/strategy/key) are valid. I succeed to start a session on my own laptop.

But on my pipeline i got the following message

Starting session with SessionId: xxxx-xxxxxxx
$ **Cannot perform start session: EOF**

Is this shell related ?

For reference, tools used on the CI :


Solution

  • If you bumped into this error like I did:

    Cannot perform start session: EOF
    

    and got here, then using the information from Benjamin Hao's comment, here are the steps I took to make it finally work:

    Install expect, in my case I had to install it on the Github hosted runner which is installed with Ubuntu:

    apt install -y expect
    

    Then, add "unbuffer" before the command you're trying to execute, for example:

    unbuffer aws ecs execute-command --region $REGION --cluster $ecs_cluster_name --task $ecs_task_id --container ops-machine --command 'clitool env start --confirm' --interactive