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

createAccessPoint - Missing required header for this request: x-amz-content-sha256 #659

Closed
ganeshnj opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels
bug This issue is a bug.
Milestone

Comments

@ganeshnj
Copy link
Contributor

Describe the bug

2022-10-30T17:10:26-0700 info SerialExecutor : [Logging] Connection to endpoint: Optional("https://727033484140.s3-control.us-west-2.amazonaws.com/v20180820/accesspoint/jangirg-testing-ap?") is closing
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: ClientRuntime.SdkError<AWSS3Control.CreateAccessPointOutputError>.client(ClientRuntime.ClientError.retryError(ClientRuntime.SdkError<AWSS3Control.CreateAccessPointOutputError>.service(AWSS3Control.CreateAccessPointOutputError.unknown(AWSClientRuntime.UnknownAWSHttpServiceError(_isThrottling: false, _statusCode: Optional(http_status_400), _headers: Optional(Server: AmazonS3, 
Content-Type: application/xml, 
x-amz-request-id: 5HMBDD2G2T1M7SDW, 
x-amz-id-2: XiUPE6xSNIdSgBWeh/JreYxEjXZlTkMEDoY24l8XyIC1b8eHZiuF0Y/vuSxhOvYUqCslVh8g3II=, 
Transfer-Encoding: chunked, 
Date: Mon, 31 Oct 2022 00:10:25 GMT, 
Connection: close), _message: Optional("Missing required header for this request: x-amz-content-sha256"), _requestID: Optional("5HMBDD2G2T1M7SDW"), _retryable: false, _type: ClientRuntime.ErrorType.unknown)), 
Status Code: http_status_400 
 x-amz-request-id: 5HMBDD2G2T1M7SDW, 
Transfer-Encoding: chunked, 
Connection: close, 
x-amz-id-2: XiUPE6xSNIdSgBWeh/JreYxEjXZlTkMEDoY24l8XyIC1b8eHZiuF0Y/vuSxhOvYUqCslVh8g3II=, 
Date: Mon, 31 Oct 2022 00:10:25 GMT, 
Content-Type: application/xml, 
Server: AmazonS3)), nil)
2022-10-30 17:10:26.741293-0700 Matrix[4233:26088] Swift/ErrorType.swift:200: Fatal error: Error raised at top level: ClientRuntime.SdkError<AWSS3Control.CreateAccessPointOutputError>.client(ClientRuntime.ClientError.retryError(ClientRuntime.SdkError<AWSS3Control.CreateAccessPointOutputError>.service(AWSS3Control.CreateAccessPointOutputError.unknown(AWSClientRuntime.UnknownAWSHttpServiceError(_isThrottling: false, _statusCode: Optional(http_status_400), _headers: Optional(Server: AmazonS3, 
Content-Type: application/xml, 
x-amz-request-id: 5HMBDD2G2T1M7SDW, 
x-amz-id-2: XiUPE6xSNIdSgBWeh/JreYxEjXZlTkMEDoY24l8XyIC1b8eHZiuF0Y/vuSxhOvYUqCslVh8g3II=, 
Transfer-Encoding: chunked, 
Date: Mon, 31 Oct 2022 00:10:25 GMT, 
Connection: close), _message: Optional("Missing required header for this request: x-amz-content-sha256"), _requestID: Optional("5HMBDD2G2T1M7SDW"), _retryable: false, _type: ClientRuntime.ErrorType.unknown)), 
Status Code: http_status_400 
 x-amz-request-id: 5HMBDD2G2T1M7SDW, 
Transfer-Encoding: chunked, 
Connection: close, 
x-amz-id-2: XiUPE6xSNIdSgBWeh/JreYxEjXZlTkMEDoY24l8XyIC1b8eHZiuF0Y/vuSxhOvYUqCslVh8g3II=, 
Date: Mon, 31 Oct 2022 00:10:25 GMT, 
Content-Type: application/xml, 
Server: AmazonS3)), nil)

Expected Behavior

Operation must succeed.

Current Behavior

Fails with

_message: Optional("Missing required header for this request: x-amz-content-sha256"), _requestID: Optional("5HMBDD2G2T1M7SDW"), _retryable: false, _type: ClientRuntime.ErrorType.unknown)), 

Reproduction Steps

 let client = try S3ControlClient(region: "us-west-2")
        let input = CreateAccessPointInput(accountId: "{account id}", bucket: "jangirg-testing", name: "jangirg-testing-ap")
        let output = try await client.createAccessPoint(input: input)

Possible Solution

No response

Additional Information/Context

No response

AWS SWIFT SDK version used

0.3.1

Compiler and Version used

swift-driver version: 1.62.8 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)

Operating System and version

arm64-apple-macosx12.0

@ganeshnj ganeshnj added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 31, 2022
@ganeshnj ganeshnj added this to the GA milestone Oct 31, 2022
@dayaffe
Copy link
Contributor

dayaffe commented Nov 7, 2023

I have been able to reproduce this error on the latest SDK version and confirm it still exists:
Error: UnknownAWSHTTPServiceError(typeName: Optional("InvalidRequest"), message: Optional("Missing required header for this request: x-amz-content-sha256"), requestID: Optional("EX2K0H9GQ6G5RRD8")

2023-11-07T14:50:56-0500 info HttpContent : [Logging] seeking to offset 0 in data
2023-11-07T14:50:56-0500 info HttpContent : [Logging] read 143 bytes from data
2023-11-07T14:50:56-0500 info HttpContent : [Logging] read 0 bytes from data
2023-11-07T14:50:56-0500 info HttpContent : [Logging] seeking to offset 0 in data
2023-11-07T14:50:56-0500 info S3ControlClient : [Logging] Request: PUT https:443 
 Path: /v20180820/accesspoint/dayaffe-testing-ap 
 Content-Type: application/xml, 
X-Amz-Date: 20231107T195056Z, 
User-Agent: aws-sdk-swift/1.0 ua/2.0 api/s3_control#1.0 os/macos#13.5.2 lang/swift#5.9 cfg/retry-mode#legacy, 
Authorization: AWS4-HMAC-SHA256 Credential=.../20231107/us-west-2/s3/aws4_request, SignedHeaders=content-type;host;x-amz-account-id;x-amz-date, Signature=..., 
Host: 698276607182.s3-control.us-west-2.amazonaws.com, 
x-amz-account-id: ..., 
Content-Length: 143 
 Optional([])
2023-11-07T14:50:56-0500 info SerialExecutor : [Logging] Creating connection pool for 698276607182.s3-control.us-west-2.amazonaws.com with max connections: 50
2023-11-07T14:50:57-0500 info CRTClientEngine : [Logging] Connection was acquired to: Optional("https://....s3-control.us-west-2.amazonaws.com/v20180820/accesspoint/dayaffe-testing-ap?")
2023-11-07T14:50:57-0500 info CRTClientEngine : [Logging] Using HTTP/1.1 connection
2023-11-07T14:50:57-0500 info HttpContent : [Logging] read 143 bytes from data
2023-11-07T14:50:57-0500 info CRTClientEngine : [Logging] Main headers received
2023-11-07T14:50:57-0500 info CRTClientEngine : [Logging] Body chunk received
2023-11-07T14:50:57-0500 info CRTClientEngine : [Logging] Request/response completed
Error: UnknownAWSHTTPServiceError(typeName: Optional("InvalidRequest"), message: Optional("Missing required header for this request: x-amz-content-sha256"), requestID: Optional("EX2K0H9GQ6G5RRD8"), requestID2: nil, httpResponse: 
Status Code: http_status_400 
 Server: AmazonS3, 
Connection: close, 
x-amz-request-id: EX2K0H9GQ6G5RRD8, 
Transfer-Encoding: chunked, 
Content-Type: application/xml, 
Date: Tue, 07 Nov 2023 19:50:57 GMT, 
x-amz-id-2: x6kSXblRRuTdKSwrJvXdTz9SCqOO/qbzIdlqLv29GHq6nZA9OPhUTJHkbiTxuViAyMtnCw+con7O16gH7K23yw==)
Program ended with exit code: 1

Will look into this further and update this thread with any findings.

@jbelkins
Copy link
Contributor

jbelkins commented Dec 5, 2023

Released in AWS SDK for Swift 0.32.0

@jbelkins jbelkins closed this as completed Dec 5, 2023
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.
Projects
None yet
Development

No branches or pull requests

3 participants