-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[session-manager-plugin] "aws ssm start-session" should print debug output to stderr instead of stdout #358
Comments
As requested by @kdaily , I'm re-opening aws/aws-cli#5965 here.
Thanks in advance for fixing this. |
Thanks for your feedback! We have noted this request. |
We are also interested in this feature, as using |
@nitikagoyal87 looking at the code, it seems that 42milez' PR should fix the issue. |
We have exactly the same problem. @MehdiZonjy anyway we can get some more attention on this? |
Even just an option to switch off this logging, or to specify a log device, e.g. |
We have exactly the same problem. @MehdiZonjy anyway we can get some more attention on this? |
@tapajos you should file an internal support request in AWS. |
@gianniLesl any chance we can merge this? |
Bumping this as I am having the same problem :) |
Any progress on this? |
aws/session-manager-plugin#94 should help with this if anyone wants to test it out. |
I've made a client-side workaround for this via a It sends the SSM header and trailer to stderr, sends program stdout to stdout and stderr to stderr, and then exits with the exit code of the program. (I also had it add color to the SSM header/trailer to make them less visually prominent.) Note that it utilizes https://github.com/jpmens/jo to easily produce JSON from shell script, so you'll need to have that installed.
Invoke it with |
On the one side, nice workaround. Would be nice if AWS fixes this properly. |
This is a very frustrating limitation, as it makes it impossible to cleanly capture the output of running anything in the containers. |
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
ssm start-session
should enable the user to pipe stdout to a file or other command.Currently, it dumps debug output to stdout, which is not helpful.
SDK version number
Same behavior with v1 and v2.
aws-cli/1.19.12 Python/3.8.5 Linux/4.19.128-microsoft-standard botocore/1.20.12
aws-cli/2.1.27 Python/3.7.3 Linux/4.19.128-microsoft-standard exe/x86_64.ubuntu.20 prompt/off
$ session-manager-plugin --version -> 1.2.54.0
Platform/OS/Hardware/Device
Ubuntu 20.04.1 LTS (in WSL2)
To Reproduce (observed behavior)
Expected behavior
Logs/output
n/a
Additional context
Use case: Run a command on the instance, and do some follow-up actions (local or remote) based on the output.
Unix commands generally print additional info to stderr.
Only the main output / payload should go to stdout.
I could find the text "Starting session" / "session with SessionId" neither in this repo, nor in the botocore repo.
-> I assume that this needs to be fixed in the
session-manager-plugin
, which seems not to be available on Github.The text was updated successfully, but these errors were encountered: