Debug programming issues like you cross game levels — Part 2

Next battle -> SignatureDoesNotMatch, but why ?

  • AWS Cli request
$ AWS_PROFILE=s3-store aws --endpoint-url s3 ls s3://cortex/am
PRE am/
$ ./mc admin trace s3-store2021-08-14T17:31:10:000 [200 OK] s3.ListObjectsV2 942µs ↑ 93 B ↓ 605 B
  • AWS SDK for Javascript
aws sdk javascript ListObjectsV2
Output:InvalidBucket: Bucket names cannot contain forward slashes. Bucket: cortex/amat Request.validateBucketName (/../aws-s3-listobjects/node_modules/aws-sdk/lib/services/s3.js:234:30)
  • AWS SDK For Golang
$ AWS_PROFILE=s3-store go run main.go 
Got error retrieving list of objects:
operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 169B3166BFB42726, HostID: d173742c-5eb0-4c04-ae7a-a20a2f4cee37, api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
Traced Request by using fake minio (nc -l)GET /cortex%2Fam?list-type=2 HTTP/1.1
Host: localhost:8000
User-Agent: aws-sdk-go-v2/1.8.0 os/linux lang/go/1.16.7 md/GOOS/linux md/GOARCH/amd64 api/s3/1.12.0
Accept-Encoding: identity
Amz-Sdk-Invocation-Id: eae36291-0fea-46ec-9d88-a61fe9259f4b
Amz-Sdk-Request: attempt=1; max=3
Authorization: AWS4-HMAC-SHA256 Credential=123admin456/20210814//s3/aws4_request, SignedHeaders=accept-encoding;amz-sdk-invocation-id;amz-sdk-request;host;x-amz-content-sha256;x-amz-date, Signature=8a034b86175d2f7c5404ff29e9837e74260e996b516a127ee124ce2f39a810fb
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210814T124515Z

Next battle -> SDK

  1. Why signature error ?
  2. Behaviour of aws sdk for golang




Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


More from Medium

Experience about Command Line Interface (CLI)

Detecting a rogue Nodejs function in production

In conversation with Http/2

Go — If/Else, Switch, and For loop