S3 AccessDenied

85 views
Skip to first unread message

ELamison

unread,
May 5, 2014, 6:25:45 PM5/5/14
to spree...@googlegroups.com
I'm completely lost on this but I'm trying to set up Spree to use S3 and I get this error:
AWS::S3::Errors::AccessDenied in Spree::Admin::ImagesController#create

In my initializers I have spree_images_paperclip.rb:

Spree.config do |config|
  attachment_config
= {
    s3_credentials
: {
      access_key_id
: 'xxxxxx',
      secret_access_key
: 'xxxxxx',
      bucket
: 'testbucket',
   
},
 
    storage
:        :s3,
    s3_headers
:     { 'Cache-Control' => 'max-age=31557600' },
    s3_protocol
:    'https',
    bucket
:         'testbucket',
 
    styles
: {
      mini
:     '48x48>',
      small
:    '100x100>',
      product
:  '240x240>',
      large
:    '600x600>'
   
},
 
    path
:          '/public/spree/products/:id/:style/:basename.:extension',
    default_url
:   '/spree/products/:id/:style/:basename.:extension',
    default_style
: 'product',
 
}
 
  attachment_config
.each do |key, value|
   
Spree::Image.attachment_definitions[:attachment][key.to_sym] = value
 
end
end

can connect and upload with an S3 client fine.





Enter code here...




flyup

unread,
Jul 14, 2014, 12:41:02 PM7/14/14
to spree...@googlegroups.com
Hi-

I think I just figured this out. In your S3 console, select the bucket you are using, under 'Actions' select 'Make Public'

try it.

Peter Berkenbosch

unread,
Jul 15, 2014, 6:08:54 AM7/15/14
to spree...@googlegroups.com
That sounds like a bad plan Flyup. Now everybody can write to that bucket. 

@Eric, I think you have an issue with the keys from S3. Can you access the bucket from the console using those keys and the aws-s3 gem? (http://aws.amazon.com/sdkforruby/)
--

Peter Berkenbosch
Spree Commerce, Inc.

Reply all
Reply to author
Forward
0 new messages