Skip to content

Instantly share code, notes, and snippets.

@tuxlife
Last active October 14, 2015 13:16
Show Gist options
  • Save tuxlife/37e672a0e546b761cae9 to your computer and use it in GitHub Desktop.
Save tuxlife/37e672a0e546b761cae9 to your computer and use it in GitHub Desktop.
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV3Handler'] Check your credentials

Folgende Exception wird ignoriert, bzw. falsch behandelt: TypeError("get() got an unexpected keyword argument 'raw'",)

boto/pyami/config.py

    def get(self, section, name, default=None):
        try:
            val = ConfigParser.get(self, section, name)
        except:
            val = default
        return val

Ich habe boto/pyami/config.py wie folgt angepasst:

    def get(self, section, name, default=None):
        try:
            val = ConfigParser.get(self, section, name)
        except Exception as e:
            print(e)
            if 'raw' in str(e):
                val = ConfigParser.get(self, section, name)
            val = default
        return val

und nun bekomme ich eine länger Fehlermeldung, wo ich jetzt auch weiter komme...

 EXCEPTION OCCURRED: get() got an unexpected keyword argument 'raw'
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/boto/pyami/config.py", line 142, in get
    val = ConfigParser.get(self, section, name)
  File "/usr/lib/python3.4/configparser.py", line 772, in get
    d)
  File "/usr/lib/python3.4/configparser.py", line 371, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.4/configparser.py", line 384, in _interpolate_some
    rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.4/dist-packages/sevenseconds/__main__.py", line 4, in <module>
    sevenseconds.cli.main()
  File "/usr/local/lib/python3.4/dist-packages/sevenseconds/cli.py", line 226, in main
    cli()
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/sevenseconds/cli.py", line 123, in configure
    get_aws_credentials(saml_user, saml_password, saml_url, saml_role, admin_account, 'adminaccount')
  File "/usr/local/lib/python3.4/dist-packages/sevenseconds/cli.py", line 169, in get_aws_credentials
    key_id, secret, session_token = assume_role(saml_xml, role[0], role[1])
  File "/usr/local/lib/python3.4/dist-packages/aws_saml_login/saml.py", line 164, in assume_role
    conn = boto.sts.connect_to_region('eu-west-1')
  File "/usr/local/lib/python3.4/dist-packages/boto/sts/__init__.py", line 51, in connect_to_region
    return region.connect(**kw_params)
  File "/usr/local/lib/python3.4/dist-packages/boto/regioninfo.py", line 187, in connect
    return self.connection_cls(region=self, **kw_params)
  File "/usr/local/lib/python3.4/dist-packages/boto/sts/connection.py", line 107, in __init__
    provider=provider)
  File "/usr/local/lib/python3.4/dist-packages/boto/connection.py", line 1103, in __init__
    provider=provider)
  File "/usr/local/lib/python3.4/dist-packages/boto/connection.py", line 556, in __init__
    profile_name)
  File "/usr/local/lib/python3.4/dist-packages/boto/provider.py", line 200, in __init__
    self.get_credentials(access_key, secret_key, security_token, profile_name)
  File "/usr/local/lib/python3.4/dist-packages/boto/provider.py", line 363, in get_credentials
    security_token_name)
  File "/usr/local/lib/python3.4/dist-packages/boto/pyami/config.py", line 146, in get
    val = ConfigParser.get(self, section, name)
  File "/usr/lib/python3.4/configparser.py", line 772, in get
    d)
  File "/usr/lib/python3.4/configparser.py", line 371, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.4/configparser.py", line 384, in _interpolate_some
    rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'

Lösung: boto/boto#3370

2015-10-14 09:56:39,922 boto [DEBUG]:Using access key found in shared credential file.
2015-10-14 09:56:39,922 boto [DEBUG]:Using secret key found in shared credential file.
2015-10-14 09:56:39,922 boto [DEBUG]:Using security token found in shared credential file.
2015-10-14 09:56:39,923 boto [DEBUG]:Retrieving credentials from metadata server.
2015-10-14 09:56:40,927 boto [ERROR]:Caught exception reading instance data
2015-10-14 09:56:40,927 boto [ERROR]:Unable to read instance data, giving up
Traceback (most recent call last):
File "/home/mkerk/GIT/stups/stups-tools/test.py", line 5, in <module>
dns_conn = boto.route53.connect_to_region('eu-west-1')
File "/usr/local/lib/python3.5/dist-packages/boto/route53/__init__.py", line 86, in connect_to_region
return region.connect(**kw_params)
File "/usr/local/lib/python3.5/dist-packages/boto/route53/__init__.py", line 44, in connect
return self.connection_cls(host=self.endpoint, **kw_params)
File "/usr/local/lib/python3.5/dist-packages/boto/route53/connection.py", line 88, in __init__
profile_name=profile_name)
File "/usr/local/lib/python3.5/dist-packages/boto/connection.py", line 569, in __init__
host, config, self.provider, self._required_auth_capability())
File "/usr/local/lib/python3.5/dist-packages/boto/auth.py", line 987, in get_auth_handler
'Check your credentials' % (len(names), str(names)))
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV3Handler'] Check your credentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment