aws / aws/amazon-ssm-agent

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

Open
#354 21 comments 16 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.2k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

I try to instanciate a vanilla `aws ssm start-session` on a Github actions Jobs (without SSH).

The session is well instanciated (i can see it on the AWS Session Manager dashboard) but always finish with a **Cannot perform start session: EOF**

FYI I can instanciated a sesion outside of GH actions (.e.g. on my laptop) with the same account / role / policy / instances (ami-0ea4a063871686f37).

Here's my job YAML :
```
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Initialize a Session Manager session
shell : sh
run: aws ssm start-session --target ${{ secrets.TARGET_INSTANCE }}
```

The results :
```
Run aws ssm start-session --target ***
aws ssm start-session --target ***
shell: /bin/sh -e {0}
env:
AWS_DEFAULT_REGION: ***
AWS_REGION: ***
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***

Starting session with SessionId: gh-ssm-0d50831b64f0xxxxx
$ Cannot perform start session: EOF
```

Here are the CLI tools packaged with Ubuntu-latest virtual env ([20.04.2 LTS](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md)) :
* AWS CLI 2.1.24
* AWS CLI Session manager plugin 1.2.54.0

Contributor guide

Open the contributing guide

Research direction

Start with the `aws ssm start-session` step in the provided GitHub Actions workflow and compare its behavior with the listed Ubuntu 20.04 AWS CLI 2.1.24 and Session Manager plugin 1.2.54.0 versions. Investigate why the session reaches the AWS dashboard but exits with EOF; done means the same workflow can establish the session without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, github-actions, ubuntu
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.