Skip to content

env-config-aws can timeout and throw an exception instead of refreshing #21

@rsyring

Description

@rsyring
  File "/home/rsyring/projects/env-config-pkg/src/env_config/cli.py", line 142, in env_config_aws
    sess_creds = aws.op_sess_creds(config.op_ref_base, config.mfa_serial)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rsyring/projects/env-config-pkg/src/env_config/aws.py", line 144, in op_sess_creds
    sess_auth = sts_session(perm_auth)
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rsyring/projects/env-config-pkg/src/env_config/aws.py", line 106, in sts_session
    response = sts_client.get_session_token(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rsyring/.local/pipx/venvs/env-config-cli/lib/python3.11/site-packages/botocore/client.py", line 569, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rsyring/.local/pipx/venvs/env-config-cli/lib/python3.11/site-packages/botocore/client.py", line 1023, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed with invalid MFA one time pass code. 

When this happens I usually try again for 10-15 seconds until it succeeds. Can env-config do the same thing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions