Skip to content

KeyTooLongError after multiple S3 requests. Ruby 2.0 only #128

Description

@Meekohi

Works fine with ruby1.8.7 but fails with ruby2.0.0. All the jpegs downloads complete, then there is an error when downloading info.json.

ruby-2.0.0-p0/gems/aws-2.9.1/lib/awsbase/awsbase.rb:542:in 'block (2 levels) in request_info_impl': KeyTooLongError: Your key is too long (Aws::AwsError)

def download_file( source_path, s3_key )
  File.open(source_path,'w') {|f|
    @bucket.get(s3_key) do |chunk|
      f.write(chunk)
    end
  }
end

jpegs = @bucket.keys({:prefix => id+"/jpegs"})
jpegs.each do |key|
    download_file("tmp.jpg",key)
end

infojson = @bucket.keys({:prefix => id+"/info.json"})
download_file("info.json",infojson)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions