FS#77919 - [aws-cli-v2] FTBFS

Attached to Project: Community Packages
Opened by avimitin (avimitin) - Monday, 20 March 2023, 10:53 GMT
Last edited by Chih-Hsuan Yen (yan12125) - Tuesday, 21 March 2023, 17:37 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Chih-Hsuan Yen (yan12125)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When I ran the archbuild for this package, the `check()` stage fail with the following output:

=================================== FAILURES ===================================
________________ SSOSessionTest.test_token_chosen_from_provider ________________
[gw11] linux -- Python 3.10.10 /usr/bin/python

self = <tests.functional.botocore.test_credentials.SSOSessionTest testMethod=test_token_chosen_from_provider>

def test_token_chosen_from_provider(self):
profile = (
'[profile sso-test]\n'
'region = us-east-1\n'
'sso_session = sso-test-session\n'
'sso_account_id = 12345678901234\n'
'sso_role_name = ViewOnlyAccess\n'
'\n'
'[sso-session sso-test-session]\n'
'sso_region = us-east-1\n'
'sso_start_url = https://test.awsapps.com/start\n';
'sso_registration_scopes = sso:account:access\n'
)
self.write_config(profile)

session = Session(profile='sso-test')
with SessionHTTPStubber(session) as stubber:
self.add_credential_response(stubber)
stubber.add_response()
with mock.patch.object(
SSOTokenProvider, 'DEFAULT_CACHE_CLS', MockCache
):
c = session.create_client('s3')
> c.list_buckets()

tests/functional/botocore/test_credentials.py:986:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
awscli/botocore/client.py:341: in _api_call
return self._make_api_call(operation_name, kwargs)
awscli/botocore/client.py:683: in _make_api_call
http, parsed_response = self._make_request(
awscli/botocore/client.py:703: in _make_request
return self._endpoint.make_request(operation_model, request_dict)
awscli/botocore/endpoint.py:101: in make_request
return self._send_request(request_dict, operation_model)
awscli/botocore/endpoint.py:131: in _send_request
request = self.create_request(request_dict, operation_model)
awscli/botocore/endpoint.py:114: in create_request
self._event_emitter.emit(event_name, request=request,
awscli/botocore/hooks.py:228: in emit
return self._emit(event_name, kwargs)
awscli/botocore/hooks.py:211: in _emit
response = handler(**kwargs)
awscli/botocore/signers.py:94: in handler
return self.sign(operation_name, request)
awscli/botocore/signers.py:158: in sign
auth = self.get_auth_instance(**kwargs)
awscli/botocore/signers.py:253: in get_auth_instance
frozen_credentials = self._credentials.get_frozen_credentials()
awscli/botocore/credentials.py:585: in get_frozen_credentials
self._refresh()
awscli/botocore/credentials.py:480: in _refresh
self._protected_refresh(is_mandatory=is_mandatory_refresh)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <botocore.credentials.DeferredRefreshableCredentials object at 0x7f25d7a3d930>
is_mandatory = True

def _protected_refresh(self, is_mandatory):
# precondition: this method should only be called if you've acquired
# the self._refresh_lock.
try:
metadata = self._refresh_using()
except Exception as e:
period_name = 'mandatory' if is_mandatory else 'advisory'
logger.warning("Refreshing temporary credentials failed "
"during %s refresh period.",
period_name, exc_info=True)
if is_mandatory:
# If this is a mandatory refresh, then
# all errors that occur when we attempt to refresh
# credentials are propagated back to the user.
raise
# Otherwise we'll just return.
# The end result will be that we'll use the current
# set of temporary credentials we have.
return
self._set_from_data(metadata)
self._frozen_credentials = ReadOnlyCredentials(
self._access_key, self._secret_key, self._token)
if self._is_expired():
# We successfully refreshed credentials but for whatever
# reason, our refreshing function returned credentials
# that are still expired. In this scenario, the only
# thing we can do is let the user know and raise
# an exception.
msg = ("Credentials were refreshed, but the "
"refreshed credentials are still expired.")
logger.warning(msg)
> raise RuntimeError(msg)
E RuntimeError: Credentials were refreshed, but the refreshed credentials are still expired.

awscli/botocore/credentials.py:523: RuntimeError
------------------------------ Captured log call -------------------------------
WARNING botocore.credentials:credentials.py:522 Credentials were refreshed, but the refreshed credentials are still expired.
=========================== short test summary info ============================
FAILED tests/functional/botocore/test_credentials.py::SSOSessionTest::test_token_chosen_from_provider
============ 1 failed, 65384 passed, 4 skipped in 216.37s (0:03:36) ============
This task depends upon

Closed by  Chih-Hsuan Yen (yan12125)
Tuesday, 21 March 2023, 17:37 GMT
Reason for closing:  Fixed
Additional comments about closing:  aws-cli-v2 2.11.4-1
Comment by Chih-Hsuan Yen (yan12125) - Monday, 20 March 2023, 19:10 GMT
https://github.com/boto/botocore/pull/2882 seems related. Could you try adding `export TZ=UTC` before the pytest command in PKGBUILD?
Comment by Toolybird (Toolybird) - Monday, 20 March 2023, 19:14 GMT
Seems to exhaust all memory. I killed it just in case the OOM-killer decided to take down my machine..
Comment by avimitin (avimitin) - Tuesday, 21 March 2023, 04:16 GMT
Yes, adding `export TZ=UTC` did fixed the problem.
Comment by Chih-Hsuan Yen (yan12125) - Tuesday, 21 March 2023, 17:37 GMT
Thanks! The issue should have been fixed as part of aws-cli-v2 2.11.4-1. I use your pull request instead https://github.com/aws/aws-cli/pull/7762.

> Seems to exhaust all memory.

It takes more than 20 GB on my machine!

Loading...