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

Runtime Failure on awscli 1.13+ #7

Closed
hikerspath opened this issue Dec 8, 2017 · 6 comments
Closed

Runtime Failure on awscli 1.13+ #7

hikerspath opened this issue Dec 8, 2017 · 6 comments

Comments

@hikerspath
Copy link

getting the following error when attempting to run awsudo on newer versions of awscli python libraries.

Latest working version:

awscli-1.12.2
botocore-1.8.2

Failures start in following:

awscli-1.13.0
botocore-1.8.3

Specific message / issue:

# awsudo -u profile_name env
Traceback (most recent call last):
  File "/root/.local/bin/awsudo", line 9, in <module>
    load_entry_point('awsudo==0.0.0', 'console_scripts', 'awsudo')()
  File "/root/.local/lib/python2.7/site-packages/awsudo/main.py", line 68, in main
    run(args, resolver.getEnvironment(profile))
  File "/root/.local/lib/python2.7/site-packages/awsudo/config.py", line 16, in getEnvironment
    session.emit('session-initialized', session=session)
  File "/usr/lib/python2.7/site-packages/botocore/session.py", line 719, in emit
    return self._events.emit(event_name, **kwargs)
  File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
    return self._emit(event_name, kwargs)
  File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
    response = handler(**kwargs)
TypeError: attach_history_handler() takes exactly 2 arguments (1 given)

The 'attach_history_handler()' exists in the new history options of the aws-cli that started in that version.

@ktilcu
Copy link
Contributor

ktilcu commented Dec 19, 2017

@hikerspath Thanks for pointing this out. Feel free to take a stab at this. Otherwise we will likely take a little bit to circle around.

@ktilcu
Copy link
Contributor

ktilcu commented Dec 19, 2017

A quick peek makes me think that it's a problem in botocore. I can dig more later.

@yanotoma
Copy link

yanotoma commented Jan 7, 2018

Hi! I have the same problem, do you have any update about this? thanks!

bitglue pushed a commit to bitglue/awsudo that referenced this issue Jan 31, 2018
12.13.0 fails:

    # awsudo -u profile_name env
    Traceback (most recent call last):
      File "/root/.local/bin/awsudo", line 9, in <module>
	load_entry_point('awsudo==0.0.0', 'console_scripts', 'awsudo')()
      File "/root/.local/lib/python2.7/site-packages/awsudo/main.py", line 68, in main
	run(args, resolver.getEnvironment(profile))
      File "/root/.local/lib/python2.7/site-packages/awsudo/config.py", line 16, in getEnvironment
	session.emit('session-initialized', session=session)
      File "/usr/lib/python2.7/site-packages/botocore/session.py", line 719, in emit
	return self._events.emit(event_name, **kwargs)
      File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
	return self._emit(event_name, kwargs)
      File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
	response = handler(**kwargs)
    TypeError: attach_history_handler() takes exactly 2 arguments (1 given)

See makethunder#7
@ktilcu
Copy link
Contributor

ktilcu commented Feb 6, 2018

@yanotoma @hikerspath We have a temporary fix in. Let me know if you have any problems with it.

@rizkidoank
Copy link
Contributor

Hello @ktilcu ,
I'm trying to fix this issue in PR #10 .
apparently it's caused by 'session-initialized' event being registered to attach_handler_history. In that PR, I register 'session-initialized' event to inject_assume_role_provider_cache.

Is there any reason to use awscli as dependency? If I looked into the code, probably we can remove the dependency of awscli to use only botocore as dependency to get cached credentials. CMIIW

@ktilcu
Copy link
Contributor

ktilcu commented Jul 4, 2018

@yanotoma @hikerspath Sorry for the huge delay. I finally merged @rizkidoank's pull request. I think this should patch things up for the near term.

@ktilcu ktilcu closed this as completed Jul 4, 2018
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

4 participants