Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RightAws::AwsError (Permanent EOF is being received from s3.amazonaws.com.) #189

Open
hgsongra opened this issue May 18, 2016 · 0 comments

Comments

@hgsongra
Copy link

hgsongra commented May 18, 2016

New RightAws::S3Interface using shared connections mode
Opening new HTTP connection to s3.amazonaws.com:80
Closing HTTP connection to s3.amazonaws.com:80, reason: 'end of file reached'
Rightscale::HttpConnection : server s3.amazonaws.com closed connection
Opening new HTTP connection to s3.amazonaws.com:80
Closing HTTP connection to s3.amazonaws.com:80, reason: 'execution expired'
Rightscale::HttpConnection : request failure count: 1, exception: #<Timeout::Error: execution expired>
Opening new HTTP connection to s3.amazonaws.com:80
Closing HTTP connection to s3.amazonaws.com:80, reason: 'end of file reached'
Rightscale::HttpConnection : server s3.amazonaws.com closed connection
Rightscale::HttpConnection : raising RightAws::AwsError due to permanent EOF being received from s3.amazonaws.com, error age: 144
Completed 500 Internal Server Error in 170750.2ms

RightAws::AwsError (Permanent EOF is being received from s3.amazonaws.com.):
config/initializers/S3sempleModule.rb:55:in `tmp_key_exsists?'

Here is my code for the module, line 55 is @s3_tmp_bucket.key(key).exists? in tmp_key_exsists? method

right_aws 3.1.0
right_http_connection (1.5.0)
ruby  2.2.2

My module code

`def get_creds
  creds = YAML.load_file("#{::Rails.root.to_s}/config/s3.yml")
  @s3tmpcreds = (creds["temp"] || creds).symbolize_keys
end

def gets3tmp
  @s3tmpcreds ||= get_creds
  @s3tmp ||= RightAws::S3.new(
                @s3tmpcreds[:access_key_id], 
                @s3tmpcreds[:secret_access_key], 
                {:port => 80, :protocol => 'http'}
              )
end

def s3_tmp_bucket_name
  @s3tmpcreds[:bucket]
end

def get_s3_tmp_bucket
  @s3tmp = gets3tmp
  @s3_tmp_bucket ||= @s3tmp.bucket(s3_tmp_bucket_name, true, 'public-read')
end

def tmp_key_exsists?(key)
  @s3_tmp_bucket = get_s3_tmp_bucket
  return false if (key.nil?||key.blank?)
  @s3_tmp_bucket.key(key).exists?
end`

any one have any suggestion or solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant