chilts / awssum

(deprecated: use aws-sdk) Node.js modules for talking to lots of Web Service APIs.
Other
462 stars 57 forks source link

S3 SignatureDoesNotMatch #161

Closed paralin closed 8 years ago

paralin commented 11 years ago

I'm getting an error trying to do basic things in S3:

s3 = new amazonS3.S3 'accessKeyId' : 'myid', 'secretAccessKey' : 'mykey', 'region' : amazon.US_EAST_1

options = BucketName : 'MyBucket', MaxKeys : 4

s3.ListObjects options,(err, data) -> console.log "\nlisting all the objects - expecting success" console.log err, 'Error' console.log EJSON.stringify data, 'Data' if ( err ) console.log 'Not doing another ListObjects since there was an error' return

if data.Body.ListBucketResult.IsTruncated is 'true' options.Marker = _.last(data.Body.ListBucketResult.Contents).Key;

s3.ListObjects options,(err, data) ->
  console.log "getting the next set - expecting success"
  console.log err, 'Error'
  console.log EJSON.stringify(data), 'Data'

Error:

listing all the objects - expecting success { StatusCode: 403, Headers: { ... { Error: { Code: 'SignatureDoesNotMatch', Message: 'The request signature we calculated does not match the signature you provided. Check your key and signing method.', StringToSignBytes: '47 45 54 0a 0a 0a 46 72 69 2c 20 31 32 20 41 70 72 20 32 30 31 33 20 30 30 3a 34 37 3a 30 35 20 55 54 43 0a 2f 73 74 65 61 6c 65 72 66 69 6c 65 73 2f', RequestId: 'E4F41DE7ADBC4EF3', HostId: 'Iximxy8XNVNU6vmr93dqiqAjvSwwa7EVl5HY0LeTbTrTx0AAyod40QPs5l9kHr0M' null Not doing another ListObjects since there was an error

Doing a basic list buckets works fine.

chilts commented 11 years ago

This works fine for me:

Can you try it and see what happens? Do you have all your credentials correct?

Cheers, Andy

paralin commented 11 years ago

Same thing happens. I have the creds correct, I double checked and list buckets works fine.

Basically I'm doing this:

s3.ListObjects options, (err, data) ->
     console.log err

Same error.

chilts commented 11 years ago

Are you using the latest version of awssum-amazon-s3? v1.4.2?

chilts commented 11 years ago

This is because the bucket has capital letters and fails validation. This is a known issue. I'm still figuring things out.

paralin commented 8 years ago

This is very old, closing it.

chilts commented 8 years ago

Thanks for closing. AwsSum is now deprecated anyway in favour of the offical aws-sdk from Amazon.