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

Session Manager Plugin built from source code exits unexpectedly #57

Open
BohdanPetryshyn opened this issue Nov 24, 2022 · 2 comments
Open

Comments

@BohdanPetryshyn
Copy link

Summary

When building the session-manager-plugin binary from source code using Docker, the resulting binary exits unexpectedly when used with the AWS-StartPortForwardingSessionToRemoteHost document.

Steps to reproduce

  1. Clone repo (reproduces on 1.2.398.0 and previous versions)
  2. Follow the Working with Docker instructions to build the binary
    1. Run docker build -t session-manager-plugin-image .
    2. Run docker run -it --rm --name session-manager-plugin -v pwd:/session-manager-plugin session-manager-plugin-image make release
  3. Copy the resulting binary (bin/darwing_amd64_plugin/session-manager-plugin for MacOS) to the installation folder (/usr/local/bin/ for MacOS)
  4. Run AWS CLI against the binary:
    aws ssm start-session \
        --target  <your-target-ec2-instance> \
        --document-name AWS-StartPortForwardingSessionToRemoteHost \
        --parameters '{"host":["<your-target-host-name>"],"portNumber":["<your-target-port>"], "localPortNumber":["<your-local-port>"]}'
    
  5. In 2 to 5 minutes, the session will end unexpectedly. (Idle session timeout: 20m, Maximum session duration: 60m are set in the session manager settings in AWS console)

Considerations

The session-manager-plugin binary downloaded from the link provided in the installation manual normally works in the same scenario. Looks like the build process used for the installation packages differs from what's described in the readme. Another piece of evidence for this is that the VERSION file in the repository contains 1.2.0.0 while the downloaded package contains the correct version (1.2.398.0 in my case).

It would be great if properly built binaries were released along with the source code for each release.

Or maybe my way of using the build artifacts is wrong?

@clementlecorre
Copy link

@BohdanPetryshyn Any news ?

@BohdanPetryshyn
Copy link
Author

BohdanPetryshyn commented Mar 28, 2024

I ended up using version 1.2.295.0 in my project (https://github.com/basti-app/basti). The build result is fine for the version. It would be great to be able to upgrade to newer versions.

@clementlecorre, did you try building the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants