Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetObject fails #3183

Closed
1 task
ajuanr opened this issue Nov 8, 2024 · 1 comment
Closed
1 task

GetObject fails #3183

ajuanr opened this issue Nov 8, 2024 · 1 comment
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue third-party This issue is related to third-party libraries or applications.

Comments

@ajuanr
Copy link

ajuanr commented Nov 8, 2024

Describe the bug

I'm using the sdk with Apache Ozone.
https://ozone.apache.org/

I'm able to PutObject(), HeadObject(), and DeleteObject() using s3 client (winhttp/wininet). When I try to GetObject(), this is failing.

Testing using the examples provided here:
https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/examples-s3-objects.html

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Running the examples from the developer guide, I expected get object request to succeed.

[verify access]
head bucket request was ok
[put]
Success: Object 'sdk_test/blob' with content 'the quick brown fox' uploaded to bucket '0123456789abcdef'.
[get meta]
content-type: text/plain
cache-control: no-cache
[get object]
Error: getObject: :
get blob failed
[delete]
Successfully deleted the object.

Current Behavior

GetObject request fails.

log includes HeadObject() and GetObject()

[DEBUG] 2024-11-08 00:33:02.019 ClientConfiguration [25860] Request Compression enabled
[DEBUG] 2024-11-08 00:33:02.019 ClientConfiguration [25860] ClientConfiguration will use MinReqCompression: 10240
[DEBUG] 2024-11-08 00:33:02.019 ClientConfiguration [25860] ClientConfiguration will use SDK Auto Resolved profile: [default] if not specified by users.
[WARN] 2024-11-08 00:33:02.024 HttpClientFactory_helper [25860] Client type not supported. Using WinHttpSyncHttpClient.
[INFO] 2024-11-08 00:33:02.025 WinHttpSyncHttpClient [25860] Creating http client with user agent with max connections 25 request timeout 3000,and connect timeout 1000
[DEBUG] 2024-11-08 00:33:02.025 WinHttpSyncHttpClient [25860] Enabling WinHttp traces
[DEBUG] 2024-11-08 00:33:02.025 WinHttpSyncHttpClient [25860] API handle 000001E2DCDEB630
[INFO] 2024-11-08 00:33:02.025 ConnectionPoolMgr [25860] Creating connection pool mgr with handle 000001E2DCDEB630, and max connections per host 25, request timeout 3000 ms, and connect timeout in 1000 ms, enabling TCP keep-alive.
[INFO] 2024-11-08 00:33:02.025 ClientConfiguration [25860] Retry Strategy will use the default max attempts.
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Region = us-east-1
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: UseFIPS = 0
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: UseDualStack = 0
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Endpoint = http://HOST:29878
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: UseArnRegion = 0
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: DisableMultiRegionAccessPoints = 0
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: ForcePathStyle = 1
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Bucket = 0123456789abcdef
[TRACE] 2024-11-08 00:33:02.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Key = sdk_test/blob
[DEBUG] 2024-11-08 00:33:02.041 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint rules engine evaluated the endpoint: http://HOST:29878/0123456789abcdef
[TRACE] 2024-11-08 00:33:02.041 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint rules evaluated props: {"authSchemes":[{"disableDoubleEncoding":true,"name":"sigv4","signingName":"s3","signingRegion":"us-east-1"}]}
[TRACE] 2024-11-08 00:33:02.044 AWSClient [25860] No content body, content-length headers
[DEBUG] 2024-11-08 00:33:02.044 AWSAuthV4Signer [25860] Using cached empty string sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 because payload is empty.
[DEBUG] 2024-11-08 00:33:02.045 AWSAuthV4Signer [25860] Canonical Header String: amz-sdk-invocation-id:3AF4FAE8-46BB-4311-987A-BDAF1571985A
amz-sdk-request:attempt=1
content-type:application/xml
host:HOST:29878
x-amz-api-version:2006-03-01
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20241108T003302Z

[DEBUG] 2024-11-08 00:33:02.045 AWSAuthV4Signer [25860] Signed Headers value:amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date
[DEBUG] 2024-11-08 00:33:02.045 AWSAuthV4Signer [25860] Canonical Request String: HEAD
/0123456789abcdef/sdk_test/blob

amz-sdk-invocation-id:3AF4FAE8-46BB-4311-987A-BDAF1571985A
amz-sdk-request:attempt=1
content-type:application/xml
host:HOST:29878
x-amz-api-version:2006-03-01
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20241108T003302Z

amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[DEBUG] 2024-11-08 00:33:02.045 AWSAuthV4Signer [25860] Final String to sign: AWS4-HMAC-SHA256
20241108T003302Z
20241108/us-east-1/s3/aws4_request
32ee50f904437ae012470d07aa079148b10d44b50091b12295fe4a2d6ee83970
[DEBUG] 2024-11-08 00:33:02.045 AWSAuthV4Signer [25860] Final computed signing hash: 76c44359c71218f7dae45e988226777b22ba8a121926b425ad7252daf034dd89
[DEBUG] 2024-11-08 00:33:02.045 AWSAuthV4Signer [25860] Signing request with: AWS4-HMAC-SHA256 Credential=ACCESSKEY/20241108/us-east-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date, Signature=76c44359c71218f7dae45e988226777b22ba8a121926b425ad7252daf034dd89
[DEBUG] 2024-11-08 00:33:02.045 AWSClient [25860] Request Successfully signed
[TRACE] 2024-11-08 00:33:02.045 WinHttpSyncHttpClient [25860] Making HEAD request to uri http://HOST:29878/0123456789abcdef/sdk_test/blob
[INFO] 2024-11-08 00:33:02.045 WinHttpConnectionPoolMgr [25860] Attempting to acquire connection for HOST:29878
[DEBUG] 2024-11-08 00:33:02.045 WinHttpConnectionPoolMgr [25860] Pool doesn't exist for endpoint, creating...
[DEBUG] 2024-11-08 00:33:02.045 WinHttpConnectionPoolMgr [25860] Pool has no available existing connections for endpoint, attempting to grow pool.
[TRACE] 2024-11-08 00:33:02.045 WinHttp [25860] An HINTERNET handle has been created.
[TRACE] 2024-11-08 00:33:02.045 WinHttp [25860] An HINTERNET handle has been created.
[INFO] 2024-11-08 00:33:02.045 WinConnectionContainer [25860] Pool grown by 2
[INFO] 2024-11-08 00:33:02.045 WinHttpConnectionPoolMgr [25860] Connection now available, continuing.
[DEBUG] 2024-11-08 00:33:02.045 WinHttpConnectionPoolMgr [25860] Returning connection handle 000001E2DCD9E8E0
[DEBUG] 2024-11-08 00:33:02.045 WinHttpSyncHttpClient [25860] Acquired connection 000001E2DCD9E8E0
[TRACE] 2024-11-08 00:33:02.045 WinHttp [25860] An HINTERNET handle has been created.
[DEBUG] 2024-11-08 00:33:02.046 WinHttpSyncHttpClient [25860] AllocateWindowsHttpRequest returned handle 000001E2DD5EE3F0
[DEBUG] 2024-11-08 00:33:02.046 WinHttpSyncHttpClient [25860] with headers:
[DEBUG] 2024-11-08 00:33:02.046 WinHttpSyncHttpClient [25860] amz-sdk-invocation-id: 3AF4FAE8-46BB-4311-987A-BDAF1571985A

amz-sdk-request: attempt=1

authorization: AWS4-HMAC-SHA256 Credential=ACCESSKEY/20241108/us-east-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date, Signature=76c44359c71218f7dae45e988226777b22ba8a121926b425ad7252daf034dd89

content-type: application/xml

host: HOST:29878

user-agent: aws-sdk-cpp/1.11.441 ua/2.0 md/aws-crt#0.29.3-dev+a6b92ba0 os/Windows#10.0.19041.4842 md/arch#AMD64 lang/c++#C++199711L md/MSVC#1938 api/S3

x-amz-api-version: 2006-03-01

x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

x-amz-date: 20241108T003302Z

[TRACE] 2024-11-08 00:33:02.068 WinHttp [25860] Looking up the IP address of a server name. Trying to resolve 'HOST'
[TRACE] 2024-11-08 00:33:02.089 WinHttp [25860] Successfully found the IP address of the server. Name resolved is 10.13.102.135
[TRACE] 2024-11-08 00:33:02.092 WinHttp [25860] Connecting to the server. IP address is 10.13.102.135
[TRACE] 2024-11-08 00:33:02.097 WinHttp [25860] Successfully connected to the server. IP address is 10.13.102.135
[TRACE] 2024-11-08 00:33:02.097 WinHttp [25860] Sending the information request to the server.
[TRACE] 2024-11-08 00:33:02.097 WinHttp [25860] Successfully sent the information request to the server. Sent 829 bytes
[TRACE] 2024-11-08 00:33:02.106 WinHttp [25860] Waiting for the server to respond to a request.
[TRACE] 2024-11-08 00:33:02.106 WinHttp [25860] Successfully received a response from the server. Received 466 bytes
[DEBUG] 2024-11-08 00:33:02.106 WinHttpSyncHttpClient [25860] Received response code 200
[DEBUG] 2024-11-08 00:33:02.106 WinHttpSyncHttpClient [25860] Received content type text/plain
[DEBUG] 2024-11-08 00:33:02.106 WinHttpSyncHttpClient [25860] Received headers:
[DEBUG] 2024-11-08 00:33:02.106 WinHttpSyncHttpClient [25860] HTTP/1.1 200 OK

Cache-Control: no-transform

Date: Fri, 08 Nov 2024 00:33:02 GMT

Pragma: no-cache

Content-Length: 19

Content-Type: text/plain

Expires: Fri, 08 Nov 2024 00:33:02 GMT

Last-Modified: Fri, 08 Nov 2024 00:18:35 GMT

ETag: "30f3c93e46436deb58ba70816a8ec124"

Server: Ozone

X-Content-Type-Options: nosniff

X-XSS-Protection: 1; mode=block

X-FRAME-OPTIONS: SAMEORIGIN

x-amz-id-2: nhYK1y7w5

x-amz-request-id: 17d1940c-a91b-4afa-94bd-13c87d632579

[DEBUG] 2024-11-08 00:33:02.106 WinHttpSyncHttpClient [25860] Closing http request handle 000001E2DD5EE3F0
[TRACE] 2024-11-08 00:33:02.106 WinHttp [25860] An HINTERNET handle has been terminated.
[DEBUG] 2024-11-08 00:33:02.106 WinHttpSyncHttpClient [25860] Releasing connection handle 000001E2DCD9E8E0
[DEBUG] 2024-11-08 00:33:02.106 WinHttpConnectionPoolMgr [25860] Releasing connection to endpoint HOST:29878
[DEBUG] 2024-11-08 00:33:02.106 AWSClient [25860] Request returned successful response.
[TRACE] 2024-11-08 00:33:02.106 AWSClient [25860] Request successful returning.
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Region = us-east-1
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: UseFIPS = 0
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: UseDualStack = 0
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Endpoint = http://HOST:29878
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: UseArnRegion = 0
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: DisableMultiRegionAccessPoints = 0
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint bool eval parameter: ForcePathStyle = 1
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Bucket = 0123456789abcdef
[TRACE] 2024-11-08 00:33:15.040 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint str eval parameter: Key = sdk_test/blob
[DEBUG] 2024-11-08 00:33:15.041 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint rules engine evaluated the endpoint: http://HOST:29878/0123456789abcdef
[TRACE] 2024-11-08 00:33:15.041 Aws::Endpoint::DefaultEndpointProvider [25860] Endpoint rules evaluated props: {"authSchemes":[{"disableDoubleEncoding":true,"name":"sigv4","signingName":"s3","signingRegion":"us-east-1"}]}
[TRACE] 2024-11-08 00:33:15.041 AWSClient [25860] No content body, content-length headers
[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Using cached empty string sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 because payload is empty.
[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Canonical Header String: amz-sdk-invocation-id:0401BE18-68B4-4457-8887-DA28946421BA
amz-sdk-request:attempt=1
content-type:application/xml
host:HOST:29878
x-amz-api-version:2006-03-01
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20241108T003315Z

[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Signed Headers value:amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date
[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Canonical Request String: GET
/0123456789abcdef/sdk_test/blob

amz-sdk-invocation-id:0401BE18-68B4-4457-8887-DA28946421BA
amz-sdk-request:attempt=1
content-type:application/xml
host:HOST:29878
x-amz-api-version:2006-03-01
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20241108T003315Z

amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Final String to sign: AWS4-HMAC-SHA256
20241108T003315Z
20241108/us-east-1/s3/aws4_request
efaed9e4014170685cfdb1354e6f237d92fbc04c1defe40a49d2d7cf8afe9469
[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Final computed signing hash: dd255054bf98f95bc9ae547914af2d8f39aebdb12fe2f286739fe9b617a071e9
[DEBUG] 2024-11-08 00:33:15.042 AWSAuthV4Signer [25860] Signing request with: AWS4-HMAC-SHA256 Credential=ACCESSKEY/20241108/us-east-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date, Signature=dd255054bf98f95bc9ae547914af2d8f39aebdb12fe2f286739fe9b617a071e9
[DEBUG] 2024-11-08 00:33:15.042 AWSClient [25860] Request Successfully signed
[TRACE] 2024-11-08 00:33:15.042 WinHttpSyncHttpClient [25860] Making GET request to uri http://HOST:29878/0123456789abcdef/sdk_test/blob
[INFO] 2024-11-08 00:33:15.042 WinHttpConnectionPoolMgr [25860] Attempting to acquire connection for HOST:29878
[DEBUG] 2024-11-08 00:33:15.042 WinHttpConnectionPoolMgr [25860] Pool found, reusing
[INFO] 2024-11-08 00:33:15.042 WinHttpConnectionPoolMgr [25860] Connection now available, continuing.
[DEBUG] 2024-11-08 00:33:15.042 WinHttpConnectionPoolMgr [25860] Returning connection handle 000001E2DCD9E8E0
[DEBUG] 2024-11-08 00:33:15.042 WinHttpSyncHttpClient [25860] Acquired connection 000001E2DCD9E8E0
[TRACE] 2024-11-08 00:33:15.042 WinHttp [25860] An HINTERNET handle has been created.
[DEBUG] 2024-11-08 00:33:15.042 WinHttpSyncHttpClient [25860] AllocateWindowsHttpRequest returned handle 000001E2DD63AFB0
[DEBUG] 2024-11-08 00:33:15.042 WinHttpSyncHttpClient [25860] with headers:
[DEBUG] 2024-11-08 00:33:15.042 WinHttpSyncHttpClient [25860] amz-sdk-invocation-id: 0401BE18-68B4-4457-8887-DA28946421BA

amz-sdk-request: attempt=1

authorization: AWS4-HMAC-SHA256 Credential=ACCESSKEY/20241108/us-east-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date, Signature=dd255054bf98f95bc9ae547914af2d8f39aebdb12fe2f286739fe9b617a071e9

content-type: application/xml

host: HOST:29878

user-agent: aws-sdk-cpp/1.11.441 ua/2.0 md/aws-crt#0.29.3-dev+a6b92ba0 os/Windows#10.0.19041.4842 md/arch#AMD64 lang/c++#C++199711L md/MSVC#1938 api/S3

x-amz-api-version: 2006-03-01

x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

x-amz-date: 20241108T003315Z

[TRACE] 2024-11-08 00:33:15.043 WinHttp [25860] Sending the information request to the server.
[TRACE] 2024-11-08 00:33:15.043 WinHttp [25860] Successfully sent the information request to the server. Sent 828 bytes
[TRACE] 2024-11-08 00:33:15.049 WinHttp [25860] Waiting for the server to respond to a request.
[TRACE] 2024-11-08 00:33:15.049 WinHttp [25860] Successfully received a response from the server. Received 257 bytes
[DEBUG] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Received response code 500
[DEBUG] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Received content type text/html;charset=iso-8859-1
[DEBUG] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Received headers:
[DEBUG] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] HTTP/1.1 500 Server Error

Cache-Control: must-revalidate,no-cache,no-store

Pragma: no-cache

Content-Length: 397

Content-Type: text/html;charset=iso-8859-1

X-Content-Type-Options: nosniff

X-XSS-Protection: 1; mode=block

X-FRAME-OPTIONS: SAMEORIGIN

[TRACE] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Response content-length header: 397
[TRACE] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Response body length: 397
[DEBUG] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Closing http request handle 000001E2DD63AFB0
[TRACE] 2024-11-08 00:33:15.049 WinHttp [25860] An HINTERNET handle has been terminated.
[DEBUG] 2024-11-08 00:33:15.049 WinHttpSyncHttpClient [25860] Releasing connection handle 000001E2DCD9E8E0
[DEBUG] 2024-11-08 00:33:15.049 WinHttpConnectionPoolMgr [25860] Releasing connection to endpoint HOST:29878
[DEBUG] 2024-11-08 00:33:15.049 AWSClient [25860] Request returned error. Attempting to generate appropriate error codes from response
[TRACE] 2024-11-08 00:33:15.050 AWSErrorMarshaller [25860] Error response is

<title>Error 500 Bad Request</title>

HTTP ERROR 500 Bad Request

URI: /0123456789abcdef/sdk_test/blob
STATUS: 500
MESSAGE: Bad Request
SERVLET: jaxrs

[WARN] 2024-11-08 00:33:15.050 AWSErrorMarshaller [25860] Unable to generate a proper httpResponse from the response stream. Response code: 500
[ERROR] 2024-11-08 00:33:15.051 AWSXmlClient [25860] HTTP response code: 500
Resolved remote host IP address:
Request ID:
Exception name:
Error message:
7 response headers:
cache-control : must-revalidate,no-cache,no-store
content-length : 397
content-type : text/html;charset=iso-8859-1
pragma : no-cache
x-content-type-options : nosniff
x-frame-options : SAMEORIGIN
x-xss-protection : 1; mode=block
[WARN] 2024-11-08 00:33:15.051 AWSClient [25860] If the signature check failed. This could be because of a time skew. Attempting to adjust the signer.
[DEBUG] 2024-11-08 00:33:15.051 AWSClient [25860] Date header was not found in the response, can't attempt to detect clock skew
[WARN] 2024-11-08 00:33:15.051 AWSClient [25860] Request failed, now waiting 0 ms before attempting again.
[TRACE] 2024-11-08 00:33:15.051 AWSClient [25860] No content body, content-length headers
[DEBUG] 2024-11-08 00:33:15.051 AWSAuthV4Signer [25860] Using cached empty string sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 because payload is empty.
[DEBUG] 2024-11-08 00:33:15.051 AWSAuthV4Signer [25860] Canonical Header String: amz-sdk-invocation-id:0401BE18-68B4-4457-8887-DA28946421BA

// removed attempts 2-11

[DEBUG] 2024-11-08 00:33:40.758 WinSyncHttpClient [25860] Cleaning up client with handle 0000000000000000
[INFO] 2024-11-08 00:33:40.758 WinHttpConnectionPoolMgr [25860] Cleaning up connection pool mgr.
[DEBUG] 2024-11-08 00:33:40.758 WinHttpConnectionPoolMgr [25860] Closing handle 000001E2DCD9E260
[TRACE] 2024-11-08 00:33:40.759 WinHttp [25860] An HINTERNET handle has been terminated.
[DEBUG] 2024-11-08 00:33:40.759 WinHttpConnectionPoolMgr [25860] Closing handle 000001E2DCD9E8E0
[TRACE] 2024-11-08 00:33:40.759 WinHttp [25860] An HINTERNET handle has been terminated.
[TRACE] 2024-11-08 00:33:40.759 WinHttp [25860] An HINTERNET handle has been terminated.

Reproduction Steps

Aws::UniquePtr<Aws::S3::S3Client> init_client()
{
  Aws::Client::ClientConfiguration client_config;
  client_config.scheme = Aws::Http::Scheme::HTTP;
  client_config.region = "us-east-1";
  client_config.endpointOverride = "http://HOST:29878";
  client_config.enableHttpClientTrace = true;

  static constexpr auto signPayloads{ Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never }; // default=Never
  static constexpr auto USEast1RegionalEndPointOption = Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET; // default=Not_set
  static constexpr bool useVirtualAddressing{ false };

  auto credentials_provider = Aws::MakeUnique<Aws::Auth::SimpleAWSCredentialsProvider>("", Aws::String("ACCESSKEY"), Aws::String("SECRETKEY"));
#if 0
  return Aws::MakeUnique<Aws::S3::S3Client>("S3Client", std::move(credentials_provider), client_config, signPayloads, useVirtualAddressing, USEast1RegionalEndPointOption);
#else
  Aws::S3::S3ClientConfiguration s3_config{ client_config, signPayloads, useVirtualAddressing, USEast1RegionalEndPointOption };
  return Aws::MakeUnique<Aws::S3::S3Client>("S3Client", std::move(credentials_provider), nullptr, s3_config);
#endif
}

bool get_blob(const Aws::S3::S3Client& client, const Aws::String& bucket, const Aws::String& key, std::string& buffer)
{
  Aws::S3::Model::GetObjectRequest request;
  request.SetBucket(bucket);
  request.SetKey(key);

  Aws::S3::Model::GetObjectOutcome outcome =
    client.GetObject(request);

  if (!outcome.IsSuccess()) {
    const Aws::S3::S3Error& err = outcome.GetError();
    std::cerr << "Error: getObject: " <<
      err.GetExceptionName() << ": " << err.GetMessage() << std::endl;
  }
  else {
    std::cout << "Successfully retrieved '" << key << "' from '"
      << bucket << "'." << std::endl;
  }

  return outcome.IsSuccess();
}

int main()
{
// init sdk
// init client (using code above) [ok]
// put object [ok]
// get metadata [ok]
// get object contents (using code above) [FAIL]
// delete object [ok]

return 0;
}

Possible Solution

No response

Additional Information/Context

This doesn't appear to be an issue with the objectstore. Also tested using the python sdk (boto3) and was able to successfully get the object.

#get object and print results
#get_obj_resp = client.get_object(Bucket=bucket, Key=key)
#obj_body = get_obj_resp['Body'].read().decode('utf-8')
#print(f"\n\nobject body:\n{obj_body}\n\n")
object body:
the quick brown fox

[boto3 logs]
2024-11-07 15:46:18,987 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2024-11-07 15:46:18,992 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2024-11-07 15:46:18,993 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2024-11-07 15:46:18,996 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2024-11-07 15:46:18,996 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2024-11-07 15:46:18,997 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2024-11-07 15:46:18,998 botocore.hooks [DEBUG] Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2024-11-07 15:46:19,004 botocore.hooks [DEBUG] Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2024-11-07 15:46:19,005 botocore.hooks [DEBUG] Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2024-11-07 15:46:19,005 botocore.hooks [DEBUG] Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2024-11-07 15:46:19,006 botocore.hooks [DEBUG] Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2024-11-07 15:46:19,015 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data\endpoints.json
2024-11-07 15:46:19,049 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data\sdk-default-configuration.json
2024-11-07 15:46:19,049 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x000001976DE0E2A0>
2024-11-07 15:46:19,192 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data\s3\2006-03-01\service-2.json.gz
2024-11-07 15:46:19,211 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data\s3\2006-03-01\service-2.sdk-extras.json
2024-11-07 15:46:19,338 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data\s3\2006-03-01\endpoint-rule-set-1.json.gz
2024-11-07 15:46:19,346 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data\partitions.json
2024-11-07 15:46:19,353 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x000001976DD38360>
2024-11-07 15:46:19,353 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function lazy_call.._handler at 0x000001976E0A7560>
2024-11-07 15:46:19,420 botocore.hooks [DEBUG] Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x000001976DD380E0>
2024-11-07 15:46:19,429 botocore.endpoint [DEBUG] Setting s3 timeout as (60, 60)
2024-11-07 15:46:19,435 botocore.loaders [DEBUG] Loading JSON file: E:\VS_projects\aws_sdk_python\env\Lib\site-packages\botocore\data_retry.json
2024-11-07 15:46:19,436 botocore.client [DEBUG] Registering retry handlers for service: s3
2024-11-07 15:46:19,437 botocore.utils [DEBUG] Registering S3 region redirector handler
2024-11-07 15:46:19,438 botocore.utils [DEBUG] Registering S3Express Identity Resolver
2024-11-07 15:46:19,441 botocore.hooks [DEBUG] Event before-parameter-build.s3.GetObject: calling handler <function sse_md5 at 0x000001976DE40180>
2024-11-07 15:46:19,441 botocore.hooks [DEBUG] Event before-parameter-build.s3.GetObject: calling handler <function validate_bucket_name at 0x000001976DE400E0>
2024-11-07 15:46:19,441 botocore.hooks [DEBUG] Event before-parameter-build.s3.GetObject: calling handler <function remove_bucket_from_url_paths_from_model at 0x000001976DE422A0>
2024-11-07 15:46:19,442 botocore.hooks [DEBUG] Event before-parameter-build.s3.GetObject: calling handler <bound method S3RegionRedirectorv2.annotate_request_context of <botocore.utils.S3RegionRedirectorv2 object at 0x000001976FAFDB50>>
2024-11-07 15:46:19,442 botocore.hooks [DEBUG] Event before-parameter-build.s3.GetObject: calling handler <bound method ClientCreator._inject_s3_input_parameters of <botocore.client.ClientCreator object at 0x000001976F623BD0>>
2024-11-07 15:46:19,442 botocore.hooks [DEBUG] Event before-parameter-build.s3.GetObject: calling handler <function generate_idempotent_uuid at 0x000001976DE0FEC0>
2024-11-07 15:46:19,444 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <function customize_endpoint_resolver_builtins at 0x000001976DE42480>
2024-11-07 15:46:19,444 botocore.hooks [DEBUG] Event before-endpoint-resolution.s3: calling handler <bound method S3RegionRedirectorv2.redirect_from_cache of <botocore.utils.S3RegionRedirectorv2 object at 0x000001976FAFDB50>>
2024-11-07 15:46:19,446 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Bucket': '0123456789abcdef', 'Region': 'us-east-1', 'UseFIPS': False, 'UseDualStack': False, 'Endpoint': 'http://HOST:29878', 'ForcePathStyle': True, 'Accelerate': False, 'UseGlobalEndpoint': True, 'Key': 'sdk_test/blob', 'DisableMultiRegionAccessPoints': False, 'UseArnRegion': True}
2024-11-07 15:46:19,449 botocore.regions [DEBUG] Endpoint provider result: http://HOST:29878/0123456789abcdef
2024-11-07 15:46:19,450 botocore.regions [DEBUG] Selecting from endpoint provider's list of auth schemes: "sigv4". User selected auth scheme is: "v4"
2024-11-07 15:46:19,450 botocore.regions [DEBUG] Selected auth type "v4" as "v4" with signing context params: {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}
2024-11-07 15:46:19,452 botocore.hooks [DEBUG] Event before-call.s3.GetObject: calling handler <function add_expect_header at 0x000001976DE404A0>
2024-11-07 15:46:19,452 botocore.hooks [DEBUG] Event before-call.s3.GetObject: calling handler <bound method S3ExpressIdentityResolver.apply_signing_cache_key of <botocore.utils.S3ExpressIdentityResolver object at 0x000001976FB0A850>>
2024-11-07 15:46:19,452 botocore.hooks [DEBUG] Event before-call.s3.GetObject: calling handler <function add_recursion_detection_header at 0x000001976DE0F880>
2024-11-07 15:46:19,452 botocore.hooks [DEBUG] Event before-call.s3.GetObject: calling handler <function inject_api_version_header_if_needed at 0x000001976DE419E0>
2024-11-07 15:46:19,453 botocore.endpoint [DEBUG] Making request for OperationModel(name=GetObject) with params: {'url_path': '/sdk_test/blob', 'query_string': {}, 'method': 'GET', 'headers': {'User-Agent': 'Boto3/1.35.54 md/Botocore#1.35.54 ua/2.0 os/windows#10 md/arch#amd64 lang/python#3.11.2 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.35.54'}, 'body': b'', 'auth_path': '/0123456789abcdef/sdk_test/blob', 'url': 'http://HOST:29878/0123456789abcdef/sdk_test/blob', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x000001976F93F4D0>, 'has_streaming_input': False, 'auth_type': 'v4', 'unsigned_payload': None, 's3_redirect': {'redirected': False, 'bucket': '0123456789abcdef', 'params': {'Bucket': '0123456789abcdef', 'Key': 'sdk_test/blob'}}, 'input_params': {'Bucket': '0123456789abcdef', 'Key': 'sdk_test/blob'}, 'signing': {'region': 'us-east-1', 'signing_name': 's3', 'disableDoubleEncoding': True}, 'endpoint_properties': {'authSchemes': [{'disableDoubleEncoding': True, 'name': 'sigv4', 'signingName': 's3', 'signingRegion': 'us-east-1'}]}}}
2024-11-07 15:46:19,455 botocore.hooks [DEBUG] Event request-created.s3.GetObject: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x000001976FADE650>>
2024-11-07 15:46:19,456 botocore.hooks [DEBUG] Event choose-signer.s3.GetObject: calling handler <function set_operation_specific_signer at 0x000001976DE0FCE0>
2024-11-07 15:46:19,456 botocore.hooks [DEBUG] Event before-sign.s3.GetObject: calling handler <function remove_arn_from_signing_path at 0x000001976DE423E0>
2024-11-07 15:46:19,456 botocore.hooks [DEBUG] Event before-sign.s3.GetObject: calling handler <bound method S3ExpressIdentityResolver.resolve_s3express_identity of <botocore.utils.S3ExpressIdentityResolver object at 0x000001976FB0A850>>
2024-11-07 15:46:19,457 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-11-07 15:46:19,457 botocore.auth [DEBUG] CanonicalRequest:
GET
/0123456789abcdef/sdk_test/blob

host:HOST:29878
x-amz-content-sha256:UNSIGNED-PAYLOAD
x-amz-date:20241107T234619Z

host;x-amz-content-sha256;x-amz-date
UNSIGNED-PAYLOAD
2024-11-07 15:46:19,458 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20241107T234619Z
20241107/us-east-1/s3/aws4_request
6fcdd6392b72b362ddb53621094693c8684f2b372e3df2b67209970febf396c1
2024-11-07 15:46:19,458 botocore.auth [DEBUG] Signature:
40c0eae0d5c00489f55c6bcfd7608ae1806bd4a519f878fca659c912cf0bc419
2024-11-07 15:46:19,458 botocore.hooks [DEBUG] Event request-created.s3.GetObject: calling handler <function add_retry_headers at 0x000001976DE42200>
2024-11-07 15:46:19,459 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=True, method=GET, url=http://HOST:29878/0123456789abcdef/sdk_test/blob, headers={'User-Agent': b'Boto3/1.35.54 md/Botocore#1.35.54 ua/2.0 os/windows#10 md/arch#amd64 lang/python#3.11.2 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.35.54', 'X-Amz-Date': b'20241107T234619Z', 'X-Amz-Content-SHA256': b'UNSIGNED-PAYLOAD', 'Authorization': b'AWS4-HMAC-SHA256 Credential=ACCESSKEY/20241107/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=40c0eae0d5c00489f55c6bcfd7608ae1806bd4a519f878fca659c912cf0bc419', 'amz-sdk-invocation-id': b'fed697c6-d97b-4696-8dfb-c730202ff88b', 'amz-sdk-request': b'attempt=1'}>
2024-11-07 15:46:19,463 urllib3.connectionpool [DEBUG] Starting new HTTP connection (1): HOST:29878
2024-11-07 15:46:19,486 urllib3.connectionpool [DEBUG] http://HOST:29878 "GET /0123456789abcdef/sdk_test/blob HTTP/11" 200 19
2024-11-07 15:46:19,487 botocore.hooks [DEBUG] Event before-parse.s3.GetObject: calling handler <function _handle_200_error at 0x000001976DE427A0>
2024-11-07 15:46:19,487 botocore.hooks [DEBUG] Event before-parse.s3.GetObject: calling handler <function handle_expires_header at 0x000001976DE425C0>
2024-11-07 15:46:19,490 botocore.parsers [DEBUG] Response headers: {'Date': 'Thu, 07 Nov 2024 23:46:19 GMT', 'Cache-Control': 'no-cache', 'Expires': 'Thu, 07 Nov 2024 23:46:19 GMT', 'Pragma': 'no-cache', 'Content-Type': 'text/plain', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'X-FRAME-OPTIONS': 'SAMEORIGIN', 'ETag': '"30f3c93e46436deb58ba70816a8ec124"', 'Accept-Ranges': 'bytes', 'Last-Modified': 'Thu, 07 Nov 2024 23:46:08 GMT', 'Server': 'Ozone', 'x-amz-id-2': 'oxHcOAtNi', 'x-amz-request-id': '05596e1c-0ac4-46b5-ab73-1b244c708bb5', 'Content-Length': '19'}
2024-11-07 15:46:19,491 botocore.parsers [DEBUG] Response body:
<botocore.response.StreamingBody object at 0x000001976FB00B20>
2024-11-07 15:46:19,494 botocore.hooks [DEBUG] Event needs-retry.s3.GetObject: calling handler <function _update_status_code at 0x000001976DE428E0>
2024-11-07 15:46:19,494 botocore.hooks [DEBUG] Event needs-retry.s3.GetObject: calling handler <botocore.retryhandler.RetryHandler object at 0x000001976FB0A1D0>
2024-11-07 15:46:19,494 botocore.retryhandler [DEBUG] No retry needed.
2024-11-07 15:46:19,495 botocore.hooks [DEBUG] Event needs-retry.s3.GetObject: calling handler <bound method S3RegionRedirectorv2.redirect_from_error of <botocore.utils.S3RegionRedirectorv2 object at 0x000001976FAFDB50>>

AWS CPP SDK version used

1.11.386

Compiler and Version used

Visual Studio 2022 version 17.8

Operating System and version

Windows 10.0.19405

@ajuanr ajuanr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 8, 2024
@DmitriyMusatkin
Copy link
Contributor

I dont think we can make a statement that Apache Ozone works fine if cli can make the call successfully.
S3 interface is a bit vague and supports several different options for sending the request and default config options in cpp sdk can result in request looking different from CLI.
All we know is that Apache Ozone returns 500 for the way that cpp constructed the request. We know that it works fine with S3. So sounds like Ozone does not support some feature in s3 interface.
Since this is AWS S3 client, we dont test against 3p implementations and cannot make guarantees it will work. If we can get any insight from ozone on what failed exactly, we are happy to consider if we can modify the client in a generic way to make sure it works against ozone.

@jmklix jmklix added third-party This issue is related to third-party libraries or applications. closing-soon This issue will automatically close in 4 days unless further comments are made. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 11, 2024
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

3 participants