16

I'm having this problem trying to use S3 services with fog and the Jquery File Upload (https://github.com/blueimp/jQuery-File-Upload)

The error

Excon::Errors::SocketError (getaddrinfo: nodename nor servname provided, or not known (SocketError)): 

This occur when i try to call "save" method in the controller. I'm setting carrierwave as follow:

config/initializers/carrierwave.rb

CarrierWave.configure do |config|
  config.fog_credentials = {
    :provider               => 'AWS', 
    :aws_access_key_id      => 'access_key_here', 
    :aws_secret_access_key  => 'secret_key_here', 
    :region                 => 'eu-east-1'
  }
  config.fog_directory  = 'folder_name_here'
  config.fog_public     = false 
  config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
  config.storage = :fog
end

and my uploader just the "config.storage :fog" and the "store_dir" Now, I have created my bucket already.

Am i missing some configuration? It doesn't even work on my dev environment.

Please any help. Thanks in advance.

Ron
  • 2,215
  • 3
  • 22
  • 30
  • Im experiencing this same issue Howeever Ive double checked my region for my bucket is Ireland so set region to eu-west-1 but get this error in log on CREATE Excon::Errors::SocketError (getaddrinfo: Name or service not known (SocketError)): – Steven Moffat Feb 09 '16 at 17:51

1 Answers1

25

The region name is wrong. It should be 'us-east-1'

Ron
  • 2,215
  • 3
  • 22
  • 30
  • 8
    Thanks. Hard to get the region name right. Here's a reference: http://docs.aws.amazon.com/general/latest/gr/rande.html – Arcolye Aug 19 '13 at 10:45
  • @Ron why is this not working with other regions? doesnt make sense? – YoniGeek Dec 19 '13 at 21:45
  • 2
    @YoniGeek it must be set to the region of your bucket. If your Amazon bucket is in 'us-east-1', then using 'eu-east-1' or any other won't work properly. – Ron Dec 20 '13 at 15:38
  • 1
    Thought 'us-standard' would work, but only 'us-east-1' does. Thanks! – Jay Jul 25 '14 at 20:48
  • Thanks for the link Arcoyle. Anybody using a server different from default one will get'ya gotcha'd because the S3 admin tools sometimes outright specify 'Ireland'. – Jerome Aug 22 '14 at 06:26
  • This is only true if the bucket is in Us Standard. In Ireland it would be correct 'eu-west-1' – hcarreras May 04 '15 at 15:23
  • yes @dioshari, it is explained in the comments above. – Ron May 05 '15 at 10:03
  • I don't understand why Amazon lists us-standard as a region when it really isn't one. – chaostheory Mar 01 '16 at 09:08