access key error

19 views
Skip to first unread message

Saravanan P

unread,
Sep 13, 2012, 3:53:05 AM9/13/12
to rubyonra...@googlegroups.com
I am getting following error while run my rails app in my server

ActionView::Template::Error (You did not provide both required access keys. Please provide the access_key_id and the secret_access_key.):


Colin Law

unread,
Sep 13, 2012, 4:01:55 AM9/13/12
to rubyonra...@googlegroups.com
I think you may need to give us some more information about the code
that generates the error.

Colin

Saravanan P

unread,
Sep 13, 2012, 4:07:31 AM9/13/12
to rubyonra...@googlegroups.com
Thanks for the reply.

This is from my .log file

Started GET "/" for 122.183.133.1 at 2012-09-13 07:38:52 +0000
  Processing by HomeController#index as HTML
  [1m [36mProduct Load (1.3ms) [0m   [1mSELECT id, product_type, name, slug, short_description, price, farm_name, lbcount, unit FROM `products` WHERE (featured_product=1) ORDER BY rand() LIMIT 20 [0m
[paperclip] Duplicate URL for attachment with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in Advertisement class
  [1m [35mCategoryImage Load (0.9ms) [0m  SELECT `category_images`.* FROM `category_images` WHERE `category_images`.`product_id` IN (43, 40, 88, 54, 158, 150, 57, 70, 109)
  [1m [36mCategory Load (1.0ms) [0m   [1mSELECT `categories`.* FROM `categories` WHERE `categories`.`id` IN (8, 2, 4, 9, 5, 10, 11, 6) [0m
  [1m [35mPicture Load (12.3ms) [0m  SELECT `pictures`.* FROM `pictures` WHERE `pictures`.`imageable_type` = 'Product' AND `pictures`.`imageable_id` IN (43, 40, 88, 54, 158, 150, 57, 70, 109)
  [1m [36mCompany Load (1.0ms) [0m   [1mSELECT `companies`.* FROM `companies` WHERE (name IN ('Fresh goat cheese','Scallops','Maine lobsters','Fresh peaches','Teas')) ORDER BY rand() [0m
  [1m [35mProduct Load (0.7ms) [0m  SELECT id, product_type, name, slug, short_description, price, farm_name, lbcount, unit FROM `products` WHERE (featured_product = 0 and new_product= 1) ORDER BY rand() LIMIT 20
  [1m [36mCategoryImage Load (0.6ms) [0m   [1mSELECT `category_images`.* FROM `category_images` WHERE `category_images`.`product_id` IN (119, 31, 84, 51, 120, 154, 103, 37, 56, 130, 148) [0m
  [1m [35mCategory Load (0.6ms) [0m  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` IN (14, 5, 13, 9, 2, 0, 7, 4, 17)
  [1m [36mPicture Load (1.3ms) [0m   [1mSELECT `pictures`.* FROM `pictures` WHERE `pictures`.`imageable_type` = 'Product' AND `pictures`.`imageable_id` IN (119, 31, 84, 51, 120, 154, 103, 37, 56, 130, 148) [0m
  [1m [35mThought Load (0.2ms) [0m  SELECT `thoughts`.* FROM `thoughts` ORDER BY created_at DESC LIMIT 1
  [1m [36mLearn Load (0.2ms) [0m   [1mSELECT `learns`.* FROM `learns` ORDER BY created_at DESC LIMIT 2 [0m
[paperclip] Duplicate URL for attachment with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in Category class
  [1m [35mAdvertisement Load (0.2ms) [0m  SELECT `advertisements`.* FROM `advertisements` ORDER BY created_at desc LIMIT 1
  [1m [36mNews Load (0.2ms) [0m   [1mSELECT `news`.* FROM `news` ORDER BY created_at DESC LIMIT 1 [0m
  [1m [35mBlog Load (0.2ms) [0m  SELECT `blogs`.* FROM `blogs` ORDER BY created_at DESC LIMIT 1
Rendered home/index.html.haml within layouts/application (3.0ms)
Completed 500 Internal Server Error in 359ms

ActionView::Template::Error (You did not provide both required access keys. Please provide the access_key_id and the secret_access_key.):
    267:             .img_col1
    268:               .capslide_img_cont1.ic_container{:style=>"position:absolute;"} 
    269:                 %a{:href => "/product_details" + "?category_id=#{@cate.category.slug}" + "&product_id=#{x.slug} "}
    270:                   %img{:alt => "product",:src=>"#{i.image.url(:products)}", :width => "329" , :height =>"251"}
    271:                 .ic_caption{:style => "display: block;"}                
    272:                   .overlay-text
    273:                     %a{:href => "/product_details" + "?category_id=#{@cate.category.slug}" + "&product_id=#{x.slug} "}
  app/views/home/index.html.haml:270:in `block in _app_views_home_index_html_haml___1026580395_93166550'
  app/views/home/index.html.haml:262:in `each'
  app/views/home/index.html.haml:262:in `_app_views_home_index_html_haml___1026580395_93166550'


Note: Some of the page running which looks like static page content.



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.



--
Regards by
Saravanan.P

Jim Ruther Nill

unread,
Sep 13, 2012, 4:14:39 AM9/13/12
to rubyonra...@googlegroups.com
 


Note: Some of the page running which looks like static page content.


On Thu, Sep 13, 2012 at 1:31 PM, Colin Law <cla...@googlemail.com> wrote:
On 13 September 2012 08:53, Saravanan P <sarav...@shriramits.com> wrote:
> I am getting following error while run my rails app in my server
>
> ActionView::Template::Error (You did not provide both required access keys.
> Please provide the access_key_id and the secret_access_key.):

I think you may need to give us some more information about the code
that generates the error.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.



--
Regards by
Saravanan.P

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

Saravanan P

unread,
Sep 13, 2012, 5:19:42 AM9/13/12
to rubyonra...@googlegroups.com
I provide all keys but not working. In development working well

In my model

 has_attached_file :crop_content, :styles => {:thumb => "89x75#",:crop_content=>"160x160#" },
  :path => "assets/crops/contents/:id/:style/:basename.:extension",
  :storage => "s3",
  #:s3_headers => { 'Cache-Control' => 'max-age=315576000', 'Expires' => 10.years.from_now.httpdate },
  :s3_protocol => 'https',
  :s3_credentials => "#{::Rails.root.to_s}/config/amazon-s3.yml"

and under config folder/amazon-s3.yml

development:
    bucket: my_avatar-production
    access_key_id: amazonaccesskey
    secret_access_key: amazon_secret_access_key
    
test:
    bucket: my_avatar-test
    access_key_id: amazonaccesskey
    secret_access_key: amazon_secret_access_key
    
production:
    bucket: my_avatar-production
    access_key_id: amazonaccesskey
    secret_access_key: amazon_secret_access_key

Saravanan P

unread,
Sep 13, 2012, 11:01:24 AM9/13/12
to rubyonra...@googlegroups.com
i don't think error be in my amazon s3 access key. Because as i mentioned earlier some of page was running and that pages having s3 images. May be some other error... :(

please help
--
Regards by
Saravanan.P

Jim Ruther Nill

unread,
Sep 13, 2012, 11:23:36 AM9/13/12
to rubyonra...@googlegroups.com
On Fri, Sep 14, 2012 at 1:01 AM, Saravanan P <sarav...@shriramits.com> wrote:
i don't think error be in my amazon s3 access key. Because as i mentioned earlier some of page was running and that pages having s3 images. May be some other error... :(

I'm pretty sure it has something to do with the credentials or how paperclip parses those credentials
what does this code return? Model.attachment_definitions[:image][:s3_credentials]

I have one more question.  On line 270 of the code you pasted

%img{:alt => "product",:src=>"#{i.image.url(:products)}", :width => "329" , :height =>"251"}

look at the class of whatever 'i' is, particularly the s3_credentials option you passed for that model.

Saravanan P

unread,
Sep 13, 2012, 12:00:55 PM9/13/12
to rubyonra...@googlegroups.com
ok if my s3_credentials is problem mean,  i can able to see app-logo which stored in s3 in my about-us page.

and for 

%img{:alt => "product",:src=>"#{i.image.url(:products)}", :width => "329" , :height =>"251"}

look at the class of whatever 'i' is, particularly the s3_credentials option you passed for that model.

its returning correct url for the product image which stored in s3 in my production.

Jim Ruther Nill

unread,
Sep 13, 2012, 12:08:44 PM9/13/12
to rubyonra...@googlegroups.com
On Fri, Sep 14, 2012 at 2:00 AM, Saravanan P <sarav...@shriramits.com> wrote:
ok if my s3_credentials is problem mean,  i can able to see app-logo which stored in s3 in my about-us page.

and for 

%img{:alt => "product",:src=>"#{i.image.url(:products)}", :width => "329" , :height =>"251"}

look at the class of whatever 'i' is, particularly the s3_credentials option you passed for that model.

its returning correct url for the product image which stored in s3 in my production.

ok. i'm basing all of what I said from the logs that you pasted.  Since you are very sure that line 270 is not the cause
of the error, I don't have any idea what else could be wrong.  try removing each line/block of code on the view
one by one to filter out the line that's causing the error.  once you get the offending line, you should be able to
figure out what's wrong.

Colin Law

unread,
Sep 13, 2012, 12:30:36 PM9/13/12
to rubyonra...@googlegroups.com
On 13 September 2012 17:00, Saravanan P <sarav...@shriramits.com> wrote:
> ok if my s3_credentials is problem mean, i can able to see app-logo which
> stored in s3 in my about-us page.
>
> and for
>
> %img{:alt => "product",:src=>"#{i.image.url(:products)}", :width => "329" ,
> :height =>"251"}

Should that be :src => "/"#{i.image.url(:products)}/""

Colin

Colin Law

unread,
Sep 13, 2012, 12:35:52 PM9/13/12
to rubyonra...@googlegroups.com
On 13 September 2012 17:30, Colin Law <cla...@googlemail.com> wrote:
> On 13 September 2012 17:00, Saravanan P <sarav...@shriramits.com> wrote:
>> ok if my s3_credentials is problem mean, i can able to see app-logo which
>> stored in s3 in my about-us page.
>>
>> and for
>>
>> %img{:alt => "product",:src=>"#{i.image.url(:products)}", :width => "329" ,
>> :height =>"251"}
>
> Should that be :src => "/"#{i.image.url(:products)}/""

Ah, no I see that haml puts the quotes in for you.

Colin
Reply all
Reply to author
Forward
0 new messages