riesgos / async

0 stars 0 forks source link

Set up local client for S3 in Kotlin #47

Closed MichaelLangbein closed 1 year ago

MichaelLangbein commented 1 year ago

I think I've messed up the reverse proxy configuration. At least with python's boto3 client I have trouble accessing the S3-api.

from boto3 import Boto3

boto3.set_stream_logger(name='botocore')

resource = boto3.resource(
    's3',
    endpoint_url='http://138.246.225.182:80/api/v1/files',
    aws_access_key_id='developer',
    aws_secret_access_key='the_keyword',
    aws_session_token=None,
    config=boto3.session.Config(signature_version='s3v4'),
    verify=False
)

for bucket in resource.buckets.all():
    print(bucket)

Yields:

2023-02-13 10:26:28,848 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fe142de80d0>
2023-02-13 10:26:28,848 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fe142de80d0>
2023-02-13 10:26:28,850 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fe142e57d30>
2023-02-13 10:26:28,850 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fe142e57d30>
2023-02-13 10:26:28,850 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fe142e57d30>
2023-02-13 10:26:28,850 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function lazy_call.<locals>._handler at 0x7fe142d6e160>
2023-02-13 10:26:28,850 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function lazy_call.<locals>._handler at 0x7fe142d6e160>
2023-02-13 10:26:28,850 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function lazy_call.<locals>._handler at 0x7fe142d6e160>
2023-02-13 10:26:28,851 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fe142e57af0>
2023-02-13 10:26:28,851 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fe142e57af0>
2023-02-13 10:26:28,851 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fe142e57af0>
2023-02-13 10:26:28,853 botocore.endpoint [DEBUG] Setting s3 timeout as (60, 60)
2023-02-13 10:26:28,853 botocore.endpoint [DEBUG] Setting s3 timeout as (60, 60)
2023-02-13 10:26:28,853 botocore.endpoint [DEBUG] Setting s3 timeout as (60, 60)
2023-02-13 10:26:28,856 botocore.client [DEBUG] Registering retry handlers for service: s3
2023-02-13 10:26:28,856 botocore.client [DEBUG] Registering retry handlers for service: s3
2023-02-13 10:26:28,856 botocore.client [DEBUG] Registering retry handlers for service: s3
2023-02-13 10:26:28,857 botocore.utils [DEBUG] Registering S3 region redirector handler
2023-02-13 10:26:28,857 botocore.utils [DEBUG] Registering S3 region redirector handler
2023-02-13 10:26:28,857 botocore.utils [DEBUG] Registering S3 region redirector handler
2023-02-13 10:26:28,859 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:26:28,859 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:26:28,859 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:26:28,859 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,859 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,859 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,860 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:26:28,860 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:26:28,860 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:26:28,861 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files
2023-02-13 10:26:28,861 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files
2023-02-13 10:26:28,861 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files
2023-02-13 10:26:28,862 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:26:28,862 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:26:28,862 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:26:28,863 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:26:28,863 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:26:28,863 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:26:28,864 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:26:28,864 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:26:28,864 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:26:28,864 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function remove_bucket_from_url_paths_from_model at 0x7fe142dfc700>
2023-02-13 10:26:28,864 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function remove_bucket_from_url_paths_from_model at 0x7fe142dfc700>
2023-02-13 10:26:28,864 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function remove_bucket_from_url_paths_from_model at 0x7fe142dfc700>
2023-02-13 10:26:28,865 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,865 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,865 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,865 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function generate_idempotent_uuid at 0x7fe142df7700>
2023-02-13 10:26:28,865 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function generate_idempotent_uuid at 0x7fe142df7700>
2023-02-13 10:26:28,865 botocore.hooks [DEBUG] Event before-parameter-build.s3.ListBuckets: calling handler <function generate_idempotent_uuid at 0x7fe142df7700>
2023-02-13 10:26:28,866 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function add_expect_header at 0x7fe142df7c10>
2023-02-13 10:26:28,866 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function add_expect_header at 0x7fe142df7c10>
2023-02-13 10:26:28,866 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function add_expect_header at 0x7fe142df7c10>
2023-02-13 10:26:28,867 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function add_recursion_detection_header at 0x7fe142df73a0>
2023-02-13 10:26:28,867 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function add_recursion_detection_header at 0x7fe142df73a0>
2023-02-13 10:26:28,867 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function add_recursion_detection_header at 0x7fe142df73a0>
2023-02-13 10:26:28,868 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function inject_api_version_header_if_needed at 0x7fe142df8f70>
2023-02-13 10:26:28,868 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function inject_api_version_header_if_needed at 0x7fe142df8f70>
2023-02-13 10:26:28,868 botocore.hooks [DEBUG] Event before-call.s3.ListBuckets: calling handler <function inject_api_version_header_if_needed at 0x7fe142df8f70>
2023-02-13 10:26:28,868 botocore.endpoint [DEBUG] Making request for OperationModel(name=ListBuckets) with params: {'url_path': '/', 'query_string': '', 'method': 'GET', 'headers': {'User-Agent': 'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource'}, 'body': b'', 'url': 'http://138.246.225.182:80/api/v1/files', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7fe137d33580>, 'has_streaming_input': False, 'auth_type': 's3v4', 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 's3_redirect': {'redirected': False, 'bucket': None, 'params': {}}}}
2023-02-13 10:26:28,868 botocore.endpoint [DEBUG] Making request for OperationModel(name=ListBuckets) with params: {'url_path': '/', 'query_string': '', 'method': 'GET', 'headers': {'User-Agent': 'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource'}, 'body': b'', 'url': 'http://138.246.225.182:80/api/v1/files', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7fe137d33580>, 'has_streaming_input': False, 'auth_type': 's3v4', 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 's3_redirect': {'redirected': False, 'bucket': None, 'params': {}}}}
2023-02-13 10:26:28,868 botocore.endpoint [DEBUG] Making request for OperationModel(name=ListBuckets) with params: {'url_path': '/', 'query_string': '', 'method': 'GET', 'headers': {'User-Agent': 'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource'}, 'body': b'', 'url': 'http://138.246.225.182:80/api/v1/files', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7fe137d33580>, 'has_streaming_input': False, 'auth_type': 's3v4', 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 's3_redirect': {'redirected': False, 'bucket': None, 'params': {}}}}
2023-02-13 10:26:28,869 botocore.hooks [DEBUG] Event request-created.s3.ListBuckets: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fe137d33430>>
2023-02-13 10:26:28,869 botocore.hooks [DEBUG] Event request-created.s3.ListBuckets: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fe137d33430>>
2023-02-13 10:26:28,869 botocore.hooks [DEBUG] Event request-created.s3.ListBuckets: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fe137d33430>>
2023-02-13 10:26:28,870 botocore.hooks [DEBUG] Event choose-signer.s3.ListBuckets: calling handler <function set_operation_specific_signer at 0x7fe142df75e0>
2023-02-13 10:26:28,870 botocore.hooks [DEBUG] Event choose-signer.s3.ListBuckets: calling handler <function set_operation_specific_signer at 0x7fe142df75e0>
2023-02-13 10:26:28,870 botocore.hooks [DEBUG] Event choose-signer.s3.ListBuckets: calling handler <function set_operation_specific_signer at 0x7fe142df75e0>
2023-02-13 10:26:28,871 botocore.hooks [DEBUG] Event before-sign.s3.ListBuckets: calling handler <function remove_arn_from_signing_path at 0x7fe142dfc820>
2023-02-13 10:26:28,871 botocore.hooks [DEBUG] Event before-sign.s3.ListBuckets: calling handler <function remove_arn_from_signing_path at 0x7fe142dfc820>
2023-02-13 10:26:28,871 botocore.hooks [DEBUG] Event before-sign.s3.ListBuckets: calling handler <function remove_arn_from_signing_path at 0x7fe142dfc820>
2023-02-13 10:26:28,871 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-02-13 10:26:28,871 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-02-13 10:26:28,871 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-02-13 10:26:28,872 botocore.auth [DEBUG] CanonicalRequest:
GET
/api/v1/files

host:138.246.225.182
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20230213T092628Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2023-02-13 10:26:28,872 botocore.auth [DEBUG] CanonicalRequest:
GET
/api/v1/files

host:138.246.225.182
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20230213T092628Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2023-02-13 10:26:28,872 botocore.auth [DEBUG] CanonicalRequest:
GET
/api/v1/files

host:138.246.225.182
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20230213T092628Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2023-02-13 10:26:28,872 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20230213T092628Z
20230213/us-east-1/s3/aws4_request
7f705107dd167b0088bc084ffc12eb1fa0dcd235a155a2cb4fb557a1178a49ec
2023-02-13 10:26:28,872 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20230213T092628Z
20230213/us-east-1/s3/aws4_request
7f705107dd167b0088bc084ffc12eb1fa0dcd235a155a2cb4fb557a1178a49ec
2023-02-13 10:26:28,872 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20230213T092628Z
20230213/us-east-1/s3/aws4_request
7f705107dd167b0088bc084ffc12eb1fa0dcd235a155a2cb4fb557a1178a49ec
2023-02-13 10:26:28,873 botocore.auth [DEBUG] Signature:
a5ccd45d73300c8f92a475133878b918709ff0dc826c725761ed724447d894c6
2023-02-13 10:26:28,873 botocore.auth [DEBUG] Signature:
a5ccd45d73300c8f92a475133878b918709ff0dc826c725761ed724447d894c6
2023-02-13 10:26:28,873 botocore.auth [DEBUG] Signature:
a5ccd45d73300c8f92a475133878b918709ff0dc826c725761ed724447d894c6
2023-02-13 10:26:28,873 botocore.hooks [DEBUG] Event request-created.s3.ListBuckets: calling handler <function add_retry_headers at 0x7fe142dfc670>
2023-02-13 10:26:28,873 botocore.hooks [DEBUG] Event request-created.s3.ListBuckets: calling handler <function add_retry_headers at 0x7fe142dfc670>
2023-02-13 10:26:28,873 botocore.hooks [DEBUG] Event request-created.s3.ListBuckets: calling handler <function add_retry_headers at 0x7fe142dfc670>
2023-02-13 10:26:28,874 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=http://138.246.225.182:80/api/v1/files, headers={'User-Agent': b'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'X-Amz-Date': b'20230213T092628Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=developer/20230213/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=a5ccd45d73300c8f92a475133878b918709ff0dc826c725761ed724447d894c6', 'amz-sdk-invocation-id': b'f74edbbf-764b-450c-a2b7-5baa3dfcf302', 'amz-sdk-request': b'attempt=1'}>
2023-02-13 10:26:28,874 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=http://138.246.225.182:80/api/v1/files, headers={'User-Agent': b'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'X-Amz-Date': b'20230213T092628Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=developer/20230213/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=a5ccd45d73300c8f92a475133878b918709ff0dc826c725761ed724447d894c6', 'amz-sdk-invocation-id': b'f74edbbf-764b-450c-a2b7-5baa3dfcf302', 'amz-sdk-request': b'attempt=1'}>
2023-02-13 10:26:28,874 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=http://138.246.225.182:80/api/v1/files, headers={'User-Agent': b'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'X-Amz-Date': b'20230213T092628Z', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=developer/20230213/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=a5ccd45d73300c8f92a475133878b918709ff0dc826c725761ed724447d894c6', 'amz-sdk-invocation-id': b'f74edbbf-764b-450c-a2b7-5baa3dfcf302', 'amz-sdk-request': b'attempt=1'}>
2023-02-13 10:26:28,952 botocore.parsers [DEBUG] Response headers: {'Server': 'nginx/1.23.2', 'Date': 'Mon, 13 Feb 2023 09:26:28 GMT', 'Content-Type': 'text/html', 'Content-Length': '169', 'Location': 'http://138.246.225.182/api/v1/files/', 'Cache-Control': 'proxy-revalidate', 'Connection': 'Keep-Alive', 'Age': '0'}
2023-02-13 10:26:28,952 botocore.parsers [DEBUG] Response headers: {'Server': 'nginx/1.23.2', 'Date': 'Mon, 13 Feb 2023 09:26:28 GMT', 'Content-Type': 'text/html', 'Content-Length': '169', 'Location': 'http://138.246.225.182/api/v1/files/', 'Cache-Control': 'proxy-revalidate', 'Connection': 'Keep-Alive', 'Age': '0'}
2023-02-13 10:26:28,952 botocore.parsers [DEBUG] Response headers: {'Server': 'nginx/1.23.2', 'Date': 'Mon, 13 Feb 2023 09:26:28 GMT', 'Content-Type': 'text/html', 'Content-Length': '169', 'Location': 'http://138.246.225.182/api/v1/files/', 'Cache-Control': 'proxy-revalidate', 'Connection': 'Keep-Alive', 'Age': '0'}
2023-02-13 10:26:28,953 botocore.parsers [DEBUG] Response body:
b'<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body>\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2023-02-13 10:26:28,953 botocore.parsers [DEBUG] Response body:
b'<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body>\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2023-02-13 10:26:28,953 botocore.parsers [DEBUG] Response body:
b'<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body>\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2023-02-13 10:26:28,954 botocore.parsers [DEBUG] Exception caught when parsing error response body:
Traceback (most recent call last):
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 503, in _parse_xml_string_to_dom
    parser.feed(xml_string)
xml.etree.ElementTree.ParseError: mismatched tag: line 6, column 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 1055, in _do_error_parse
    return self._parse_error_from_body(response)
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 1079, in _parse_error_from_body
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 506, in _parse_xml_string_to_dom
    raise ResponseParserError(
botocore.parsers.ResponseParserError: Unable to parse response (mismatched tag: line 6, column 2), invalid XML received. Further retries may succeed:
b'<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body>\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2023-02-13 10:26:28,954 botocore.parsers [DEBUG] Exception caught when parsing error response body:
Traceback (most recent call last):
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 503, in _parse_xml_string_to_dom
    parser.feed(xml_string)
xml.etree.ElementTree.ParseError: mismatched tag: line 6, column 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 1055, in _do_error_parse
    return self._parse_error_from_body(response)
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 1079, in _parse_error_from_body
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 506, in _parse_xml_string_to_dom
    raise ResponseParserError(
botocore.parsers.ResponseParserError: Unable to parse response (mismatched tag: line 6, column 2), invalid XML received. Further retries may succeed:
b'<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body>\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2023-02-13 10:26:28,954 botocore.parsers [DEBUG] Exception caught when parsing error response body:
Traceback (most recent call last):
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 503, in _parse_xml_string_to_dom
    parser.feed(xml_string)
xml.etree.ElementTree.ParseError: mismatched tag: line 6, column 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 1055, in _do_error_parse
    return self._parse_error_from_body(response)
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 1079, in _parse_error_from_body
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/localhome/lang_m13/miniconda3/envs/geo/lib/python3.9/site-packages/botocore/parsers.py", line 506, in _parse_xml_string_to_dom
    raise ResponseParserError(
botocore.parsers.ResponseParserError: Unable to parse response (mismatched tag: line 6, column 2), invalid XML received. Further retries may succeed:
b'<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body>\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2023-02-13 10:26:28,956 botocore.hooks [DEBUG] Event needs-retry.s3.ListBuckets: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe137cccd30>
2023-02-13 10:26:28,956 botocore.hooks [DEBUG] Event needs-retry.s3.ListBuckets: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe137cccd30>
2023-02-13 10:26:28,956 botocore.hooks [DEBUG] Event needs-retry.s3.ListBuckets: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe137cccd30>
2023-02-13 10:26:28,957 botocore.retryhandler [DEBUG] No retry needed.
2023-02-13 10:26:28,957 botocore.retryhandler [DEBUG] No retry needed.
2023-02-13 10:26:28,957 botocore.retryhandler [DEBUG] No retry needed.
2023-02-13 10:26:28,957 botocore.hooks [DEBUG] Event needs-retry.s3.ListBuckets: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,957 botocore.hooks [DEBUG] Event needs-retry.s3.ListBuckets: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,957 botocore.hooks [DEBUG] Event needs-retry.s3.ListBuckets: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,958 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:26:28,958 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:26:28,958 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:26:28,959 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,959 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,959 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:26:28,960 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:26:28,960 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:26:28,960 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:26:28,960 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files
2023-02-13 10:26:28,960 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files
2023-02-13 10:26:28,960 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files
2023-02-13 10:26:28,961 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:26:28,961 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:26:28,961 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:26:28,961 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:26:28,961 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:26:28,961 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:26:28,962 botocore.hooks [DEBUG] Event before-parameter-build.s3.HeadBucket: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:26:28,962 botocore.hooks [DEBUG] Event before-parameter-build.s3.HeadBucket: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:26:28,962 botocore.hooks [DEBUG] Event before-parameter-build.s3.HeadBucket: calling handler <function validate_bucket_name at 0x7fe142df78b0>
MichaelLangbein commented 1 year ago

Sorry, a bunch of stupid typo's in the error description above. Fixed those and updated with new - correct - error log.

MichaelLangbein commented 1 year ago
resource.Bucket('riesgosfiles').upload_file("/path/to/botoTest.txt", "botoTest.txt")

results in

2023-02-13 10:47:57,772 botocore.hooks [DEBUG] Event creating-resource-class.s3.Bucket: calling handler <function lazy_call.<locals>._handler at 0x7fe142d6ea60>
2023-02-13 10:47:57,772 botocore.hooks [DEBUG] Event creating-resource-class.s3.Bucket: calling handler <function lazy_call.<locals>._handler at 0x7fe142d6ea60>
2023-02-13 10:47:57,772 botocore.hooks [DEBUG] Event creating-resource-class.s3.Bucket: calling handler <function lazy_call.<locals>._handler at 0x7fe142d6ea60>
2023-02-13 10:47:57,774 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:47:57,774 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:47:57,774 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x7fe142dfc8b0>
2023-02-13 10:47:57,775 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,775 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,775 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,776 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Bucket': 'riesgosfiles', 'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:47:57,776 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Bucket': 'riesgosfiles', 'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:47:57,776 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Bucket': 'riesgosfiles', 'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://138.246.225.182:80/api/v1/files', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2023-02-13 10:47:57,777 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files/riesgosfiles
2023-02-13 10:47:57,777 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files/riesgosfiles
2023-02-13 10:47:57,777 botocore.regions [DEBUG] Endpoint provider result: http://138.246.225.182:80/api/v1/files/riesgosfiles
2023-02-13 10:47:57,777 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:47:57,777 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:47:57,777 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "s3v4"
2023-02-13 10:47:57,778 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:47:57,778 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:47:57,778 botocore.regions [DEBUG] Selected auth type "v4" as "s3v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2023-02-13 10:47:57,779 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function validate_ascii_metadata at 0x7fe142df8550>
2023-02-13 10:47:57,779 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function validate_ascii_metadata at 0x7fe142df8550>
2023-02-13 10:47:57,779 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function validate_ascii_metadata at 0x7fe142df8550>
2023-02-13 10:47:57,780 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function sse_md5 at 0x7fe142df7940>
2023-02-13 10:47:57,780 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function sse_md5 at 0x7fe142df7940>
2023-02-13 10:47:57,780 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function sse_md5 at 0x7fe142df7940>
2023-02-13 10:47:57,781 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function convert_body_to_file_like_object at 0x7fe142df8e50>
2023-02-13 10:47:57,781 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function convert_body_to_file_like_object at 0x7fe142df8e50>
2023-02-13 10:47:57,781 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function convert_body_to_file_like_object at 0x7fe142df8e50>
2023-02-13 10:47:57,781 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:47:57,781 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:47:57,781 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function validate_bucket_name at 0x7fe142df78b0>
2023-02-13 10:47:57,782 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function remove_bucket_from_url_paths_from_model at 0x7fe142dfc700>
2023-02-13 10:47:57,782 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function remove_bucket_from_url_paths_from_model at 0x7fe142dfc700>
2023-02-13 10:47:57,782 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function remove_bucket_from_url_paths_from_model at 0x7fe142dfc700>
2023-02-13 10:47:57,783 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,783 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,783 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,783 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function generate_idempotent_uuid at 0x7fe142df7700>
2023-02-13 10:47:57,783 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function generate_idempotent_uuid at 0x7fe142df7700>
2023-02-13 10:47:57,783 botocore.hooks [DEBUG] Event before-parameter-build.s3.PutObject: calling handler <function generate_idempotent_uuid at 0x7fe142df7700>
2023-02-13 10:47:57,784 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function conditionally_calculate_md5 at 0x7fe142f1d820>
2023-02-13 10:47:57,784 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function conditionally_calculate_md5 at 0x7fe142f1d820>
2023-02-13 10:47:57,784 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function conditionally_calculate_md5 at 0x7fe142f1d820>
2023-02-13 10:47:57,785 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function add_expect_header at 0x7fe142df7c10>
2023-02-13 10:47:57,785 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function add_expect_header at 0x7fe142df7c10>
2023-02-13 10:47:57,785 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function add_expect_header at 0x7fe142df7c10>
2023-02-13 10:47:57,785 botocore.handlers [DEBUG] Adding expect 100 continue header to request.
2023-02-13 10:47:57,785 botocore.handlers [DEBUG] Adding expect 100 continue header to request.
2023-02-13 10:47:57,785 botocore.handlers [DEBUG] Adding expect 100 continue header to request.
2023-02-13 10:47:57,786 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function add_recursion_detection_header at 0x7fe142df73a0>
2023-02-13 10:47:57,786 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function add_recursion_detection_header at 0x7fe142df73a0>
2023-02-13 10:47:57,786 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function add_recursion_detection_header at 0x7fe142df73a0>
2023-02-13 10:47:57,787 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function inject_api_version_header_if_needed at 0x7fe142df8f70>
2023-02-13 10:47:57,787 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function inject_api_version_header_if_needed at 0x7fe142df8f70>
2023-02-13 10:47:57,787 botocore.hooks [DEBUG] Event before-call.s3.PutObject: calling handler <function inject_api_version_header_if_needed at 0x7fe142df8f70>
2023-02-13 10:47:57,787 botocore.endpoint [DEBUG] Making request for OperationModel(name=PutObject) with params: {'url_path': '/botoTest.txt', 'query_string': {}, 'method': 'PUT', 'headers': {'User-Agent': 'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'Content-MD5': 'eywNJv4s+85QTBUP4zlw4w==', 'Expect': '100-continue'}, 'body': <s3transfer.utils.ReadFileChunk object at 0x7fe135e5d370>, 'auth_path': '/riesgosfiles/botoTest.txt', 'url': 'http://138.246.225.182:80/api/v1/files/riesgosfiles/botoTest.txt', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7fe137d33580>, 'has_streaming_input': True, 'auth_type': 's3v4', 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 's3_redirect': {'redirected': False, 'bucket': 'riesgosfiles', 'params': {'Bucket': 'riesgosfiles', 'Key': 'botoTest.txt', 'Body': <s3transfer.utils.ReadFileChunk object at 0x7fe135e5d370>}}}}
2023-02-13 10:47:57,787 botocore.endpoint [DEBUG] Making request for OperationModel(name=PutObject) with params: {'url_path': '/botoTest.txt', 'query_string': {}, 'method': 'PUT', 'headers': {'User-Agent': 'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'Content-MD5': 'eywNJv4s+85QTBUP4zlw4w==', 'Expect': '100-continue'}, 'body': <s3transfer.utils.ReadFileChunk object at 0x7fe135e5d370>, 'auth_path': '/riesgosfiles/botoTest.txt', 'url': 'http://138.246.225.182:80/api/v1/files/riesgosfiles/botoTest.txt', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7fe137d33580>, 'has_streaming_input': True, 'auth_type': 's3v4', 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 's3_redirect': {'redirected': False, 'bucket': 'riesgosfiles', 'params': {'Bucket': 'riesgosfiles', 'Key': 'botoTest.txt', 'Body': <s3transfer.utils.ReadFileChunk object at 0x7fe135e5d370>}}}}
2023-02-13 10:47:57,787 botocore.endpoint [DEBUG] Making request for OperationModel(name=PutObject) with params: {'url_path': '/botoTest.txt', 'query_string': {}, 'method': 'PUT', 'headers': {'User-Agent': 'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'Content-MD5': 'eywNJv4s+85QTBUP4zlw4w==', 'Expect': '100-continue'}, 'body': <s3transfer.utils.ReadFileChunk object at 0x7fe135e5d370>, 'auth_path': '/riesgosfiles/botoTest.txt', 'url': 'http://138.246.225.182:80/api/v1/files/riesgosfiles/botoTest.txt', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x7fe137d33580>, 'has_streaming_input': True, 'auth_type': 's3v4', 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 's3_redirect': {'redirected': False, 'bucket': 'riesgosfiles', 'params': {'Bucket': 'riesgosfiles', 'Key': 'botoTest.txt', 'Body': <s3transfer.utils.ReadFileChunk object at 0x7fe135e5d370>}}}}
2023-02-13 10:47:57,788 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function signal_not_transferring at 0x7fe1423dd310>
2023-02-13 10:47:57,788 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function signal_not_transferring at 0x7fe1423dd310>
2023-02-13 10:47:57,788 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function signal_not_transferring at 0x7fe1423dd310>
2023-02-13 10:47:57,788 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fe137d33430>>
2023-02-13 10:47:57,788 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fe137d33430>>
2023-02-13 10:47:57,788 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fe137d33430>>
2023-02-13 10:47:57,789 botocore.hooks [DEBUG] Event choose-signer.s3.PutObject: calling handler <function set_operation_specific_signer at 0x7fe142df75e0>
2023-02-13 10:47:57,789 botocore.hooks [DEBUG] Event choose-signer.s3.PutObject: calling handler <function set_operation_specific_signer at 0x7fe142df75e0>
2023-02-13 10:47:57,789 botocore.hooks [DEBUG] Event choose-signer.s3.PutObject: calling handler <function set_operation_specific_signer at 0x7fe142df75e0>
2023-02-13 10:47:57,789 botocore.hooks [DEBUG] Event before-sign.s3.PutObject: calling handler <function remove_arn_from_signing_path at 0x7fe142dfc820>
2023-02-13 10:47:57,789 botocore.hooks [DEBUG] Event before-sign.s3.PutObject: calling handler <function remove_arn_from_signing_path at 0x7fe142dfc820>
2023-02-13 10:47:57,789 botocore.hooks [DEBUG] Event before-sign.s3.PutObject: calling handler <function remove_arn_from_signing_path at 0x7fe142dfc820>
2023-02-13 10:47:57,791 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-02-13 10:47:57,791 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-02-13 10:47:57,791 botocore.auth [DEBUG] Calculating signature using v4 auth.
2023-02-13 10:47:57,792 botocore.auth [DEBUG] CanonicalRequest:
PUT
/api/v1/files/riesgosfiles/botoTest.txt

content-md5:eywNJv4s+85QTBUP4zlw4w==
host:138.246.225.182
x-amz-content-sha256:dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d
x-amz-date:20230213T094757Z

content-md5;host;x-amz-content-sha256;x-amz-date
dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d
2023-02-13 10:47:57,792 botocore.auth [DEBUG] CanonicalRequest:
PUT
/api/v1/files/riesgosfiles/botoTest.txt

content-md5:eywNJv4s+85QTBUP4zlw4w==
host:138.246.225.182
x-amz-content-sha256:dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d
x-amz-date:20230213T094757Z

content-md5;host;x-amz-content-sha256;x-amz-date
dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d
2023-02-13 10:47:57,792 botocore.auth [DEBUG] CanonicalRequest:
PUT
/api/v1/files/riesgosfiles/botoTest.txt

content-md5:eywNJv4s+85QTBUP4zlw4w==
host:138.246.225.182
x-amz-content-sha256:dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d
x-amz-date:20230213T094757Z

content-md5;host;x-amz-content-sha256;x-amz-date
dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d
2023-02-13 10:47:57,793 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20230213T094757Z
20230213/us-east-1/s3/aws4_request
8f487568db1ea8fccb10a6b4dcd2629ecc85955e661a1881ea2e91a6fcf2d41c
2023-02-13 10:47:57,793 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20230213T094757Z
20230213/us-east-1/s3/aws4_request
8f487568db1ea8fccb10a6b4dcd2629ecc85955e661a1881ea2e91a6fcf2d41c
2023-02-13 10:47:57,793 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20230213T094757Z
20230213/us-east-1/s3/aws4_request
8f487568db1ea8fccb10a6b4dcd2629ecc85955e661a1881ea2e91a6fcf2d41c
2023-02-13 10:47:57,793 botocore.auth [DEBUG] Signature:
0f5e617f0a64b4fdba8b86c30ea3561743d383af049b99963568df455edeb59b
2023-02-13 10:47:57,793 botocore.auth [DEBUG] Signature:
0f5e617f0a64b4fdba8b86c30ea3561743d383af049b99963568df455edeb59b
2023-02-13 10:47:57,793 botocore.auth [DEBUG] Signature:
0f5e617f0a64b4fdba8b86c30ea3561743d383af049b99963568df455edeb59b
2023-02-13 10:47:57,794 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function signal_transferring at 0x7fe1423dd3a0>
2023-02-13 10:47:57,794 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function signal_transferring at 0x7fe1423dd3a0>
2023-02-13 10:47:57,794 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function signal_transferring at 0x7fe1423dd3a0>
2023-02-13 10:47:57,795 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function add_retry_headers at 0x7fe142dfc670>
2023-02-13 10:47:57,795 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function add_retry_headers at 0x7fe142dfc670>
2023-02-13 10:47:57,795 botocore.hooks [DEBUG] Event request-created.s3.PutObject: calling handler <function add_retry_headers at 0x7fe142dfc670>
2023-02-13 10:47:57,795 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=PUT, url=http://138.246.225.182:80/api/v1/files/riesgosfiles/botoTest.txt, headers={'User-Agent': b'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'Content-MD5': b'eywNJv4s+85QTBUP4zlw4w==', 'Expect': b'100-continue', 'X-Amz-Date': b'20230213T094757Z', 'X-Amz-Content-SHA256': b'dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d', 'Authorization': b'AWS4-HMAC-SHA256 Credential=developer/20230213/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=0f5e617f0a64b4fdba8b86c30ea3561743d383af049b99963568df455edeb59b', 'amz-sdk-invocation-id': b'dc913fd0-102d-442a-9f9c-010b93e4c716', 'amz-sdk-request': b'attempt=1', 'Content-Length': '61'}>
2023-02-13 10:47:57,795 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=PUT, url=http://138.246.225.182:80/api/v1/files/riesgosfiles/botoTest.txt, headers={'User-Agent': b'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'Content-MD5': b'eywNJv4s+85QTBUP4zlw4w==', 'Expect': b'100-continue', 'X-Amz-Date': b'20230213T094757Z', 'X-Amz-Content-SHA256': b'dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d', 'Authorization': b'AWS4-HMAC-SHA256 Credential=developer/20230213/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=0f5e617f0a64b4fdba8b86c30ea3561743d383af049b99963568df455edeb59b', 'amz-sdk-invocation-id': b'dc913fd0-102d-442a-9f9c-010b93e4c716', 'amz-sdk-request': b'attempt=1', 'Content-Length': '61'}>
2023-02-13 10:47:57,795 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=PUT, url=http://138.246.225.182:80/api/v1/files/riesgosfiles/botoTest.txt, headers={'User-Agent': b'Boto3/1.26.69 Python/3.9.13 Linux/5.15.0-58-generic Botocore/1.29.69 Resource', 'Content-MD5': b'eywNJv4s+85QTBUP4zlw4w==', 'Expect': b'100-continue', 'X-Amz-Date': b'20230213T094757Z', 'X-Amz-Content-SHA256': b'dd4610e8711301dfb2e99c14daa8f873d5370961867f5dc120111de1fbab8e1d', 'Authorization': b'AWS4-HMAC-SHA256 Credential=developer/20230213/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=0f5e617f0a64b4fdba8b86c30ea3561743d383af049b99963568df455edeb59b', 'amz-sdk-invocation-id': b'dc913fd0-102d-442a-9f9c-010b93e4c716', 'amz-sdk-request': b'attempt=1', 'Content-Length': '61'}>
2023-02-13 10:47:57,808 botocore.awsrequest [DEBUG] Waiting for 100 Continue response.
2023-02-13 10:47:57,808 botocore.awsrequest [DEBUG] Waiting for 100 Continue response.
2023-02-13 10:47:57,808 botocore.awsrequest [DEBUG] Waiting for 100 Continue response.
2023-02-13 10:47:57,819 botocore.awsrequest [DEBUG] 100 Continue response seen, now sending request body.
2023-02-13 10:47:57,819 botocore.awsrequest [DEBUG] 100 Continue response seen, now sending request body.
2023-02-13 10:47:57,819 botocore.awsrequest [DEBUG] 100 Continue response seen, now sending request body.
2023-02-13 10:47:57,844 botocore.parsers [DEBUG] Response headers: {'Server': 'nginx/1.23.2', 'Date': 'Mon, 13 Feb 2023 09:47:57 GMT', 'Content-Type': 'application/xml', 'Content-Length': '445', 'Accept-Ranges': 'bytes', 'Content-Security-Policy': 'block-all-mixed-content', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Vary': 'Origin, Accept-Encoding', 'X-Amz-Request-Id': '1743594DFE9F4E10', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'Cache-Control': 'proxy-revalidate', 'Connection': 'Keep-Alive'}
2023-02-13 10:47:57,844 botocore.parsers [DEBUG] Response headers: {'Server': 'nginx/1.23.2', 'Date': 'Mon, 13 Feb 2023 09:47:57 GMT', 'Content-Type': 'application/xml', 'Content-Length': '445', 'Accept-Ranges': 'bytes', 'Content-Security-Policy': 'block-all-mixed-content', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Vary': 'Origin, Accept-Encoding', 'X-Amz-Request-Id': '1743594DFE9F4E10', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'Cache-Control': 'proxy-revalidate', 'Connection': 'Keep-Alive'}
2023-02-13 10:47:57,844 botocore.parsers [DEBUG] Response headers: {'Server': 'nginx/1.23.2', 'Date': 'Mon, 13 Feb 2023 09:47:57 GMT', 'Content-Type': 'application/xml', 'Content-Length': '445', 'Accept-Ranges': 'bytes', 'Content-Security-Policy': 'block-all-mixed-content', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Vary': 'Origin, Accept-Encoding', 'X-Amz-Request-Id': '1743594DFE9F4E10', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'Cache-Control': 'proxy-revalidate', 'Connection': 'Keep-Alive'}
2023-02-13 10:47:57,845 botocore.parsers [DEBUG] Response body:
b'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Key>riesgosfiles/botoTest.txt</Key><BucketName>riesgosfiles</BucketName><Resource>/riesgosfiles/riesgosfiles/botoTest.txt</Resource><RequestId>1743594DFE9F4E10</RequestId><HostId>a36cfe05-63c0-43bf-a94a-f1fb70410bcd</HostId></Error>'
2023-02-13 10:47:57,845 botocore.parsers [DEBUG] Response body:
b'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Key>riesgosfiles/botoTest.txt</Key><BucketName>riesgosfiles</BucketName><Resource>/riesgosfiles/riesgosfiles/botoTest.txt</Resource><RequestId>1743594DFE9F4E10</RequestId><HostId>a36cfe05-63c0-43bf-a94a-f1fb70410bcd</HostId></Error>'
2023-02-13 10:47:57,845 botocore.parsers [DEBUG] Response body:
b'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Key>riesgosfiles/botoTest.txt</Key><BucketName>riesgosfiles</BucketName><Resource>/riesgosfiles/riesgosfiles/botoTest.txt</Resource><RequestId>1743594DFE9F4E10</RequestId><HostId>a36cfe05-63c0-43bf-a94a-f1fb70410bcd</HostId></Error>'
2023-02-13 10:47:57,846 botocore.hooks [DEBUG] Event needs-retry.s3.PutObject: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe137cccd30>
2023-02-13 10:47:57,846 botocore.hooks [DEBUG] Event needs-retry.s3.PutObject: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe137cccd30>
2023-02-13 10:47:57,846 botocore.hooks [DEBUG] Event needs-retry.s3.PutObject: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe137cccd30>
2023-02-13 10:47:57,847 botocore.retryhandler [DEBUG] No retry needed.
2023-02-13 10:47:57,847 botocore.retryhandler [DEBUG] No retry needed.
2023-02-13 10:47:57,847 botocore.retryhandler [DEBUG] No retry needed.
2023-02-13 10:47:57,847 botocore.hooks [DEBUG] Event needs-retry.s3.PutObject: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,847 botocore.hooks [DEBUG] Event needs-retry.s3.PutObject: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
2023-02-13 10:47:57,847 botocore.hooks [DEBUG] Event needs-retry.s3.PutObject: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x7fe137cccdf0>>
MichaelLangbein commented 1 year ago
MichaelLangbein commented 1 year ago

Client set up with this PR: https://github.com/riesgos/async/pull/48