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

Access denied on swiftstack cluster #7

Open
adiospeds opened this issue Nov 26, 2018 · 4 comments
Open

Access denied on swiftstack cluster #7

adiospeds opened this issue Nov 26, 2018 · 4 comments

Comments

@adiospeds
Copy link

adiospeds commented Nov 26, 2018

I recently deployed a swiftstack cluster and am able to upload/download objects using aws cli. However when I try to benchmark the swiftstack cluster, I get following error.


<Error><Code>AccessDenied</Code><Message>AWS authentication requires a valid Date or x-amz-date header</Message><RequestId>tx3595302e8cf6432b83d29-005bfc186f</RequestId></Error>
Upload status 403 Forbidden: resp: &{Status:403 Forbidden StatusCode:403 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[X-Amz-Id-2:[txa5f2a53009774be688c6c-005bfc186f] X-Amz-Request-Id:[txa5f2a53009774be688c6c-005bfc186f] Content-Type:[application/xml] X-Trans-Id:[txa5f2a53009774be688c6c-005bfc186f] X-Openstack-Request-Id:[txa5f2a53009774be688c6c-005bfc186f] Date:[Mon, 26 Nov 2018 15:59:43 GMT]] Body:0xc4204575c0 ContentLength:-1 TransferEncoding:[chunked] Close:false Uncompressed:false Trailer:map[] Request:0xc4203d4400 TLS:<nil>}
Body: <?xml version='1.0' encoding='UTF-8'?>

The bucket gets created, but when s3-benchmark tries to make any upload request the screen gets flooded with above error.

@adiospeds adiospeds changed the title Access denies on swiftstack cluster Access denied on swiftstack cluster Nov 26, 2018
@charz
Copy link

charz commented Nov 29, 2018

The X-Amz-Date (https://github.com/wasabi-tech/s3-benchmark/blob/master/s3-benchmark.go#L196) format should be Wed, 01 Mar 2006 12:00:00 GMT. So change the time format to time.UnixDate` and it should work.

       //     dateHdr := time.Now().UTC().Format("20060102T150405Z")
       dateHdr := time.Now().UTC().Format(time.UnixDate)

I'll send a pull reuqest.

@tipabu
Copy link

tipabu commented Nov 30, 2018

They buried docs for v2 signatures down in an appendix, but sure enough, AWS says

The value of the x-amz-date header must be in one of the RFC 2616 formats (http://www.ietf.org/rfc/rfc2616.txt).

so I'm inclined to agree that the format's wrong. I'm not sure time.UnixDate is right though; would time.RFC1123 be better?

Longer-term, it might be better to move to v4 signatures (which use the YYYYMMDD'T'HHMMSS'Z' format for x-amz-date.

@charz
Copy link

charz commented Nov 30, 2018

@tipabu thx, agreed. The time.RFC1123 is better.

@adiospeds
Copy link
Author

Thanks charz, this fixes the issue

baurmatt added a commit to baurmatt/s3-benchmark that referenced this issue Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants