$ pipenv lock --python 3.10 (...omitted...) $ pipenv sync --dev (...omitted...) $ pipenv graph aiobotocore==2.3.4 - aiohttp [required: >=3.3.1, installed: 3.7.4.post0] - async-timeout [required: >=3.0,<4.0, installed: 3.0.1] - attrs [required: >=17.3.0, installed: 21.4.0] - chardet [required: >=2.0,<5.0, installed: 4.0.0] - multidict [required: >=4.5,<7.0, installed: 6.0.2] - typing-extensions [required: >=3.6.5, installed: 4.2.0] - yarl [required: >=1.0,<2.0, installed: 1.7.2] - idna [required: >=2.0, installed: 3.3] - multidict [required: >=4.0, installed: 6.0.2] - aioitertools [required: >=0.5.1, installed: 0.10.0] - botocore [required: >=1.24.21,<1.24.22, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - wrapt [required: >=1.10.10, installed: 1.14.1] aws-xray-sdk==2.9.0 - botocore [required: >=1.11.3, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - future [required: Any, installed: 0.18.2] - wrapt [required: Any, installed: 1.14.1] awscli==1.22.76 - botocore [required: ==1.24.21, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - colorama [required: >=0.2.5,<0.4.4, installed: 0.4.3] - docutils [required: >=0.10,<0.16, installed: 0.15.2] - PyYAML [required: >=3.10,<5.5, installed: 5.4.1] - rsa [required: >=3.1.2,<4.8, installed: 4.7.2] - pyasn1 [required: >=0.1.3, installed: 0.4.8] - s3transfer [required: >=0.5.0,<0.6.0, installed: 0.5.2] - botocore [required: >=1.12.36,<2.0a.0, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] cfn-lint==0.61.1 - aws-sam-translator [required: >=1.46.0, installed: 1.46.0] - boto3 [required: >=1.19.5,==1.*, installed: 1.21.21] - botocore [required: >=1.24.21,<1.25.0, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - s3transfer [required: >=0.5.0,<0.6.0, installed: 0.5.2] - botocore [required: >=1.12.36,<2.0a.0, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - jsonschema [required: ~=3.2, installed: 3.2.0] - attrs [required: >=17.4.0, installed: 21.4.0] - pyrsistent [required: >=0.14.0, installed: 0.18.1] - setuptools [required: Any, installed: 62.6.0] - six [required: >=1.11.0, installed: 1.16.0] - jschema-to-python [required: ~=1.2.3, installed: 1.2.3] - attrs [required: Any, installed: 21.4.0] - jsonpickle [required: Any, installed: 2.2.0] - pbr [required: Any, installed: 5.9.0] - jsonpatch [required: Any, installed: 1.32] - jsonpointer [required: >=1.9, installed: 2.3] - jsonschema [required: ~=3.0, installed: 3.2.0] - attrs [required: >=17.4.0, installed: 21.4.0] - pyrsistent [required: >=0.14.0, installed: 0.18.1] - setuptools [required: Any, installed: 62.6.0] - six [required: >=1.11.0, installed: 1.16.0] - junit-xml [required: ~=1.9, installed: 1.9] - six [required: Any, installed: 1.16.0] - networkx [required: ~=2.4, installed: 2.8.4] - pyyaml [required: >5.4, installed: 5.4.1] - sarif-om [required: ~=1.0.4, installed: 1.0.4] - attrs [required: Any, installed: 21.4.0] - pbr [required: Any, installed: 5.9.0] codecov==2.1.11 - coverage [required: Any, installed: 5.5] - requests [required: >=2.7.9, installed: 2.28.0] - certifi [required: >=2017.4.17, installed: 2022.6.15] - charset-normalizer [required: ~=2.0.0, installed: 2.0.12] - idna [required: >=2.5,<4, installed: 3.3] - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9] dill==0.3.3 docker==5.0.0 - requests [required: >=2.14.2,!=2.18.0, installed: 2.28.0] - certifi [required: >=2017.4.17, installed: 2022.6.15] - charset-normalizer [required: ~=2.0.0, installed: 2.0.12] - idna [required: >=2.5,<4, installed: 3.3] - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9] - websocket-client [required: >=0.32.0, installed: 1.3.3] flake8-formatter-abspath==1.0.1 - flake8 [required: >=3.0.0, installed: 3.9.0] - mccabe [required: >=0.6.0,<0.7.0, installed: 0.6.1] - pycodestyle [required: >=2.7.0,<2.8.0, installed: 2.7.0] - pyflakes [required: >=2.3.0,<2.4.0, installed: 2.3.1] Flask-Cors==3.0.10 - Flask [required: >=0.9, installed: 2.1.2] - click [required: >=8.0, installed: 8.1.3] - itsdangerous [required: >=2.0, installed: 2.1.2] - Jinja2 [required: >=3.0, installed: 3.1.2] - MarkupSafe [required: >=2.0, installed: 2.1.1] - Werkzeug [required: >=2.0, installed: 2.1.2] - Six [required: Any, installed: 1.16.0] jsondiff==2.0.0 moto==2.2.20 - boto3 [required: >=1.9.201, installed: 1.21.21] - botocore [required: >=1.24.21,<1.25.0, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - s3transfer [required: >=0.5.0,<0.6.0, installed: 0.5.2] - botocore [required: >=1.12.36,<2.0a.0, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - botocore [required: >=1.12.201, installed: 1.24.21] - jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - urllib3 [required: >=1.25.4,<1.27, installed: 1.26.9] - cryptography [required: >=3.3.1, installed: 37.0.2] - cffi [required: >=1.12, installed: 1.15.0] - pycparser [required: Any, installed: 2.21] - Jinja2 [required: >=2.10.1, installed: 3.1.2] - MarkupSafe [required: >=2.0, installed: 2.1.1] - MarkupSafe [required: !=2.0.0a1, installed: 2.1.1] - python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2] - six [required: >=1.5, installed: 1.16.0] - pytz [required: Any, installed: 2022.1] - requests [required: >=2.5, installed: 2.28.0] - certifi [required: >=2017.4.17, installed: 2022.6.15] - charset-normalizer [required: ~=2.0.0, installed: 2.0.12] - idna [required: >=2.5,<4, installed: 3.3] - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9] - responses [required: >=0.9.0, installed: 0.21.0] - requests [required: >=2.0,<3.0, installed: 2.28.0] - certifi [required: >=2017.4.17, installed: 2022.6.15] - charset-normalizer [required: ~=2.0.0, installed: 2.0.12] - idna [required: >=2.5,<4, installed: 3.3] - urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9] - urllib3 [required: >=1.25.10, installed: 1.26.9] - werkzeug [required: Any, installed: 2.1.2] - xmltodict [required: Any, installed: 0.13.0] Pygments==2.12.0 pytest-asyncio==0.14.0 - pytest [required: >=5.4.0, installed: 6.2.4] - attrs [required: >=19.2.0, installed: 21.4.0] - iniconfig [required: Any, installed: 1.1.1] - packaging [required: Any, installed: 21.3] - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9] - pluggy [required: >=0.12,<1.0.0a1, installed: 0.13.1] - py [required: >=1.8.2, installed: 1.11.0] - toml [required: Any, installed: 0.10.2] pytest-cov==2.11.1 - coverage [required: >=5.2.1, installed: 5.5] - pytest [required: >=4.6, installed: 6.2.4] - attrs [required: >=19.2.0, installed: 21.4.0] - iniconfig [required: Any, installed: 1.1.1] - packaging [required: Any, installed: 21.3] - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9] - pluggy [required: >=0.12,<1.0.0a1, installed: 0.13.1] - py [required: >=1.8.2, installed: 1.11.0] - toml [required: Any, installed: 0.10.2] pytest-xdist==2.2.1 - execnet [required: >=1.1, installed: 1.9.0] - pytest [required: >=6.0.0, installed: 6.2.4] - attrs [required: >=19.2.0, installed: 21.4.0] - iniconfig [required: Any, installed: 1.1.1] - packaging [required: Any, installed: 21.3] - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9] - pluggy [required: >=0.12,<1.0.0a1, installed: 0.13.1] - py [required: >=1.8.2, installed: 1.11.0] - toml [required: Any, installed: 0.10.2] - pytest-forked [required: Any, installed: 1.4.0] - py [required: Any, installed: 1.11.0] - pytest [required: >=3.10, installed: 6.2.4] - attrs [required: >=19.2.0, installed: 21.4.0] - iniconfig [required: Any, installed: 1.1.1] - packaging [required: Any, installed: 21.3] - pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.9] - pluggy [required: >=0.12,<1.0.0a1, installed: 0.13.1] - py [required: >=1.8.2, installed: 1.11.0] - toml [required: Any, installed: 0.10.2] python-jose==3.3.0 - ecdsa [required: !=0.15, installed: 0.17.0] - six [required: >=1.9.0, installed: 1.16.0] - pyasn1 [required: Any, installed: 0.4.8] - rsa [required: Any, installed: 4.7.2] - pyasn1 [required: >=0.1.3, installed: 0.4.8] sshpubkeys==3.3.1 - cryptography [required: >=2.1.4, installed: 37.0.2] - cffi [required: >=1.12, installed: 1.15.0] - pycparser [required: Any, installed: 2.21] - ecdsa [required: >=0.13, installed: 0.17.0] - six [required: >=1.9.0, installed: 1.16.0] $ AWS_CONFIG_FILE=/dev/null make flake mototest pipenv run python setup.py check -rms running check pipenv run python -m flake8 --format=abspath docker pull alpine Using default tag: latest latest: Pulling from library/alpine Digest: sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c Status: Image is up to date for alpine:latest docker.io/library/alpine:latest docker pull lambci/lambda:python3.8 python3.8: Pulling from lambci/lambda Digest: sha256:be943e04cfeda15e0ea141d84a914b12f500194a694e809bb3cd0d0dd187aa56 Status: Image is up to date for lambci/lambda:python3.8 docker.io/lambci/lambda:python3.8 BOTO_CONFIG=/dev/null pipenv run python -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m moto -n auto --cov-report term --cov-report html --cov-report xml --cov=aiobotocore --cov=tests --log-cli-level=DEBUG aiobotocore tests ============================================================================ test session starts ============================================================================= platform linux -- Python 3.10.5, pytest-6.2.4, py-1.11.0, pluggy-0.13.1 -- /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/bin/python cachedir: .pytest_cache rootdir: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore, configfile: pytest.ini plugins: asyncio-0.14.0, xdist-2.2.1, cov-2.11.1, forked-1.4.0 [gw0] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw1] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw2] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw3] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw4] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw5] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw6] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw7] linux Python 3.10.5 cwd: /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore [gw0] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw1] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw3] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw2] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw4] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw5] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw6] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] [gw7] Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] gw0 [160] / gw1 [160] / gw2 [160] / gw3 [160] / gw4 [160] / gw5 [160] / gw6 [160] / gw7 [160] scheduling tests via LoadScheduling tests/test_basic_s3.py::test_can_make_request tests/test_basic_s3.py::test_fail_proxy_request tests/test_basic_s3.py::test_can_get_bucket_location tests/test_basic_s3.py::test_can_paginate_with_page_size tests/test_basic_s3.py::test_can_search_paginate tests/test_basic_s3.py::test_can_make_request_no_verify[False] tests/test_basic_s3.py::test_can_paginate tests/test_basic_s3.py::test_can_delete_urlencoded_object [gw2] [ 0%] PASSED tests/test_basic_s3.py::test_can_get_bucket_location [gw7] [ 1%] PASSED tests/test_basic_s3.py::test_can_search_paginate [gw1] [ 1%] PASSED tests/test_basic_s3.py::test_can_make_request_no_verify[False] [gw6] [ 2%] PASSED tests/test_basic_s3.py::test_can_paginate_with_page_size [gw0] [ 3%] PASSED tests/test_basic_s3.py::test_can_make_request [gw4] [ 3%] PASSED tests/test_basic_s3.py::test_can_delete_urlencoded_object tests/test_basic_s3.py::test_adaptive_retry tests/test_basic_s3.py::test_result_key_iters tests/test_basic_s3.py::test_paginate_within_page_boundaries [gw5] [ 4%] PASSED tests/test_basic_s3.py::test_can_paginate tests/test_basic_s3.py::test_can_paginate_iterator tests/test_basic_s3.py::test_paginate_max_items tests/test_basic_s3.py::test_get_object_stream_wrapper [gw4] [ 5%] PASSED tests/test_basic_s3.py::test_get_object_stream_wrapper [gw2] [ 5%] PASSED tests/test_basic_s3.py::test_adaptive_retry tests/test_basic_s3.py::test_get_object_stream_context [gw7] [ 6%] PASSED tests/test_basic_s3.py::test_paginate_within_page_boundaries [gw1] [ 6%] PASSED tests/test_basic_s3.py::test_result_key_iters [gw0] [ 7%] PASSED tests/test_basic_s3.py::test_can_paginate_iterator [gw6] [ 8%] PASSED tests/test_basic_s3.py::test_paginate_max_items tests/test_basic_s3.py::test_can_copy_with_dict_form_with_version tests/test_basic_s3.py::test_can_copy_with_dict_form [gw5] [ 8%] PASSED tests/test_basic_s3.py::test_get_object_stream_context tests/test_batch.py::test_batch tests/test_basic_s3.py::test_copy_with_quoted_char tests/test_basic_s3.py::test_non_normalized_key_paths tests/test_basic_s3.py::test_head_object_keys[s3v4] [gw4] [ 9%] PASSED tests/test_basic_s3.py::test_can_copy_with_dict_form_with_version [gw2] [ 10%] PASSED tests/test_basic_s3.py::test_can_copy_with_dict_form tests/test_basic_s3.py::test_copy_with_s3_metadata [gw0] [ 10%] PASSED tests/test_basic_s3.py::test_non_normalized_key_paths [gw1] [ 11%] PASSED tests/test_basic_s3.py::test_copy_with_quoted_char [gw6] [ 11%] PASSED tests/test_basic_s3.py::test_head_object_keys[s3v4] tests/test_config.py::test_merge [gw4] [ 12%] PASSED tests/test_config.py::test_merge tests/test_eventstreams.py::test_eventstream_chunking tests/test_config.py::test_get_session [gw2] [ 13%] PASSED tests/test_config.py::test_get_session tests/test_ec2.py::test_ec2_snapshot [gw5] [ 13%] PASSED tests/test_basic_s3.py::test_copy_with_s3_metadata tests/test_config.py::test_connector_args [gw0] [ 14%] PASSED tests/test_config.py::test_connector_args tests/test_dynamodb.py::test_delete_table[v4] tests/test_config.py::test_connector_timeout tests/test_dynamodb.py::test_create_waiter[v4] [gw4] [ 15%] PASSED tests/test_eventstreams.py::test_eventstream_chunking [gw7] [ 15%] PASSED tests/test_batch.py::test_batch tests/test_dynamodb.py::test_get_item[v4] tests/test_patches.py::test_protocol_parsers [gw4] [ 16%] PASSED tests/test_patches.py::test_protocol_parsers tests/test_patches.py::test_patches [gw0] [ 16%] PASSED tests/test_dynamodb.py::test_delete_table[v4] [gw6] [ 17%] PASSED tests/test_dynamodb.py::test_create_waiter[v4] tests/test_dynamodb.py::test_batch_write_scan[v4] [gw4] [ 18%] PASSED tests/test_patches.py::test_patches tests/test_response.py::test_streaming_wrapper_validates_content_length [gw4] [ 18%] PASSED tests/test_response.py::test_streaming_wrapper_validates_content_length tests/test_response.py::test_streaming_body_with_invalid_length [gw4] [ 19%] PASSED tests/test_response.py::test_streaming_body_with_invalid_length tests/test_response.py::test_streaming_body_with_zero_read [gw4] [ 20%] PASSED tests/test_response.py::test_streaming_body_with_zero_read tests/test_response.py::test_streaming_body_with_single_read [gw2] [ 20%] PASSED tests/test_ec2.py::test_ec2_snapshot [gw4] [ 21%] PASSED tests/test_response.py::test_streaming_body_with_single_read tests/test_session.py::test_get_service_data [gw4] [ 21%] PASSED tests/test_session.py::test_get_service_data tests/test_session.py::test_retry [gw5] [ 22%] PASSED tests/test_dynamodb.py::test_get_item[v4] tests/test_response.py::test_streaming_line_iterator_ends_newline [gw0] [ 23%] PASSED tests/test_response.py::test_streaming_line_iterator_ends_newline tests/test_response.py::test_streaming_line_iter_chunk_sizes [gw0] [ 23%] PASSED tests/test_response.py::test_streaming_line_iter_chunk_sizes tests/test_response.py::test_streaming_body_is_an_iterator tests/test_lambda.py::test_run_lambda [gw0] [ 24%] PASSED tests/test_response.py::test_streaming_body_is_an_iterator tests/test_response.py::test_streaming_line_abstruse_newline_standard [gw0] [ 25%] PASSED tests/test_response.py::test_streaming_line_abstruse_newline_standard tests/test_response.py::test_streaming_line_empty_body [gw0] [ 25%] PASSED tests/test_response.py::test_streaming_line_empty_body tests/test_sqs.py::test_put_pull_delete_test tests/test_response.py::test_streaming_body_closes [gw2] [ 26%] PASSED tests/test_response.py::test_streaming_body_closes tests/test_response.py::test_default_iter_behavior [gw2] [ 26%] PASSED tests/test_response.py::test_default_iter_behavior tests/test_response.py::test_iter_chunks_single_byte [gw2] [ 27%] PASSED tests/test_response.py::test_iter_chunks_single_byte tests/test_response.py::test_iter_chunks_with_leftover [gw2] [ 28%] PASSED tests/test_response.py::test_iter_chunks_with_leftover tests/test_response.py::test_iter_chunks_single_chunk [gw2] [ 28%] PASSED tests/test_response.py::test_iter_chunks_single_chunk tests/test_response.py::test_streaming_line_iterator [gw2] [ 29%] PASSED tests/test_response.py::test_streaming_line_iterator tests/boto_tests/test_credentials.py::test_credentials_normalization[foo\xe2\x80\x99-bar\xe2\x80\x99] [gw2] [ 30%] PASSED tests/boto_tests/test_credentials.py::test_credentials_normalization[foo\xe2\x80\x99-bar\xe2\x80\x99] tests/boto_tests/test_credentials.py::test_credentials_normalization[foo-bar] [gw2] [ 30%] PASSED tests/boto_tests/test_credentials.py::test_credentials_normalization[foo-bar] tests/boto_tests/test_credentials.py::test_assumerolefetcher_no_cache [gw2] [ 31%] PASSED tests/boto_tests/test_credentials.py::test_assumerolefetcher_no_cache tests/boto_tests/test_credentials.py::test_assumerolefetcher_cache_key_with_role_session_name [gw2] [ 31%] PASSED tests/boto_tests/test_credentials.py::test_assumerolefetcher_cache_key_with_role_session_name tests/boto_tests/test_credentials.py::test_assumerolefetcher_cache_in_cache_but_expired [gw2] [ 32%] PASSED tests/boto_tests/test_credentials.py::test_assumerolefetcher_cache_in_cache_but_expired tests/boto_tests/test_credentials.py::test_assumerolefetcher_mfa [gw2] [ 33%] PASSED tests/boto_tests/test_credentials.py::test_assumerolefetcher_mfa tests/boto_tests/test_credentials.py::test_recursive_assume_role [gw2] [ 33%] PASSED tests/boto_tests/test_credentials.py::test_recursive_assume_role tests/boto_tests/test_credentials.py::test_webidentfetcher_no_cache [gw2] [ 34%] PASSED tests/boto_tests/test_credentials.py::test_webidentfetcher_no_cache tests/boto_tests/test_credentials.py::test_credresolver_load_credentials_single_provider [gw7] [ 35%] PASSED tests/test_dynamodb.py::test_batch_write_scan[v4] [gw2] [ 35%] PASSED tests/boto_tests/test_credentials.py::test_credresolver_load_credentials_single_provider tests/boto_tests/test_credentials.py::test_credresolver_no_providers [gw2] [ 36%] PASSED tests/boto_tests/test_credentials.py::test_credresolver_no_providers tests/boto_tests/test_credentials.py::test_canonicalsourceprovider_source_creds [gw2] [ 36%] PASSED tests/boto_tests/test_credentials.py::test_canonicalsourceprovider_source_creds tests/boto_tests/test_credentials.py::test_canonicalsourceprovider_source_creds_case_insensitive [gw2] [ 37%] PASSED tests/boto_tests/test_credentials.py::test_canonicalsourceprovider_source_creds_case_insensitive tests/boto_tests/test_credentials.py::test_assumerolecredprovider_assume_role_no_cache [gw2] [ 38%] PASSED tests/boto_tests/test_credentials.py::test_assumerolecredprovider_assume_role_no_cache tests/boto_tests/test_credentials.py::test_assumerolecredprovider_mfa [gw2] [ 38%] PASSED tests/boto_tests/test_credentials.py::test_assumerolecredprovider_mfa tests/boto_tests/test_credentials.py::test_assumerolecredprovider_mfa_cannot_refresh_credentials [gw2] [ 39%] PASSED tests/boto_tests/test_credentials.py::test_assumerolecredprovider_mfa_cannot_refresh_credentials tests/boto_tests/test_credentials.py::test_assumerolewebidentprovider_no_cache [gw2] [ 40%] PASSED tests/boto_tests/test_credentials.py::test_assumerolewebidentprovider_no_cache tests/boto_tests/test_credentials.py::test_envvarprovider_env_var_present [gw2] [ 40%] PASSED tests/boto_tests/test_credentials.py::test_envvarprovider_env_var_present tests/boto_tests/test_credentials.py::test_envvarprovider_env_var_absent [gw2] [ 41%] PASSED tests/boto_tests/test_credentials.py::test_envvarprovider_env_var_absent tests/boto_tests/test_credentials.py::test_envvarprovider_env_var_expiry [gw2] [ 41%] PASSED tests/boto_tests/test_credentials.py::test_envvarprovider_env_var_expiry tests/boto_tests/test_credentials.py::test_configprovider_file_exists [gw2] [ 42%] PASSED tests/boto_tests/test_credentials.py::test_configprovider_file_exists tests/boto_tests/test_credentials.py::test_configprovider_file_missing_profile [gw2] [ 43%] PASSED tests/boto_tests/test_credentials.py::test_configprovider_file_missing_profile tests/test_eventstreams.py::test_eventstream_no_iter tests/boto_tests/test_credentials.py::test_sharedcredentials_file_exists [gw2] [ 43%] PASSED tests/boto_tests/test_credentials.py::test_sharedcredentials_file_exists tests/boto_tests/test_credentials.py::test_sharedcredentials_file_missing [gw2] [ 44%] PASSED tests/boto_tests/test_credentials.py::test_sharedcredentials_file_missing tests/boto_tests/test_credentials.py::test_botoprovider_file_exists [gw2] [ 45%] PASSED tests/boto_tests/test_credentials.py::test_botoprovider_file_exists tests/boto_tests/test_credentials.py::test_createcredentialresolver [gw2] [ 45%] PASSED tests/boto_tests/test_credentials.py::test_createcredentialresolver tests/boto_tests/test_credentials.py::test_from_aiocredentials_is_none [gw2] [ 46%] PASSED tests/boto_tests/test_credentials.py::test_from_aiocredentials_is_none tests/boto_tests/test_credentials.py::test_sso_credential_fetcher_can_fetch_credentials [gw4] [ 46%] PASSED tests/test_session.py::test_retry tests/test_sns.py::test_topic_attributes [gw0] [ 47%] PASSED tests/test_sqs.py::test_put_pull_delete_test tests/test_monitor.py::test_monitor_response_received [gw5] [ 48%] PASSED tests/test_eventstreams.py::test_eventstream_no_iter tests/test_sqs.py::test_put_pull_wait [gw4] [ 48%] PASSED tests/test_sns.py::test_topic_attributes tests/boto_tests/test_credentials.py::test_botoprovider_file_missing [gw5] [ 49%] PASSED tests/boto_tests/test_credentials.py::test_botoprovider_file_missing tests/boto_tests/test_credentials.py::test_originalec2provider_file_exists [gw5] [ 50%] PASSED tests/boto_tests/test_credentials.py::test_originalec2provider_file_exists tests/boto_tests/test_credentials.py::test_originalec2provider_file_missing [gw5] [ 50%] PASSED tests/boto_tests/test_credentials.py::test_originalec2provider_file_missing tests/boto_tests/test_credentials.py::test_required_config_not_set [gw7] [ 51%] PASSED tests/test_monitor.py::test_monitor_response_received tests/test_sns.py::test_creating_subscription [gw2] [ 51%] ERROR tests/boto_tests/test_credentials.py::test_sso_credential_fetcher_can_fetch_credentials tests/boto_tests/test_credentials.py::test_sso_cred_fetcher_raises_helpful_message_on_unauthorized_exception [gw4] [ 52%] PASSED tests/test_sns.py::test_creating_subscription tests/boto_tests/test_credentials.py::test_load_sso_credentials_with_cache [gw1] [ 53%] PASSED tests/test_config.py::test_connector_timeout tests/test_dynamodb.py::test_waiter_table_exists_failure[v4] tests/boto_tests/test_utils.py::test_idmsfetcher_disabled [gw4] [ 53%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_disabled tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_success [gw4] [ 54%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_success tests/boto_tests/test_utils.py::test_idmsfetcher_retry [gw4] [ 55%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_retry tests/boto_tests/test_utils.py::test_idmsfetcher_timeout [gw4] [ 55%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_timeout tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_get_credentials_set [gw4] [ 56%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_get_credentials_set tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_empty_dict [gw4] [ 56%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_empty_dict tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_none [gw4] [ 57%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_none tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_partial [gw4] [ 58%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_partial tests/python3.8/boto_tests/test_credentials.py::test_deferrablecredentials_get_credentials_set [gw4] [ 58%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_deferrablecredentials_get_credentials_set tests/python3.8/boto_tests/test_credentials.py::test_deferrablecredentials_refresh_only_called_once [gw4] [ 59%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_deferrablecredentials_refresh_only_called_once tests/python3.8/boto_tests/test_credentials.py::test_instancemetadata_load [gw4] [ 60%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_instancemetadata_load tests/python3.8/boto_tests/test_credentials.py::test_containerprovider_assume_role_no_cache [gw4] [ 60%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_containerprovider_assume_role_no_cache tests/python3.8/boto_tests/test_credentials.py::test_processprovider_retrieve_refereshable_creds [gw4] [ 61%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_processprovider_retrieve_refereshable_creds tests/python3.8/boto_tests/test_credentials.py::test_processprovider_retrieve_creds [gw4] [ 61%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_processprovider_retrieve_creds tests/python3.8/boto_tests/test_credentials.py::test_processprovider_bad_version [gw4] [ 62%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_processprovider_bad_version tests/python3.8/boto_tests/test_credentials.py::test_processprovider_missing_field [gw4] [ 63%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_processprovider_missing_field tests/python3.8/boto_tests/test_credentials.py::test_processprovider_bad_exitcode [gw4] [ 63%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_processprovider_bad_exitcode tests/python3.8/boto_tests/test_credentials.py::test_processprovider_bad_config [gw4] [ 64%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_processprovider_bad_config tests/python3.8/boto_tests/test_credentials.py::test_session_credentials [gw4] [ 65%] PASSED tests/python3.8/boto_tests/test_credentials.py::test_session_credentials tests/python3.8/boto_tests/test_signers.py::test_signers_generate_presigned_urls [gw4] [ 65%] PASSED tests/python3.8/boto_tests/test_signers.py::test_signers_generate_presigned_urls tests/python3.8/boto_tests/test_signers.py::test_signers_generate_presigned_post [gw4] [ 66%] PASSED tests/python3.8/boto_tests/test_signers.py::test_signers_generate_presigned_post tests/python3.8/boto_tests/test_signers.py::test_testsigner_get_auth [gw4] [ 66%] PASSED tests/python3.8/boto_tests/test_signers.py::test_testsigner_get_auth tests/python3.8/boto_tests/test_signers.py::test_testsigner_region_required_for_sig4 [gw4] [ 67%] PASSED tests/python3.8/boto_tests/test_signers.py::test_testsigner_region_required_for_sig4 tests/python3.8/boto_tests/test_signers.py::test_testsigner_custom_sign_version [gw4] [ 68%] PASSED tests/python3.8/boto_tests/test_signers.py::test_testsigner_custom_sign_version tests/python3.8/boto_tests/test_signers.py::test_testsigner_choose_signer_override [gw4] [ 68%] PASSED tests/python3.8/boto_tests/test_signers.py::test_testsigner_choose_signer_override tests/python3.8/boto_tests/test_signers.py::test_testsigner_generate_presigned_url [gw4] [ 69%] PASSED tests/python3.8/boto_tests/test_signers.py::test_testsigner_generate_presigned_url tests/python3.8/boto_tests/test_signers.py::test_testsigner_generate_presigned_post [gw4] [ 70%] PASSED tests/python3.8/boto_tests/test_signers.py::test_testsigner_generate_presigned_post tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_disabled_by_environment [gw4] [ 70%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_disabled_by_environment tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_disabled_by_environment_mixed_case [gw4] [ 71%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_disabled_by_environment_mixed_case tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_disabling_env_var_not_true [gw4] [ 71%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_disabling_env_var_not_true tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_empty_response_for_role_name_is_retried [gw4] [ 72%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_empty_response_for_role_name_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_empty_response_is_retried [gw4] [ 73%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_empty_response_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_exhaust_retries_on_credentials_request [gw4] [ 73%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_exhaust_retries_on_credentials_request tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_exhaust_retries_on_role_name_request [gw4] [ 74%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_exhaust_retries_on_role_name_request [gw5] [ 75%] ERROR tests/boto_tests/test_credentials.py::test_required_config_not_set tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_http_connection_error_for_role_name_is_retried tests/boto_tests/test_signers.py::test_signers_generate_db_auth_token [gw4] [ 75%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_http_connection_error_for_role_name_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_http_connection_errors_is_retried [gw4] [ 76%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_http_connection_errors_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_invalid_json_is_retried [gw4] [ 76%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_invalid_json_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_bad_request_yields_no_credentials [gw4] [ 77%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_bad_request_yields_no_credentials tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_403 [gw1] [ 78%] PASSED tests/test_dynamodb.py::test_waiter_table_exists_failure[v4] [gw4] [ 78%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_403 tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_404 [gw4] [ 79%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_404 tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_405 [gw4] [ 80%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_405 tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_timeout [gw4] [ 80%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_metadata_token_not_supported_timeout tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_missing_fields_in_credentials_response [gw4] [ 81%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_missing_fields_in_credentials_response tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_non_200_response_for_role_name_is_retried [gw4] [ 81%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_non_200_response_for_role_name_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_non_200_response_is_retried [gw4] [ 82%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_non_200_response_is_retried tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_token_is_included [gw4] [ 83%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_token_is_included tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_token_not_supported_exhaust_retries [gw4] [ 83%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_token_not_supported_exhaust_retries tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url [gw4] [ 84%] PASSED tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url_bad_status [gw4] [ 85%] PASSED tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url_bad_status tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url_not_json [gw4] [ 85%] PASSED tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url_not_json /usr/lib/python3.10/abc.py:123: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._text' was never awaited return _abc_subclasscheck(cls, subclass) RuntimeWarning: Enable tracemalloc to get the object allocation traceback [gw2] [ 86%] ERROR tests/boto_tests/test_credentials.py::test_sso_cred_fetcher_raises_helpful_message_on_unauthorized_exception tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_not_found [gw2] [ 86%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_not_found tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_bad_request [gw2] [ 87%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_bad_request /usr/lib/python3.10/posixpath.py:528: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._content' was never awaited split_paths = [[c for c in s if c and c != curdir] for s in split_paths] RuntimeWarning: Enable tracemalloc to get the object allocation traceback /usr/lib/python3.10/posixpath.py:528: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._text' was never awaited split_paths = [[c for c in s if c and c != curdir] for s in split_paths] RuntimeWarning: Enable tracemalloc to get the object allocation traceback [gw7] [ 88%] ERROR tests/boto_tests/test_credentials.py::test_load_sso_credentials_with_cache tests/boto_tests/test_credentials.py::test_load_sso_credentials_with_cache_expired [gw0] [ 88%] PASSED tests/test_sqs.py::test_put_pull_wait tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_timeout [gw1] [ 89%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_timeout tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_retry [gw1] [ 90%] PASSED tests/boto_tests/test_utils.py::test_idmsfetcher_get_token_retry /usr/lib/python3.10/posixpath.py:528: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._content' was never awaited split_paths = [[c for c in s if c and c != curdir] for s in split_paths] RuntimeWarning: Enable tracemalloc to get the object allocation traceback /usr/lib/python3.10/posixpath.py:528: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._text' was never awaited split_paths = [[c for c in s if c and c != curdir] for s in split_paths] RuntimeWarning: Enable tracemalloc to get the object allocation traceback tests/test_version.py::test_release_versions [gw5] [ 90%] PASSED tests/boto_tests/test_signers.py::test_signers_generate_db_auth_token [gw3] [ 91%] PASSED tests/test_basic_s3.py::test_fail_proxy_request tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_includes_user_agent_header [gw5] [ 91%] PASSED tests/python3.8/boto_tests/test_utils.py::TestInstanceMetadataFetcher::test_includes_user_agent_header tests/test_basic_s3.py::test_can_get_and_put_object [gw7] [ 92%] ERROR tests/boto_tests/test_credentials.py::test_load_sso_credentials_with_cache_expired [gw0] [ 93%] PASSED tests/test_version.py::test_release_versions tests/test_waiter.py::test_sqs [gw3] [ 93%] PASSED tests/test_basic_s3.py::test_can_get_and_put_object tests/test_basic_s3.py::test_copy_with_query_string [gw3] [ 94%] PASSED tests/test_basic_s3.py::test_copy_with_query_string tests/test_config.py::test_connector_timeout2 [gw3] [ 95%] PASSED tests/test_config.py::test_connector_timeout2 tests/test_dynamodb.py::test_waiter_table_exists[v4] [gw0] [ 95%] PASSED tests/test_waiter.py::test_sqs [gw6] [ 96%] PASSED tests/test_lambda.py::test_run_lambda tests/test_sns.py::test_publish_to_http [gw6] [ 96%] PASSED tests/test_sns.py::test_publish_to_http [gw3] [ 97%] PASSED tests/test_dynamodb.py::test_waiter_table_exists[v4] tests/test_sns.py::test_get_missing_endpoint_attributes [gw6] [ 98%] PASSED tests/test_sns.py::test_get_missing_endpoint_attributes tests/test_sns.py::test_platform_applications [gw6] [ 98%] PASSED tests/test_sns.py::test_platform_applications tests/test_sqs.py::test_list_queues [gw6] [ 99%] PASSED tests/test_sqs.py::test_list_queues tests/test_sqs.py::test_get_queue_name [gw6] [100%] PASSED tests/test_sqs.py::test_get_queue_name =================================================================================== ERRORS =================================================================================== ____________________________________________________ ERROR at setup of test_sso_credential_fetcher_can_fetch_credentials _____________________________________________________ [gw2] linux -- Python 3.10.5 /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/bin/python self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: with CeilTimeout(timeout.sock_connect): > return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:969: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol_factory = functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>) host = '169.254.169.254', port = 80 async def create_connection( self, protocol_factory, host=None, port=None, *, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None, happy_eyeballs_delay=None, interleave=None): """Connect to a TCP server. Create a streaming transport connection to a given internet host and port: socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_STREAM. protocol_factory must be a callable returning a protocol instance. This method is a coroutine which will try to establish the connection in the background. When successful, the coroutine returns a (transport, protocol) pair. """ if server_hostname is not None and not ssl: raise ValueError('server_hostname is only meaningful with ssl') if server_hostname is None and ssl: # Use host as default for server_hostname. It is an error # if host is empty or not set, e.g. when an # already-connected socket was passed or when only a port # is given. To avoid this error, you can pass # server_hostname='' -- this will bypass the hostname # check. (This also means that if host is a numeric # IP/IPv6 address, we will attempt to verify that exact # address; this will probably fail, but it is possible to # create a certificate for a specific IP address, so we # don't judge it here.) if not host: raise ValueError('You must set server_hostname ' 'when using ssl without a host') server_hostname = host if ssl_handshake_timeout is not None and not ssl: raise ValueError( 'ssl_handshake_timeout is only meaningful with ssl') if sock is not None: _check_ssl_socket(sock) if happy_eyeballs_delay is not None and interleave is None: # If using happy eyeballs, default to interleave addresses by family interleave = 1 if host is not None or port is not None: if sock is not None: raise ValueError( 'host/port and sock can not be specified at the same time') infos = await self._ensure_resolved( (host, port), family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not infos: raise OSError('getaddrinfo() returned empty list') if local_addr is not None: laddr_infos = await self._ensure_resolved( local_addr, family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not laddr_infos: raise OSError('getaddrinfo() returned empty list') else: laddr_infos = None if interleave: infos = _interleave_addrinfos(infos, interleave) exceptions = [] if happy_eyeballs_delay is None: # not using happy eyeballs for addrinfo in infos: try: > sock = await self._connect_sock( exceptions, addrinfo, laddr_infos) /usr/lib/python3.10/asyncio/base_events.py:1049: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, exceptions = [[]] addr_info = (, , 6, '', ('169.254.169.254', 80)), local_addr_infos = None async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None): """Create, bind and connect one socket.""" my_exceptions = [] exceptions.append(my_exceptions) family, type_, proto, _, address = addr_info sock = None try: sock = socket.socket(family=family, type=type_, proto=proto) sock.setblocking(False) if local_addr_infos is not None: for _, _, _, _, laddr in local_addr_infos: try: sock.bind(laddr) break except OSError as exc: msg = ( f'error while attempting to bind on ' f'address {laddr!r}: ' f'{exc.strerror.lower()}' ) exc = OSError(exc.errno, msg) my_exceptions.append(exc) else: # all bind attempts failed raise my_exceptions.pop() > await self.sock_connect(sock, address) /usr/lib/python3.10/asyncio/base_events.py:960: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> sock = , address = ('169.254.169.254', 80) async def sock_connect(self, sock, address): """Connect to a remote socket at address. This method is a coroutine. """ base_events._check_ssl_socket(sock) if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") if sock.family == socket.AF_INET or ( base_events._HAS_IPv6 and sock.family == socket.AF_INET6): resolved = await self._ensure_resolved( address, family=sock.family, type=sock.type, proto=sock.proto, loop=self, ) _, _, _, _, address = resolved[0] fut = self.create_future() self._sock_connect(fut, sock, address) > return await fut E asyncio.exceptions.CancelledError /usr/lib/python3.10/asyncio/selector_events.py:500: CancelledError During handling of the above exception, another exception occurred: self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None > conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def connect( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> Connection: """Get from pool or create new connection.""" key = req.connection_key available = self._available_connections(key) # Wait if there are no available connections or if there are/were # waiters (i.e. don't steal connection from a waiter about to wake up) if available <= 0 or key in self._waiters: fut = self._loop.create_future() # This connection will now count towards the limit. self._waiters[key].append(fut) if traces: for trace in traces: await trace.send_connection_queued_start() try: await fut except BaseException as e: if key in self._waiters: # remove a waiter even if it was cancelled, normally it's # removed when it's notified try: self._waiters[key].remove(fut) except ValueError: # fut may no longer be in list pass raise e finally: if key in self._waiters and not self._waiters[key]: del self._waiters[key] if traces: for trace in traces: await trace.send_connection_queued_end() proto = self._get(key) if proto is None: placeholder = cast(ResponseHandler, _TransportPlaceholder()) self._acquired.add(placeholder) self._acquired_per_host[key].add(placeholder) if traces: for trace in traces: await trace.send_connection_create_start() try: > proto = await self._create_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> ResponseHandler: """Create connection. Has same keyword arguments as BaseEventLoop.create_connection. """ if req.proxy: _, proto = await self._create_proxy_connection(req, traces, timeout) else: > _, proto = await self._create_direct_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:892: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself raise ClientConnectorError(req.connection_key, exc) from exc last_exc = None # type: Optional[Exception] for hinfo in hosts: host = hinfo["host"] port = hinfo["port"] try: > transp, proto = await self._wrap_create_connection( self._factory, host, port, timeout=timeout, ssl=sslcontext, family=hinfo["family"], proto=hinfo["proto"], flags=hinfo["flags"], server_hostname=hinfo["hostname"] if sslcontext else None, local_addr=self._local_addr, req=req, client_error=client_error, ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:1020: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: > with CeilTimeout(timeout.sock_connect): /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:968: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = , exc_val = CancelledError() exc_tb = def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> Optional[bool]: > self._do_exit(exc_type) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = def _do_exit(self, exc_type: Type[BaseException]) -> None: if exc_type is asyncio.CancelledError and self._cancelled: self._cancel_handler = None self._task = None > raise asyncio.TimeoutError E asyncio.exceptions.TimeoutError /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:92: TimeoutError The above exception was the direct cause of the following exception: self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) > response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) aiobotocore/httpsession.py:178: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) except asyncio.TimeoutError as exc: > raise ServerTimeoutError( "Connection timeout " "to host {}".format(url) ) from exc E aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host http://169.254.169.254/latest/api/token /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:524: ServerTimeoutError During handling of the above exception, another exception occurred: @pytest.fixture async def ssl_credential_fetcher_setup(): > async with AioSession().create_client('sso', region_name='us-east-1') as sso: tests/boto_tests/test_credentials.py:866: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiobotocore/session.py:22: in __aenter__ self._client = await self._coro aiobotocore/session.py:102: in _create_client credentials = await self.get_credentials() aiobotocore/session.py:133: in get_credentials self._credentials = await (self._components.get_component( aiobotocore/credentials.py:814: in load_credentials creds = await provider.load() aiobotocore/credentials.py:486: in load metadata = await fetcher.retrieve_iam_role_credentials() aiobotocore/utils.py:175: in retrieve_iam_role_credentials token = await self._fetch_metadata_token() aiobotocore/utils.py:88: in _fetch_metadata_token response = await session.send(request.prepare()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) http_response = aiobotocore.awsrequest.AioAWSResponse( str(response.url), response.status, response.headers, response ) if not request.stream_output: # Cause the raw stream to be exhausted immediately. We do it # this way instead of using preload_content because # preload_content will never buffer chunked responses await http_response.content return http_response except ClientSSLError as e: raise SSLError(endpoint_url=request.url, error=e) except (ClientProxyConnectionError, ClientHttpProxyError) as e: raise ProxyConnectionError(proxy_url=mask_proxy_url(proxy_url), error=e) except (ServerDisconnectedError, aiohttp.ClientPayloadError, aiohttp.http_exceptions.BadStatusLine) as e: raise ConnectionClosedError( error=e, request=request, endpoint_url=request.url ) except ServerTimeoutError as e: if str(e).lower().startswith('connect'): > raise ConnectTimeoutError(endpoint_url=request.url, error=e) E botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.254/latest/api/token" aiobotocore/httpsession.py:210: ConnectTimeoutError ----------------------------------------------------------------------------- Captured log setup ----------------------------------------------------------------------------- DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector DEBUG botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane DEBUG botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53 DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG botocore.utils:utils.py:420 IMDS ENDPOINT: http://169.254.169.254/ DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: env DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role-with-web-identity DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: sso DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: shared-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: custom-process DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: config-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: ec2-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: boto-config DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: container-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: iam-role _______________________________________________________________ ERROR at setup of test_required_config_not_set _______________________________________________________________ [gw5] linux -- Python 3.10.5 /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/bin/python self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: with CeilTimeout(timeout.sock_connect): > return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:969: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol_factory = functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>) host = '169.254.169.254', port = 80 async def create_connection( self, protocol_factory, host=None, port=None, *, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None, happy_eyeballs_delay=None, interleave=None): """Connect to a TCP server. Create a streaming transport connection to a given internet host and port: socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_STREAM. protocol_factory must be a callable returning a protocol instance. This method is a coroutine which will try to establish the connection in the background. When successful, the coroutine returns a (transport, protocol) pair. """ if server_hostname is not None and not ssl: raise ValueError('server_hostname is only meaningful with ssl') if server_hostname is None and ssl: # Use host as default for server_hostname. It is an error # if host is empty or not set, e.g. when an # already-connected socket was passed or when only a port # is given. To avoid this error, you can pass # server_hostname='' -- this will bypass the hostname # check. (This also means that if host is a numeric # IP/IPv6 address, we will attempt to verify that exact # address; this will probably fail, but it is possible to # create a certificate for a specific IP address, so we # don't judge it here.) if not host: raise ValueError('You must set server_hostname ' 'when using ssl without a host') server_hostname = host if ssl_handshake_timeout is not None and not ssl: raise ValueError( 'ssl_handshake_timeout is only meaningful with ssl') if sock is not None: _check_ssl_socket(sock) if happy_eyeballs_delay is not None and interleave is None: # If using happy eyeballs, default to interleave addresses by family interleave = 1 if host is not None or port is not None: if sock is not None: raise ValueError( 'host/port and sock can not be specified at the same time') infos = await self._ensure_resolved( (host, port), family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not infos: raise OSError('getaddrinfo() returned empty list') if local_addr is not None: laddr_infos = await self._ensure_resolved( local_addr, family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not laddr_infos: raise OSError('getaddrinfo() returned empty list') else: laddr_infos = None if interleave: infos = _interleave_addrinfos(infos, interleave) exceptions = [] if happy_eyeballs_delay is None: # not using happy eyeballs for addrinfo in infos: try: > sock = await self._connect_sock( exceptions, addrinfo, laddr_infos) /usr/lib/python3.10/asyncio/base_events.py:1049: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, exceptions = [[]] addr_info = (, , 6, '', ('169.254.169.254', 80)), local_addr_infos = None async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None): """Create, bind and connect one socket.""" my_exceptions = [] exceptions.append(my_exceptions) family, type_, proto, _, address = addr_info sock = None try: sock = socket.socket(family=family, type=type_, proto=proto) sock.setblocking(False) if local_addr_infos is not None: for _, _, _, _, laddr in local_addr_infos: try: sock.bind(laddr) break except OSError as exc: msg = ( f'error while attempting to bind on ' f'address {laddr!r}: ' f'{exc.strerror.lower()}' ) exc = OSError(exc.errno, msg) my_exceptions.append(exc) else: # all bind attempts failed raise my_exceptions.pop() > await self.sock_connect(sock, address) /usr/lib/python3.10/asyncio/base_events.py:960: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> sock = , address = ('169.254.169.254', 80) async def sock_connect(self, sock, address): """Connect to a remote socket at address. This method is a coroutine. """ base_events._check_ssl_socket(sock) if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") if sock.family == socket.AF_INET or ( base_events._HAS_IPv6 and sock.family == socket.AF_INET6): resolved = await self._ensure_resolved( address, family=sock.family, type=sock.type, proto=sock.proto, loop=self, ) _, _, _, _, address = resolved[0] fut = self.create_future() self._sock_connect(fut, sock, address) > return await fut E asyncio.exceptions.CancelledError /usr/lib/python3.10/asyncio/selector_events.py:500: CancelledError During handling of the above exception, another exception occurred: self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None > conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def connect( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> Connection: """Get from pool or create new connection.""" key = req.connection_key available = self._available_connections(key) # Wait if there are no available connections or if there are/were # waiters (i.e. don't steal connection from a waiter about to wake up) if available <= 0 or key in self._waiters: fut = self._loop.create_future() # This connection will now count towards the limit. self._waiters[key].append(fut) if traces: for trace in traces: await trace.send_connection_queued_start() try: await fut except BaseException as e: if key in self._waiters: # remove a waiter even if it was cancelled, normally it's # removed when it's notified try: self._waiters[key].remove(fut) except ValueError: # fut may no longer be in list pass raise e finally: if key in self._waiters and not self._waiters[key]: del self._waiters[key] if traces: for trace in traces: await trace.send_connection_queued_end() proto = self._get(key) if proto is None: placeholder = cast(ResponseHandler, _TransportPlaceholder()) self._acquired.add(placeholder) self._acquired_per_host[key].add(placeholder) if traces: for trace in traces: await trace.send_connection_create_start() try: > proto = await self._create_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> ResponseHandler: """Create connection. Has same keyword arguments as BaseEventLoop.create_connection. """ if req.proxy: _, proto = await self._create_proxy_connection(req, traces, timeout) else: > _, proto = await self._create_direct_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:892: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself raise ClientConnectorError(req.connection_key, exc) from exc last_exc = None # type: Optional[Exception] for hinfo in hosts: host = hinfo["host"] port = hinfo["port"] try: > transp, proto = await self._wrap_create_connection( self._factory, host, port, timeout=timeout, ssl=sslcontext, family=hinfo["family"], proto=hinfo["proto"], flags=hinfo["flags"], server_hostname=hinfo["hostname"] if sslcontext else None, local_addr=self._local_addr, req=req, client_error=client_error, ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:1020: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: > with CeilTimeout(timeout.sock_connect): /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:968: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = , exc_val = CancelledError() exc_tb = def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> Optional[bool]: > self._do_exit(exc_type) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = def _do_exit(self, exc_type: Type[BaseException]) -> None: if exc_type is asyncio.CancelledError and self._cancelled: self._cancel_handler = None self._task = None > raise asyncio.TimeoutError E asyncio.exceptions.TimeoutError /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:92: TimeoutError The above exception was the direct cause of the following exception: self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) > response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) aiobotocore/httpsession.py:178: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) except asyncio.TimeoutError as exc: > raise ServerTimeoutError( "Connection timeout " "to host {}".format(url) ) from exc E aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host http://169.254.169.254/latest/api/token /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:524: ServerTimeoutError During handling of the above exception, another exception occurred: @pytest.fixture async def sso_provider_setup(): self = Self() > async with AioSession().create_client('sso', region_name='us-east-1') as sso: tests/boto_tests/test_credentials.py:1134: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiobotocore/session.py:22: in __aenter__ self._client = await self._coro aiobotocore/session.py:102: in _create_client credentials = await self.get_credentials() aiobotocore/session.py:133: in get_credentials self._credentials = await (self._components.get_component( aiobotocore/credentials.py:814: in load_credentials creds = await provider.load() aiobotocore/credentials.py:486: in load metadata = await fetcher.retrieve_iam_role_credentials() aiobotocore/utils.py:175: in retrieve_iam_role_credentials token = await self._fetch_metadata_token() aiobotocore/utils.py:88: in _fetch_metadata_token response = await session.send(request.prepare()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) http_response = aiobotocore.awsrequest.AioAWSResponse( str(response.url), response.status, response.headers, response ) if not request.stream_output: # Cause the raw stream to be exhausted immediately. We do it # this way instead of using preload_content because # preload_content will never buffer chunked responses await http_response.content return http_response except ClientSSLError as e: raise SSLError(endpoint_url=request.url, error=e) except (ClientProxyConnectionError, ClientHttpProxyError) as e: raise ProxyConnectionError(proxy_url=mask_proxy_url(proxy_url), error=e) except (ServerDisconnectedError, aiohttp.ClientPayloadError, aiohttp.http_exceptions.BadStatusLine) as e: raise ConnectionClosedError( error=e, request=request, endpoint_url=request.url ) except ServerTimeoutError as e: if str(e).lower().startswith('connect'): > raise ConnectTimeoutError(endpoint_url=request.url, error=e) E botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.254/latest/api/token" aiobotocore/httpsession.py:210: ConnectTimeoutError ----------------------------------------------------------------------------- Captured log setup ----------------------------------------------------------------------------- DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector DEBUG botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane DEBUG botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53 DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG botocore.utils:utils.py:420 IMDS ENDPOINT: http://169.254.169.254/ DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: env DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role-with-web-identity DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: sso DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: shared-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: custom-process DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: config-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: ec2-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: boto-config DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: container-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: iam-role __________________________________________ ERROR at setup of test_sso_cred_fetcher_raises_helpful_message_on_unauthorized_exception __________________________________________ [gw2] linux -- Python 3.10.5 /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/bin/python self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: with CeilTimeout(timeout.sock_connect): > return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:969: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol_factory = functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>) host = '169.254.169.254', port = 80 async def create_connection( self, protocol_factory, host=None, port=None, *, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None, happy_eyeballs_delay=None, interleave=None): """Connect to a TCP server. Create a streaming transport connection to a given internet host and port: socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_STREAM. protocol_factory must be a callable returning a protocol instance. This method is a coroutine which will try to establish the connection in the background. When successful, the coroutine returns a (transport, protocol) pair. """ if server_hostname is not None and not ssl: raise ValueError('server_hostname is only meaningful with ssl') if server_hostname is None and ssl: # Use host as default for server_hostname. It is an error # if host is empty or not set, e.g. when an # already-connected socket was passed or when only a port # is given. To avoid this error, you can pass # server_hostname='' -- this will bypass the hostname # check. (This also means that if host is a numeric # IP/IPv6 address, we will attempt to verify that exact # address; this will probably fail, but it is possible to # create a certificate for a specific IP address, so we # don't judge it here.) if not host: raise ValueError('You must set server_hostname ' 'when using ssl without a host') server_hostname = host if ssl_handshake_timeout is not None and not ssl: raise ValueError( 'ssl_handshake_timeout is only meaningful with ssl') if sock is not None: _check_ssl_socket(sock) if happy_eyeballs_delay is not None and interleave is None: # If using happy eyeballs, default to interleave addresses by family interleave = 1 if host is not None or port is not None: if sock is not None: raise ValueError( 'host/port and sock can not be specified at the same time') infos = await self._ensure_resolved( (host, port), family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not infos: raise OSError('getaddrinfo() returned empty list') if local_addr is not None: laddr_infos = await self._ensure_resolved( local_addr, family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not laddr_infos: raise OSError('getaddrinfo() returned empty list') else: laddr_infos = None if interleave: infos = _interleave_addrinfos(infos, interleave) exceptions = [] if happy_eyeballs_delay is None: # not using happy eyeballs for addrinfo in infos: try: > sock = await self._connect_sock( exceptions, addrinfo, laddr_infos) /usr/lib/python3.10/asyncio/base_events.py:1049: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, exceptions = [[]] addr_info = (, , 6, '', ('169.254.169.254', 80)), local_addr_infos = None async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None): """Create, bind and connect one socket.""" my_exceptions = [] exceptions.append(my_exceptions) family, type_, proto, _, address = addr_info sock = None try: sock = socket.socket(family=family, type=type_, proto=proto) sock.setblocking(False) if local_addr_infos is not None: for _, _, _, _, laddr in local_addr_infos: try: sock.bind(laddr) break except OSError as exc: msg = ( f'error while attempting to bind on ' f'address {laddr!r}: ' f'{exc.strerror.lower()}' ) exc = OSError(exc.errno, msg) my_exceptions.append(exc) else: # all bind attempts failed raise my_exceptions.pop() > await self.sock_connect(sock, address) /usr/lib/python3.10/asyncio/base_events.py:960: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> sock = , address = ('169.254.169.254', 80) async def sock_connect(self, sock, address): """Connect to a remote socket at address. This method is a coroutine. """ base_events._check_ssl_socket(sock) if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") if sock.family == socket.AF_INET or ( base_events._HAS_IPv6 and sock.family == socket.AF_INET6): resolved = await self._ensure_resolved( address, family=sock.family, type=sock.type, proto=sock.proto, loop=self, ) _, _, _, _, address = resolved[0] fut = self.create_future() self._sock_connect(fut, sock, address) > return await fut E asyncio.exceptions.CancelledError /usr/lib/python3.10/asyncio/selector_events.py:500: CancelledError During handling of the above exception, another exception occurred: self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None > conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def connect( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> Connection: """Get from pool or create new connection.""" key = req.connection_key available = self._available_connections(key) # Wait if there are no available connections or if there are/were # waiters (i.e. don't steal connection from a waiter about to wake up) if available <= 0 or key in self._waiters: fut = self._loop.create_future() # This connection will now count towards the limit. self._waiters[key].append(fut) if traces: for trace in traces: await trace.send_connection_queued_start() try: await fut except BaseException as e: if key in self._waiters: # remove a waiter even if it was cancelled, normally it's # removed when it's notified try: self._waiters[key].remove(fut) except ValueError: # fut may no longer be in list pass raise e finally: if key in self._waiters and not self._waiters[key]: del self._waiters[key] if traces: for trace in traces: await trace.send_connection_queued_end() proto = self._get(key) if proto is None: placeholder = cast(ResponseHandler, _TransportPlaceholder()) self._acquired.add(placeholder) self._acquired_per_host[key].add(placeholder) if traces: for trace in traces: await trace.send_connection_create_start() try: > proto = await self._create_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> ResponseHandler: """Create connection. Has same keyword arguments as BaseEventLoop.create_connection. """ if req.proxy: _, proto = await self._create_proxy_connection(req, traces, timeout) else: > _, proto = await self._create_direct_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:892: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself raise ClientConnectorError(req.connection_key, exc) from exc last_exc = None # type: Optional[Exception] for hinfo in hosts: host = hinfo["host"] port = hinfo["port"] try: > transp, proto = await self._wrap_create_connection( self._factory, host, port, timeout=timeout, ssl=sslcontext, family=hinfo["family"], proto=hinfo["proto"], flags=hinfo["flags"], server_hostname=hinfo["hostname"] if sslcontext else None, local_addr=self._local_addr, req=req, client_error=client_error, ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:1020: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: > with CeilTimeout(timeout.sock_connect): /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:968: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = , exc_val = CancelledError() exc_tb = def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> Optional[bool]: > self._do_exit(exc_type) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = def _do_exit(self, exc_type: Type[BaseException]) -> None: if exc_type is asyncio.CancelledError and self._cancelled: self._cancel_handler = None self._task = None > raise asyncio.TimeoutError E asyncio.exceptions.TimeoutError /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:92: TimeoutError The above exception was the direct cause of the following exception: self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) > response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) aiobotocore/httpsession.py:178: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) except asyncio.TimeoutError as exc: > raise ServerTimeoutError( "Connection timeout " "to host {}".format(url) ) from exc E aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host http://169.254.169.254/latest/api/token /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:524: ServerTimeoutError During handling of the above exception, another exception occurred: @pytest.fixture async def ssl_credential_fetcher_setup(): > async with AioSession().create_client('sso', region_name='us-east-1') as sso: tests/boto_tests/test_credentials.py:866: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiobotocore/session.py:22: in __aenter__ self._client = await self._coro aiobotocore/session.py:102: in _create_client credentials = await self.get_credentials() aiobotocore/session.py:133: in get_credentials self._credentials = await (self._components.get_component( aiobotocore/credentials.py:814: in load_credentials creds = await provider.load() aiobotocore/credentials.py:486: in load metadata = await fetcher.retrieve_iam_role_credentials() aiobotocore/utils.py:175: in retrieve_iam_role_credentials token = await self._fetch_metadata_token() aiobotocore/utils.py:88: in _fetch_metadata_token response = await session.send(request.prepare()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) http_response = aiobotocore.awsrequest.AioAWSResponse( str(response.url), response.status, response.headers, response ) if not request.stream_output: # Cause the raw stream to be exhausted immediately. We do it # this way instead of using preload_content because # preload_content will never buffer chunked responses await http_response.content return http_response except ClientSSLError as e: raise SSLError(endpoint_url=request.url, error=e) except (ClientProxyConnectionError, ClientHttpProxyError) as e: raise ProxyConnectionError(proxy_url=mask_proxy_url(proxy_url), error=e) except (ServerDisconnectedError, aiohttp.ClientPayloadError, aiohttp.http_exceptions.BadStatusLine) as e: raise ConnectionClosedError( error=e, request=request, endpoint_url=request.url ) except ServerTimeoutError as e: if str(e).lower().startswith('connect'): > raise ConnectTimeoutError(endpoint_url=request.url, error=e) E botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.254/latest/api/token" aiobotocore/httpsession.py:210: ConnectTimeoutError ----------------------------------------------------------------------------- Captured log setup ----------------------------------------------------------------------------- DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector DEBUG botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane DEBUG botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53 DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG botocore.utils:utils.py:420 IMDS ENDPOINT: http://169.254.169.254/ DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: env DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role-with-web-identity DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: sso DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: shared-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: custom-process DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: config-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: ec2-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: boto-config DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: container-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: iam-role ___________________________________________________________ ERROR at setup of test_load_sso_credentials_with_cache ___________________________________________________________ [gw7] linux -- Python 3.10.5 /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/bin/python self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: with CeilTimeout(timeout.sock_connect): > return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:969: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol_factory = functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>) host = '169.254.169.254', port = 80 async def create_connection( self, protocol_factory, host=None, port=None, *, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None, happy_eyeballs_delay=None, interleave=None): """Connect to a TCP server. Create a streaming transport connection to a given internet host and port: socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_STREAM. protocol_factory must be a callable returning a protocol instance. This method is a coroutine which will try to establish the connection in the background. When successful, the coroutine returns a (transport, protocol) pair. """ if server_hostname is not None and not ssl: raise ValueError('server_hostname is only meaningful with ssl') if server_hostname is None and ssl: # Use host as default for server_hostname. It is an error # if host is empty or not set, e.g. when an # already-connected socket was passed or when only a port # is given. To avoid this error, you can pass # server_hostname='' -- this will bypass the hostname # check. (This also means that if host is a numeric # IP/IPv6 address, we will attempt to verify that exact # address; this will probably fail, but it is possible to # create a certificate for a specific IP address, so we # don't judge it here.) if not host: raise ValueError('You must set server_hostname ' 'when using ssl without a host') server_hostname = host if ssl_handshake_timeout is not None and not ssl: raise ValueError( 'ssl_handshake_timeout is only meaningful with ssl') if sock is not None: _check_ssl_socket(sock) if happy_eyeballs_delay is not None and interleave is None: # If using happy eyeballs, default to interleave addresses by family interleave = 1 if host is not None or port is not None: if sock is not None: raise ValueError( 'host/port and sock can not be specified at the same time') infos = await self._ensure_resolved( (host, port), family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not infos: raise OSError('getaddrinfo() returned empty list') if local_addr is not None: laddr_infos = await self._ensure_resolved( local_addr, family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not laddr_infos: raise OSError('getaddrinfo() returned empty list') else: laddr_infos = None if interleave: infos = _interleave_addrinfos(infos, interleave) exceptions = [] if happy_eyeballs_delay is None: # not using happy eyeballs for addrinfo in infos: try: > sock = await self._connect_sock( exceptions, addrinfo, laddr_infos) /usr/lib/python3.10/asyncio/base_events.py:1049: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, exceptions = [[]] addr_info = (, , 6, '', ('169.254.169.254', 80)), local_addr_infos = None async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None): """Create, bind and connect one socket.""" my_exceptions = [] exceptions.append(my_exceptions) family, type_, proto, _, address = addr_info sock = None try: sock = socket.socket(family=family, type=type_, proto=proto) sock.setblocking(False) if local_addr_infos is not None: for _, _, _, _, laddr in local_addr_infos: try: sock.bind(laddr) break except OSError as exc: msg = ( f'error while attempting to bind on ' f'address {laddr!r}: ' f'{exc.strerror.lower()}' ) exc = OSError(exc.errno, msg) my_exceptions.append(exc) else: # all bind attempts failed raise my_exceptions.pop() > await self.sock_connect(sock, address) /usr/lib/python3.10/asyncio/base_events.py:960: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> sock = , address = ('169.254.169.254', 80) async def sock_connect(self, sock, address): """Connect to a remote socket at address. This method is a coroutine. """ base_events._check_ssl_socket(sock) if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") if sock.family == socket.AF_INET or ( base_events._HAS_IPv6 and sock.family == socket.AF_INET6): resolved = await self._ensure_resolved( address, family=sock.family, type=sock.type, proto=sock.proto, loop=self, ) _, _, _, _, address = resolved[0] fut = self.create_future() self._sock_connect(fut, sock, address) > return await fut E asyncio.exceptions.CancelledError /usr/lib/python3.10/asyncio/selector_events.py:500: CancelledError During handling of the above exception, another exception occurred: self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None > conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def connect( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> Connection: """Get from pool or create new connection.""" key = req.connection_key available = self._available_connections(key) # Wait if there are no available connections or if there are/were # waiters (i.e. don't steal connection from a waiter about to wake up) if available <= 0 or key in self._waiters: fut = self._loop.create_future() # This connection will now count towards the limit. self._waiters[key].append(fut) if traces: for trace in traces: await trace.send_connection_queued_start() try: await fut except BaseException as e: if key in self._waiters: # remove a waiter even if it was cancelled, normally it's # removed when it's notified try: self._waiters[key].remove(fut) except ValueError: # fut may no longer be in list pass raise e finally: if key in self._waiters and not self._waiters[key]: del self._waiters[key] if traces: for trace in traces: await trace.send_connection_queued_end() proto = self._get(key) if proto is None: placeholder = cast(ResponseHandler, _TransportPlaceholder()) self._acquired.add(placeholder) self._acquired_per_host[key].add(placeholder) if traces: for trace in traces: await trace.send_connection_create_start() try: > proto = await self._create_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> ResponseHandler: """Create connection. Has same keyword arguments as BaseEventLoop.create_connection. """ if req.proxy: _, proto = await self._create_proxy_connection(req, traces, timeout) else: > _, proto = await self._create_direct_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:892: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself raise ClientConnectorError(req.connection_key, exc) from exc last_exc = None # type: Optional[Exception] for hinfo in hosts: host = hinfo["host"] port = hinfo["port"] try: > transp, proto = await self._wrap_create_connection( self._factory, host, port, timeout=timeout, ssl=sslcontext, family=hinfo["family"], proto=hinfo["proto"], flags=hinfo["flags"], server_hostname=hinfo["hostname"] if sslcontext else None, local_addr=self._local_addr, req=req, client_error=client_error, ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:1020: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: > with CeilTimeout(timeout.sock_connect): /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:968: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = , exc_val = CancelledError() exc_tb = def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> Optional[bool]: > self._do_exit(exc_type) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = def _do_exit(self, exc_type: Type[BaseException]) -> None: if exc_type is asyncio.CancelledError and self._cancelled: self._cancel_handler = None self._task = None > raise asyncio.TimeoutError E asyncio.exceptions.TimeoutError /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:92: TimeoutError The above exception was the direct cause of the following exception: self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) > response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) aiobotocore/httpsession.py:178: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) except asyncio.TimeoutError as exc: > raise ServerTimeoutError( "Connection timeout " "to host {}".format(url) ) from exc E aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host http://169.254.169.254/latest/api/token /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:524: ServerTimeoutError During handling of the above exception, another exception occurred: @pytest.fixture async def sso_provider_setup(): self = Self() > async with AioSession().create_client('sso', region_name='us-east-1') as sso: tests/boto_tests/test_credentials.py:1134: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiobotocore/session.py:22: in __aenter__ self._client = await self._coro aiobotocore/session.py:102: in _create_client credentials = await self.get_credentials() aiobotocore/session.py:133: in get_credentials self._credentials = await (self._components.get_component( aiobotocore/credentials.py:814: in load_credentials creds = await provider.load() aiobotocore/credentials.py:486: in load metadata = await fetcher.retrieve_iam_role_credentials() aiobotocore/utils.py:175: in retrieve_iam_role_credentials token = await self._fetch_metadata_token() aiobotocore/utils.py:88: in _fetch_metadata_token response = await session.send(request.prepare()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) http_response = aiobotocore.awsrequest.AioAWSResponse( str(response.url), response.status, response.headers, response ) if not request.stream_output: # Cause the raw stream to be exhausted immediately. We do it # this way instead of using preload_content because # preload_content will never buffer chunked responses await http_response.content return http_response except ClientSSLError as e: raise SSLError(endpoint_url=request.url, error=e) except (ClientProxyConnectionError, ClientHttpProxyError) as e: raise ProxyConnectionError(proxy_url=mask_proxy_url(proxy_url), error=e) except (ServerDisconnectedError, aiohttp.ClientPayloadError, aiohttp.http_exceptions.BadStatusLine) as e: raise ConnectionClosedError( error=e, request=request, endpoint_url=request.url ) except ServerTimeoutError as e: if str(e).lower().startswith('connect'): > raise ConnectTimeoutError(endpoint_url=request.url, error=e) E botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.254/latest/api/token" aiobotocore/httpsession.py:210: ConnectTimeoutError ----------------------------------------------------------------------------- Captured log setup ----------------------------------------------------------------------------- DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector DEBUG botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane DEBUG botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53 DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG botocore.utils:utils.py:420 IMDS ENDPOINT: http://169.254.169.254/ DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: env DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role-with-web-identity DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: sso DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: shared-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: custom-process DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: config-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: ec2-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: boto-config DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: container-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: iam-role _______________________________________________________ ERROR at setup of test_load_sso_credentials_with_cache_expired _______________________________________________________ [gw7] linux -- Python 3.10.5 /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/bin/python self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: with CeilTimeout(timeout.sock_connect): > return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:969: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol_factory = functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>) host = '169.254.169.254', port = 80 async def create_connection( self, protocol_factory, host=None, port=None, *, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None, happy_eyeballs_delay=None, interleave=None): """Connect to a TCP server. Create a streaming transport connection to a given internet host and port: socket family AF_INET or socket.AF_INET6 depending on host (or family if specified), socket type SOCK_STREAM. protocol_factory must be a callable returning a protocol instance. This method is a coroutine which will try to establish the connection in the background. When successful, the coroutine returns a (transport, protocol) pair. """ if server_hostname is not None and not ssl: raise ValueError('server_hostname is only meaningful with ssl') if server_hostname is None and ssl: # Use host as default for server_hostname. It is an error # if host is empty or not set, e.g. when an # already-connected socket was passed or when only a port # is given. To avoid this error, you can pass # server_hostname='' -- this will bypass the hostname # check. (This also means that if host is a numeric # IP/IPv6 address, we will attempt to verify that exact # address; this will probably fail, but it is possible to # create a certificate for a specific IP address, so we # don't judge it here.) if not host: raise ValueError('You must set server_hostname ' 'when using ssl without a host') server_hostname = host if ssl_handshake_timeout is not None and not ssl: raise ValueError( 'ssl_handshake_timeout is only meaningful with ssl') if sock is not None: _check_ssl_socket(sock) if happy_eyeballs_delay is not None and interleave is None: # If using happy eyeballs, default to interleave addresses by family interleave = 1 if host is not None or port is not None: if sock is not None: raise ValueError( 'host/port and sock can not be specified at the same time') infos = await self._ensure_resolved( (host, port), family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not infos: raise OSError('getaddrinfo() returned empty list') if local_addr is not None: laddr_infos = await self._ensure_resolved( local_addr, family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self) if not laddr_infos: raise OSError('getaddrinfo() returned empty list') else: laddr_infos = None if interleave: infos = _interleave_addrinfos(infos, interleave) exceptions = [] if happy_eyeballs_delay is None: # not using happy eyeballs for addrinfo in infos: try: > sock = await self._connect_sock( exceptions, addrinfo, laddr_infos) /usr/lib/python3.10/asyncio/base_events.py:1049: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, exceptions = [[]] addr_info = (, , 6, '', ('169.254.169.254', 80)), local_addr_infos = None async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None): """Create, bind and connect one socket.""" my_exceptions = [] exceptions.append(my_exceptions) family, type_, proto, _, address = addr_info sock = None try: sock = socket.socket(family=family, type=type_, proto=proto) sock.setblocking(False) if local_addr_infos is not None: for _, _, _, _, laddr in local_addr_infos: try: sock.bind(laddr) break except OSError as exc: msg = ( f'error while attempting to bind on ' f'address {laddr!r}: ' f'{exc.strerror.lower()}' ) exc = OSError(exc.errno, msg) my_exceptions.append(exc) else: # all bind attempts failed raise my_exceptions.pop() > await self.sock_connect(sock, address) /usr/lib/python3.10/asyncio/base_events.py:960: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False> sock = , address = ('169.254.169.254', 80) async def sock_connect(self, sock, address): """Connect to a remote socket at address. This method is a coroutine. """ base_events._check_ssl_socket(sock) if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") if sock.family == socket.AF_INET or ( base_events._HAS_IPv6 and sock.family == socket.AF_INET6): resolved = await self._ensure_resolved( address, family=sock.family, type=sock.type, proto=sock.proto, loop=self, ) _, _, _, _, address = resolved[0] fut = self.create_future() self._sock_connect(fut, sock, address) > return await fut E asyncio.exceptions.CancelledError /usr/lib/python3.10/asyncio/selector_events.py:500: CancelledError During handling of the above exception, another exception occurred: self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None > conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:520: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def connect( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> Connection: """Get from pool or create new connection.""" key = req.connection_key available = self._available_connections(key) # Wait if there are no available connections or if there are/were # waiters (i.e. don't steal connection from a waiter about to wake up) if available <= 0 or key in self._waiters: fut = self._loop.create_future() # This connection will now count towards the limit. self._waiters[key].append(fut) if traces: for trace in traces: await trace.send_connection_queued_start() try: await fut except BaseException as e: if key in self._waiters: # remove a waiter even if it was cancelled, normally it's # removed when it's notified try: self._waiters[key].remove(fut) except ValueError: # fut may no longer be in list pass raise e finally: if key in self._waiters and not self._waiters[key]: del self._waiters[key] if traces: for trace in traces: await trace.send_connection_queued_end() proto = self._get(key) if proto is None: placeholder = cast(ResponseHandler, _TransportPlaceholder()) self._acquired.add(placeholder) self._acquired_per_host[key].add(placeholder) if traces: for trace in traces: await trace.send_connection_create_start() try: > proto = await self._create_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:535: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" ) -> ResponseHandler: """Create connection. Has same keyword arguments as BaseEventLoop.create_connection. """ if req.proxy: _, proto = await self._create_proxy_connection(req, traces, timeout) else: > _, proto = await self._create_direct_connection(req, traces, timeout) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:892: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself raise ClientConnectorError(req.connection_key, exc) from exc last_exc = None # type: Optional[Exception] for hinfo in hosts: host = hinfo["host"] port = hinfo["port"] try: > transp, proto = await self._wrap_create_connection( self._factory, host, port, timeout=timeout, ssl=sslcontext, family=hinfo["family"], proto=hinfo["proto"], flags=hinfo["flags"], server_hostname=hinfo["hostname"] if sslcontext else None, local_addr=self._local_addr, req=req, client_error=client_error, ) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:1020: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = timeout = ClientTimeout(total=None, connect=None, sock_read=1, sock_connect=1), client_error = args = (functools.partial(, loop=<_UnixSelectorEventLoop running=False closed=False debug=False>), '169.254.169.254', 80) kwargs = {'family': 0, 'flags': 0, 'local_addr': None, 'proto': 0, ...} async def _wrap_create_connection( self, *args: Any, req: "ClientRequest", timeout: "ClientTimeout", client_error: Type[Exception] = ClientConnectorError, **kwargs: Any, ) -> Tuple[asyncio.Transport, ResponseHandler]: try: > with CeilTimeout(timeout.sock_connect): /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/connector.py:968: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = , exc_val = CancelledError() exc_tb = def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> Optional[bool]: > self._do_exit(exc_type) /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = def _do_exit(self, exc_type: Type[BaseException]) -> None: if exc_type is asyncio.CancelledError and self._cancelled: self._cancel_handler = None self._task = None > raise asyncio.TimeoutError E asyncio.exceptions.TimeoutError /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/async_timeout/__init__.py:92: TimeoutError The above exception was the direct cause of the following exception: self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) > response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) aiobotocore/httpsession.py:178: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , method = 'PUT', str_or_url = URL('http://169.254.169.254/latest/api/token') async def _request( self, method: str, str_or_url: StrOrURL, *, params: Optional[Mapping[str, str]] = None, data: Any = None, json: Any = None, cookies: Optional[LooseCookies] = None, headers: Optional[LooseHeaders] = None, skip_auto_headers: Optional[Iterable[str]] = None, auth: Optional[BasicAuth] = None, allow_redirects: bool = True, max_redirects: int = 10, compress: Optional[str] = None, chunked: Optional[bool] = None, expect100: bool = False, raise_for_status: Optional[bool] = None, read_until_eof: bool = True, proxy: Optional[StrOrURL] = None, proxy_auth: Optional[BasicAuth] = None, timeout: Union[ClientTimeout, object] = sentinel, verify_ssl: Optional[bool] = None, fingerprint: Optional[bytes] = None, ssl_context: Optional[SSLContext] = None, ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, proxy_headers: Optional[LooseHeaders] = None, trace_request_ctx: Optional[SimpleNamespace] = None, read_bufsize: Optional[int] = None, ) -> ClientResponse: # NOTE: timeout clamps existing connect and read timeouts. We cannot # set the default to None because we need to detect if the user wants # to use the existing timeouts by setting timeout to None. if self.closed: raise RuntimeError("Session is closed") ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) if data is not None and json is not None: raise ValueError( "data and json parameters can not be used at the same time" ) elif json is not None: data = payload.JsonPayload(json, dumps=self._json_serialize) if not isinstance(chunked, bool) and chunked is not None: warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) redirects = 0 history = [] version = self._version # Merge with default headers and transform to CIMultiDict headers = self._prepare_headers(headers) proxy_headers = self._prepare_headers(proxy_headers) try: url = URL(str_or_url) except ValueError as e: raise InvalidURL(str_or_url) from e skip_headers = set(self._skip_auto_headers) if skip_auto_headers is not None: for i in skip_auto_headers: skip_headers.add(istr(i)) if proxy is not None: try: proxy = URL(proxy) except ValueError as e: raise InvalidURL(proxy) from e if timeout is sentinel: real_timeout = self._timeout # type: ClientTimeout else: if not isinstance(timeout, ClientTimeout): real_timeout = ClientTimeout(total=timeout) # type: ignore else: real_timeout = timeout # timeout is cumulative for all request operations # (request, redirects, responses, data consuming) tm = TimeoutHandle(self._loop, real_timeout.total) handle = tm.start() if read_bufsize is None: read_bufsize = self._read_bufsize traces = [ Trace( self, trace_config, trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), ) for trace_config in self._trace_configs ] for trace in traces: await trace.send_request_start(method, url, headers) timer = tm.timer() try: with timer: while True: url, auth_from_url = strip_auth_from_url(url) if auth and auth_from_url: raise ValueError( "Cannot combine AUTH argument with " "credentials encoded in URL" ) if auth is None: auth = auth_from_url if auth is None: auth = self._default_auth # It would be confusing if we support explicit # Authorization header with auth argument if ( headers is not None and auth is not None and hdrs.AUTHORIZATION in headers ): raise ValueError( "Cannot combine AUTHORIZATION header " "with AUTH argument or credentials " "encoded in URL" ) all_cookies = self._cookie_jar.filter_cookies(url) if cookies is not None: tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) if req_cookies: all_cookies.load(req_cookies) if proxy is not None: proxy = URL(proxy) elif self._trust_env: for scheme, proxy_info in proxies_from_env().items(): if scheme == url.scheme: proxy = proxy_info.proxy proxy_auth = proxy_info.proxy_auth break req = self._request_class( method, url, params=params, headers=headers, skip_auto_headers=skip_headers, data=data, cookies=all_cookies, auth=auth, version=version, compress=compress, chunked=chunked, expect100=expect100, loop=self._loop, response_class=self._response_class, proxy=proxy, proxy_auth=proxy_auth, timer=timer, session=self, ssl=ssl, proxy_headers=proxy_headers, traces=traces, ) # connection timeout try: with CeilTimeout(real_timeout.connect, loop=self._loop): assert self._connector is not None conn = await self._connector.connect( req, traces=traces, timeout=real_timeout ) except asyncio.TimeoutError as exc: > raise ServerTimeoutError( "Connection timeout " "to host {}".format(url) ) from exc E aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host http://169.254.169.254/latest/api/token /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/client.py:524: ServerTimeoutError During handling of the above exception, another exception occurred: @pytest.fixture async def sso_provider_setup(): self = Self() > async with AioSession().create_client('sso', region_name='us-east-1') as sso: tests/boto_tests/test_credentials.py:1134: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiobotocore/session.py:22: in __aenter__ self._client = await self._coro aiobotocore/session.py:102: in _create_client credentials = await self.get_credentials() aiobotocore/session.py:133: in get_credentials self._credentials = await (self._components.get_component( aiobotocore/credentials.py:814: in load_credentials creds = await provider.load() aiobotocore/credentials.py:486: in load metadata = await fetcher.retrieve_iam_role_credentials() aiobotocore/utils.py:175: in retrieve_iam_role_credentials token = await self._fetch_metadata_token() aiobotocore/utils.py:88: in _fetch_metadata_token response = await session.send(request.prepare()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = async def send(self, request): proxy_url = self._proxy_config.proxy_url_for(request.url) proxy_headers = self._proxy_config.proxy_headers_for(request.url) try: url = request.url headers = request.headers data = request.body if ensure_boolean( os.environ.get('BOTO_EXPERIMENTAL__ADD_PROXY_HOST_HEADER', '') ): # This is currently an "experimental" feature which provides # no guarantees of backwards compatibility. It may be subject # to change or removal in any patch version. Anyone opting in # to this feature should strictly pin botocore. host = urlparse(request.url).hostname proxy_headers['host'] = host # https://github.com/boto/botocore/issues/1255 headers['Accept-Encoding'] = 'identity' headers_ = MultiDict( (z[0], _text(z[1], encoding='utf-8')) for z in headers.items()) if isinstance(data, io.IOBase): data = _IOBaseWrapper(data) url = URL(url, encoded=True) response = await self._session.request( request.method, url=url, headers=headers_, data=data, proxy=proxy_url, proxy_headers=proxy_headers ) http_response = aiobotocore.awsrequest.AioAWSResponse( str(response.url), response.status, response.headers, response ) if not request.stream_output: # Cause the raw stream to be exhausted immediately. We do it # this way instead of using preload_content because # preload_content will never buffer chunked responses await http_response.content return http_response except ClientSSLError as e: raise SSLError(endpoint_url=request.url, error=e) except (ClientProxyConnectionError, ClientHttpProxyError) as e: raise ProxyConnectionError(proxy_url=mask_proxy_url(proxy_url), error=e) except (ServerDisconnectedError, aiohttp.ClientPayloadError, aiohttp.http_exceptions.BadStatusLine) as e: raise ConnectionClosedError( error=e, request=request, endpoint_url=request.url ) except ServerTimeoutError as e: if str(e).lower().startswith('connect'): > raise ConnectTimeoutError(endpoint_url=request.url, error=e) E botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.254/latest/api/token" aiobotocore/httpsession.py:210: ConnectTimeoutError ----------------------------------------------------------------------------- Captured log setup ----------------------------------------------------------------------------- DEBUG asyncio:selector_events.py:54 Using selector: EpollSelector DEBUG botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane DEBUG botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53 DEBUG botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section DEBUG botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search DEBUG botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG botocore.utils:utils.py:420 IMDS ENDPOINT: http://169.254.169.254/ DEBUG botocore.httpsession:httpsession.py:59 Certificate path: /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/certifi/cacert.pem DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: env DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: assume-role-with-web-identity DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: sso DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: shared-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: custom-process DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: config-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: ec2-credentials-file DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: boto-config DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: container-role DEBUG aiobotocore.credentials:credentials.py:813 Looking for credentials via: iam-role ============================================================================== warnings summary ============================================================================== ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_vendor/packaging/version.py:111: 2784 warnings /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_vendor/packaging/version.py:111: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release warnings.warn( ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 ../../../../../../.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9 /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py:9: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.cmd import Command as DistutilsCommand ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 ../../../../../../../../usr/lib/python3.10/distutils/command/install.py:13 /usr/lib/python3.10/distutils/command/install.py:13: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils.sysconfig import get_config_vars tests/test_basic_s3.py::test_can_make_request_no_verify[False] /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore/aiobotocore/httpsession.py:91: DeprecationWarning: verify_ssl is deprecated, use ssl=False instead self._create_connector = lambda: aiohttp.TCPConnector( tests/test_config.py::test_connector_args /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/aiohttp/helpers.py:283: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() tests/test_config.py::test_connector_args /home/yen/var/local/Computer/archlinux/upstream-repos/aiobotocore/tests/test_config.py:53: DeprecationWarning: The object should be created within an async function "resolver": aiohttp.resolver.DefaultResolver() tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_empty_dict /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/dateutil/tz/_common.py:222: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._content' was never awaited dtoff = dt.utcoffset() tests/python3.8/boto_tests/test_credentials.py::test_refreshablecredentials_refresh_returns_empty_dict /home/yen/.local/share/virtualenvs/aiobotocore-JSr6HhZe/lib/python3.10/site-packages/dateutil/tz/_common.py:222: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._text' was never awaited dtoff = dt.utcoffset() tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url_bad_status /usr/lib/python3.10/abc.py:123: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._text' was never awaited return _abc_subclasscheck(cls, subclass) tests/python3.8/boto_tests/test_utils.py::test_containermetadatafetcher_retrieve_url_not_json /usr/lib/python3.10/unittest/mock.py:2107: RuntimeWarning: coroutine 'fake_aiohttp_session..FakeAioHttpSession.FakeResponse._text' was never awaited setattr(_type, entry, MagicProxy(entry, self)) -- Docs: https://docs.pytest.org/en/stable/warnings.html ---------- coverage: platform linux, python 3.10.5-final-0 ----------- Name Stmts Miss Cover -------------------------------------------------------------------- aiobotocore/__init__.py 1 0 100% aiobotocore/_endpoint_helpers.py 12 0 100% aiobotocore/_helpers.py 14 2 86% aiobotocore/args.py 32 0 100% aiobotocore/awsrequest.py 18 1 94% aiobotocore/client.py 181 25 86% aiobotocore/config.py 39 0 100% aiobotocore/configprovider.py 29 25 14% aiobotocore/credentials.py 428 76 82% aiobotocore/discovery.py 55 48 13% aiobotocore/endpoint.py 120 4 97% aiobotocore/eventstream.py 27 9 67% aiobotocore/handlers.py 44 16 64% aiobotocore/hooks.py 35 1 97% aiobotocore/httpchecksum.py 32 24 25% aiobotocore/httpsession.py 118 24 80% aiobotocore/paginate.py 101 11 89% aiobotocore/parsers.py 75 29 61% aiobotocore/response.py 75 18 76% aiobotocore/retries/adaptive.py 43 7 84% aiobotocore/retries/bucket.py 66 22 67% aiobotocore/retries/special.py 15 9 40% aiobotocore/retries/standard.py 36 1 97% aiobotocore/retryhandler.py 107 19 82% aiobotocore/session.py 99 23 77% aiobotocore/signers.py 145 7 95% aiobotocore/utils.py 267 63 76% aiobotocore/waiter.py 53 5 91% tests/__init__.py 0 0 100% tests/_helpers.py 4 2 50% tests/boto_tests/__init__.py 0 0 100% tests/boto_tests/helpers.py 35 5 86% tests/boto_tests/test_credentials.py 625 108 83% tests/boto_tests/test_signers.py 20 0 100% tests/boto_tests/test_utils.py 105 5 95% tests/conftest.py 283 24 92% tests/mock_server.py 103 26 75% tests/moto_server.py 92 17 82% tests/python3.8/__init__.py 0 0 100% tests/python3.8/boto_tests/__init__.py 0 0 100% tests/python3.8/boto_tests/test_credentials.py 208 0 100% tests/python3.8/boto_tests/test_signers.py 105 0 100% tests/python3.8/boto_tests/test_utils.py 279 2 99% tests/python3.8/test_eventstreams.py 34 28 18% tests/test_adaptive.py 119 76 36% tests/test_basic_s3.py 350 50 86% tests/test_batch.py 6 0 100% tests/test_config.py 76 0 100% tests/test_dynamodb.py 70 0 100% tests/test_ec2.py 9 0 100% tests/test_eventstreams.py 48 1 98% tests/test_lambda.py 36 1 97% tests/test_monitor.py 13 0 100% tests/test_mturk.py 10 5 50% tests/test_patches.py 52 2 96% tests/test_response.py 130 0 100% tests/test_session.py 24 0 100% tests/test_sns.py 52 0 100% tests/test_sqs.py 41 0 100% tests/test_version.py 106 3 97% tests/test_waiter.py 9 0 100% -------------------------------------------------------------------- TOTAL 5311 824 84% Coverage HTML written to dir htmlcov Coverage XML written to file coverage.xml ========================================================================== short test summary info =========================================================================== ERROR tests/boto_tests/test_credentials.py::test_sso_credential_fetcher_can_fetch_credentials - botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "... ERROR tests/boto_tests/test_credentials.py::test_required_config_not_set - botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.25... ERROR tests/boto_tests/test_credentials.py::test_sso_cred_fetcher_raises_helpful_message_on_unauthorized_exception - botocore.exceptions.ConnectTimeoutError: Connect timeo... ERROR tests/boto_tests/test_credentials.py::test_load_sso_credentials_with_cache - botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.25... ERROR tests/boto_tests/test_credentials.py::test_load_sso_credentials_with_cache_expired - botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http:... =============================================================== 155 passed, 2807 warnings, 5 errors in 33.23s ================================================================ make: *** [Makefile:25:mototest] 錯誤 1