- 最新
- 投票最多
- 评论最多
Hello.
I tried it in my environment, but I can't reproduce the problem.
It's possible that the problem cannot be reproduced because we are testing it on a temporary server with a small amount of logs, but it could also be a problem with the Session Manager plugin differences.
What version of the Session Manager plugin are you using?
I am using the latest version in my environment.
https://docs.aws.amazon.com/systems-manager/latest/userguide/plugin-version-history.html
session-manager-plugin --version
The Session Manager plugin also allows you to output logs for the plugin itself, so try setting this and checking to see if any errors occur.
https://docs.aws.amazon.com/systems-manager/latest/userguide/install-plugin-configure-logs.html
$ session-manager-plugin --version 1.2.764.0
I am also using the same version. Have you checked the Session Manager plugin logs?
This issue could be related to how SSM Agent handles long-running sessions, which can sometimes cause the managed node to become unresponsive or crash.
Here are some potential solutions:
-
Decrease the SSM Agent log retention duration for Session Manager. This is a recommended solution when managed nodes become unresponsive during long-running sessions.
-
If you're unable to terminate the session normally, you can force termination using the AWS CLI command:
aws ssm terminate-session --session-id your-session-id
-
If you're experiencing issues specifically with Windows Server 2025 instances, ensure that WMIC is installed as an optional feature.
-
You might want to enable debug logging for SSM Agent to troubleshoot further. This involves:
- Connecting to the managed node
- Making a copy of the seelog.xml.template file and renaming it to seelog.xml
- Editing the file to change the minlevel from "info" to "debug"
- Restarting the SSM Agent service
- If you're using Terraform to manage your instances and experiencing timing issues with SSM commands, consider adding delays between instance creation and command execution.
The most likely solution for your specific issue is to terminate the hanging session and start a new one, or to decrease the SSM Agent log retention duration to prevent future occurrences.
Sources
Troubleshooting Session Manager - AWS Systems Manager
End a session - AWS Systems Manager
Viewing SSM Agent logs - AWS Systems Manager
Troubleshoot issues with Amazon EC2 Windows instances - Amazon Elastic Compute Cloud
Running SSM Commands after ec2 instance is created (Terraform) | AWS re:Post

Sounds like a classic buffering issue – when the file isn’t getting new data,
tail -fsits idle waiting for more, so it can feel like it’s hung.Try these steps
This will poll the file every 2 seconds instead of blocking indefinitely.
This tells the system to flush output line‑by‑line, which can break the stall.
Check if the file is being rotated If the log is being rotated (size resets),
tail -F(capital F) will follow the file name rather than the descriptor.Verify WSL2 networking Sometimes WSL2’s networking quirks cause the session to freeze.
wsl --shutdownthen reopen.Alternative: Use tmux or screen Run the command in a tmux session so it survives network hicups.
If none of that helps, check the SSM Agent logs on the instance (
/var/log/amazon/ssm) for errors or connectivity drops .¹