Skip to content
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

"ssm start-session" should print debug output to stderr instead of stdout #5965

Closed
2 tasks done
heidemn opened this issue Feb 21, 2021 · 3 comments
Closed
2 tasks done
Assignees
Labels
feature-request A feature should be added or improved. service-api This issue is due to a problem in a service API, not the SDK implementation. ssm

Comments

@heidemn
Copy link

heidemn commented Feb 21, 2021

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

Platform/OS/Hardware/Device
Ubuntu 20.04.1 LTS (in WSL2)

To Reproduce (observed behavior)

$ aws ssm start-session --target i-0123456789abcde --document-name AWS-StartInteractiveCommand --parameters 'command=["echo 42"]' > 42.txt
(no output)

$ cat 42.txt

Starting session with SessionId: root-0001234567abcde
42


Exiting session with sessionId: root-0001234567abcde.

Expected behavior

$ aws ssm start-session --target i-0123456789abcde --document-name AWS-StartInteractiveCommand --parameters 'command=["echo 42"]' > 42.txt

Starting session with SessionId: root-0001234567abcde

Exiting session with sessionId: root-0001234567abcde.

$ cat 42.txt
42

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.

@heidemn heidemn added the needs-triage This issue or PR still needs to be triaged. label Feb 21, 2021
@kdaily kdaily self-assigned this Feb 22, 2021
@kdaily kdaily added guidance Question that needs advice or information. feature-request A feature should be added or improved. service-api This issue is due to a problem in a service API, not the SDK implementation. ssm and removed needs-triage This issue or PR still needs to be triaged. guidance Question that needs advice or information. labels Feb 23, 2021
@kdaily
Copy link
Member

kdaily commented Feb 23, 2021

Hi @heidemn, thanks for the report. You're right, this would need to be fixed in the session manager plugin. I will alert the SSM team to this feature request.

@kdaily
Copy link
Member

kdaily commented Feb 23, 2021

You can open this issue here - unfortunately I do not have the permissions to transfer this issue to the other repository.

https://github.com/aws/amazon-ssm-agent

Thanks!

@kdaily kdaily closed this as completed Feb 23, 2021
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. service-api This issue is due to a problem in a service API, not the SDK implementation. ssm
Projects
None yet
Development

No branches or pull requests

2 participants