I'm using sessions Manager/Run Command to access some of my instances and it works for some instances and not for others.
I have the same configuration for a few instances, same security groups, IAM role, agents installed with the same agent version, and I've verified the instances are reachable through the AWS CLI with aws ssm describe-instance-information --instance-information-filter-list key=InstanceIds,valueSet=instance-id
I can start the session and it opens the terminal view and after a delay sends me this error or a black screen,
Your session has been terminated for the following reasons: document process failed unexpectedly: document worker timed out, check [ssm-document-worker]/[ssm-session-worker] log for the crash reason
I've tried updating the agent version, verifying the agent is installed and active through the CLI, triple-checked security groups, the IAM role, and differences, and have hit a wall.
Is this an AWS bug that other people have seen or am I missing something in my configuration? I might be missing something but everything I've seen shows two instances with the same properties where one works with the SSM session manager and the other one doesn't.
I fixed this by upgrading the SSM agent on my EC2 instance. I was using Amazon Linux 2.
Below are the commands I executed:
sudo yum info amazon-ssm-agent
sudo yum install -y https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/linux_amd64/amazon-ssm-agent.rpm
sudo yum info amazon-ssm-agent
sudo systemctl enable amazon-ssm-agent
sudo systemctl start amazon-ssm-agent
sudo systemctl status amazon-ssm-agent
Reference: Manually install SSM Agent on EC2 instances for Linux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With