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

aws-gate bootstrap is broken #44

Closed
alanjds opened this issue Sep 6, 2019 · 3 comments · Fixed by #60
Closed

aws-gate bootstrap is broken #44

alanjds opened this issue Sep 6, 2019 · 3 comments · Fixed by #60

Comments

@alanjds
Copy link
Contributor

alanjds commented Sep 6, 2019

I upgraded aws-gate and started to get errors. I guess is because, after #41 got pushed, it no longer accept session-manager-plugin to be provided by the host system. However, most of our users already have it installed by other ways.

OSError: session-manager-plugin not found

Trying to aws-gate bootstrap gives error because the needed folder is not yet created

$ aws-gate -v bootstrap
[Errno 2] No such file or directory: '/Users/alanjds/.aws-gate/bin'

After creating manually, the installation can succeed:

$ mkdir -p /Users/alanjds/.aws-gate/bin
$ aws-gate -v bootstrap
1.1.26.0
session-manager-plugin (version None) installed successfully!

After #41, aws-gate no longer accept the plugin to be provided by system.
For curiosity, why is it allowing only owned version to be used?

What about allowing usage of existing one if available, maybe with a deprecation or warning message?

@xen0l
Copy link
Owner

xen0l commented Sep 10, 2019

Hi @alanjds ,

this is weird because the folder creation is contained here: https://github.com/xen0l/aws-gate/blob/master/aws_gate/bootstrap.py#L69-L71, so the folder should get created in the case it does not exist. Could you tell me how can I reproduce the issue? If you set GATE_DEBUG environment variable to something, it will provide more verbose output. Pasting that would be also helpful.

Only problem I found was the broken output (version being printed on different line and (Version None) in the subsequent line) from https://github.com/xen0l/aws-gate/blob/master/aws_gate/bootstrap.py#L18, where capture_output=True is missing, which I will add in the upcoming days alongside with a test to avoid this in the future.

As far as own version of plugin is concerned, the idea is that aws-gate will try to always use local copy if available (done via putting ~/.aws-gate/bin into the PATH at https://github.com/xen0l/aws-gate/blob/master/aws_gate/utils.py#L94). All the places are calling session-manager-plugin. If there is a call with a full path, it's certainly a bug and not intended behaviour. The reason why I implemented bootstrap was to have a simple install/update mechanism of the plugin (however, I am not very happy as there is no way to verify the checksum of the plugin as it is not published anywhere). I certainly intend to keep support for running non-aws-gate copies of the plugin for the foreseeable future.

@xen0l xen0l pinned this issue Sep 10, 2019
@xen0l xen0l unpinned this issue Sep 10, 2019
@virgilwashere
Copy link

This is broken for me too on Ubuntu.

I will try and provide at least a bash version of a suitable Ubuntu bootstrap for you to use...my python-fu < bash-fu

@xen0l
Copy link
Owner

xen0l commented Sep 26, 2019

@virgilwashere bootstrap is supported only on mac os. I plan Linux support in the future.

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

Successfully merging a pull request may close this issue.

3 participants