S3 - The AWS Access Key Id you provided does not exist in our records

13,399 views
Skip to first unread message

Jonathon Batson

unread,
Dec 5, 2012, 6:19:52 AM12/5/12
to refine...@googlegroups.com
Hi there
I am having an issue configuring heroku with s3.  Have followed the guide
http://refinerycms.com/guides/heroku#adding-amazon-s3-support
but get the following error in the response from AWS. 
(taken from heroku logs)
---------------------------------------------------
Excon::Errors::Forbidden (Expected(200) <=> Actual(403 Forbidden)
request => {
    :chunk_size=>1048576,
    :connect_timeout=>60,
    :headers=>{
        "Date"=>"Wed, 05 Dec 2012 10:47:11 +0000",
        "Authorization"=>"AWS THISISMYKEY:UoeQUcBomC2PxpXavaUUXYeMCeU=",
        "Host"=>"test.bucket.s3.amazonaws.com:443"},
    :instrumentor_name=>"excon",
    :mock=>false,
    :nonblock=>true,
    :read_timeout=>60,
    :retry_limit=>4,
    :ssl_ca_file=>"/app/vendor/bundle/ruby/1.9.1/gems/excon-0.16.10/data/cacert.pem",
    :ssl_verify_peer=>true,
    :write_timeout=>60,
    :host=>"test.bucket.s3.amazonaws.com",
    :host_port=>"test.bucket.s3.amazonaws.com:443",
    :path=>"/",
    :port=>"443",
    :query=>{},
    :scheme=>"https",
    :expects=>200,
    :idempotent=>true,
    :method=>"GET",
    :response_block=>#<Proc:0x00000007290b38@/app/vendor/bundle/ruby/1.9.1/gems/fog-1.7.0/lib/fog/core/connection.rb:16 (lambda)>}

response => #<Excon::Response:0x0000000724a048
    @body="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
        <Error>
            <Code>InvalidAccessKeyId</Code>
            <Message>The AWS Access Key Id you provided does not exist in our records.</Message>
            <RequestId>15EB531B53FF73E3</RequestId>               <HostId>BL0N8hpPibqOW+nvoUJwtqTGoxwx+dOup7fUQGaAv3WguQGqzMn6R3iMFPUEaODH</HostId>
            <AWSAccessKeyId>THISISMYKEY</AWSAccessKeyId>
            </Error>",
    @headers={
        "x-amz-request-id"=>"15EB531B53FF73E3",
        "x-amz-id-2"=>"BL0N8hpPibqOW+nvoUJwtqTGoxwx+dOup7fUQGaAv3WguQGqzMn6R3iMFPUEaODH",
        "Content-Type"=>"application/xml",
        "Transfer-Encoding"=>"chunked",
        "Date"=>"Wed, 05 Dec 2012 10:47:11 GMT",
        "Server"=>"AmazonS3"},
    @status=403>):
 
---------------------------------------------------
Here are my config vars and production.rb excerpt .... with modified values, and yes I have
confirmed the values are the same.
$ heroku config | grep S3
S3_BUCKET:                    test.bucket
S3_KEY:                       THISISMYKEY
S3_SECRET:                    THISISMYSECRET

$ grep -i S3 config/environments/production.rb
config.s3_backend = true
ENV['S3_KEY']='THISISMYKEY'
ENV['S3_SECRET']='THISISMYSECRET'
ENV['S3_BUCKET']='test.bucket'

Any hints on how to debug/proceed from here would be greatly appreciated.
cheers


Philip Arndt

unread,
Dec 5, 2012, 3:20:43 PM12/5/12
to refine...@googlegroups.com
Are you absolutely 100% sure that you entered the right key?

rek2

unread,
Dec 5, 2012, 7:08:05 PM12/5/12
to refine...@googlegroups.com
Im having similar issues under Elastic Beanstalk im using the
production.rb file for the env settings.. not sure how to push them to
the remote enviroment like you guys do for heroku to try that way.. if
anyone knows please post :-)


2012/12/5 Philip Arndt <par...@gmail.com>:
> Are you absolutely 100% sure that you entered the right key?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Refinery CMS" group.
> To post to this group, send email to refine...@googlegroups.com
> To unsubscribe from this group, send email to
> refinery-cms...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/refinery-cms?hl=en
>
> http://www.refinerycms.com

Jonathon Batson

unread,
Dec 6, 2012, 12:59:14 AM12/6/12
to refine...@googlegroups.com
Yes .. I am absolutely 100% sure its the same key.  I have just created another unique key and done a another test to be sure.

A question : do I need to create/retreive the key on my AWS site somewhere and assign it to the bucket?  atm I am creating a random key

Here is the process I went through, on my Fedora 17 box
1> used gnome-password-generator to generate a 12 char key
2> put the key in my production.rb with bucket and secret as below for example
ENV['S3_KEY']='SjQWG22GiGG8' 
and then git add and commit and push to heroku
3> added the config var to heroku
heroku config:add S3_KEY=SjQWG22GiGG8
After the site comes back up attempt to upload an image .. and same error occurs.

Jonathon Batson

unread,
Dec 6, 2012, 1:12:59 AM12/6/12
to refine...@googlegroups.com
I have also tried setting the  config vars this way, with out any change to the error message.
Refinery::Core.configure do |config|     
      config.s3_access_key_id = 'SjQWG22GiGG8'
      config.s3_secret_access_key = 'thesecretaccesskey'
      config.s3_bucket_name = 'test.bucket'
end

The thing is in the request in the log the Authorization key:value pair has the config.s3_access_key_id value as part of the value .. see next line value in bold.
"Authorization"=>"AWS SjQWG22GiGG9:tK/+MLDGQM45zVVc9rvjYnj1ZKs="


This is the same value as what comes back in the response as part of the Error tag
<AWSAccessKeyId>SjQWG22GiGG9</AWSAccessKeyId></Error>

Still searching ....

Jonathon Batson

unread,
Dec 6, 2012, 2:34:38 AM12/6/12
to refine...@googlegroups.com
whoops .. my attempt at objuscating the key did not quite work ..
be assured they are the same in my code (thanks cnk for pointing this out)


Jonathon Batson

unread,
Dec 6, 2012, 6:49:17 AM12/6/12
to refine...@googlegroups.com
Finally solved it ... I knew I was missing a step ... and a totally obvious one (now anyway)

The keys must be retrieved from your aws act (you cant simply make them up .. duh!)

For anyone in the same boat, login to your aws account and checkout your securityCreds
you can then retrieve your keys from there.

https://portal.aws.amazon.com/gp/aws/securityCredentials

Rob Yurkowski

unread,
Dec 5, 2012, 9:20:43 AM12/5/12
to refine...@googlegroups.com
It sounds like your Amazon key hasn't been recorded properly. Can you confirm that it's identical to the version Amazon gives you?

-----------------------------------

Rob Yurkowski
Refinery CMS Core Team | Freelancer
Currently Available for Consultation

@robyurkowski twitter
r...@yurkowski.net emailrobyurkowski skype

Reply all
Reply to author
Forward
0 new messages