Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

Gem doesn't work with S3 #202

Open
Open
@eugen0329

Description

@eugen0329

Using the following configs I get uploaded file with 0 byte file uploaded to s3 bucket.

#db/migrate/20170216113435_add_p_to_user.rb
class AddPToUser < ActiveRecord::Migration[5.0]
  def change
    add_column :users, :avatar_processing, :boolean
  end
end
# app/models/user.rb
class User < ApplicationRecord
  has_attached_file :avatar, styles: {thumb: "100x100#"}
  validates_attachment_content_type :avatar, content_type:["image/jpg", "image/jpeg", "image/png", "image/gif"]

  process_in_background :avatar
end
# config/application.rb
#....

  class Application < Rails::Application
    config.active_job.queue_adapter = :sidekiq

    config.paperclip_defaults = {
      storage: :s3,
      s3_region: 'us-west-2',
      s3_host_name: "s3-us-west-2.amazonaws.com",
      s3_credentials: {
        bucket: 'bucket_name',
        access_key_id: 'xxx',
        secret_access_key: 'xxx',
        s3_region: 'us-west-2',
      }
    }
  end

Extra info

  rails (~> 5.0.1)
  delayed_paperclip (~> 3.0, >= 3.0.1)
  paperclip (5.1.0)
  delayed_paperclip (3.0.1)
  sidekiq (4.2.9)
  paperclip-av-transcoder (0.6.4)
#sidekiq log
2017-02-16T12:01:29.951Z 7471 TID-rm9ck DelayedPaperclip::ProcessJob JID-e16b95988df375eab98f7b99 INFO: start
2017-02-16T12:01:33.730Z 7471 TID-rm9ck DelayedPaperclip::ProcessJob JID-e16b95988df375eab98f7b99 INFO: done: 3.779 sec

The same problem occurs when I use the gem with rails (= 4.2.7.1) and paperclip-av-transcoder postprocessor.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions