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

Gem doesn't work with S3 #202

Open
eugen0329 opened this issue Feb 16, 2017 · 4 comments
Open

Gem doesn't work with S3 #202

eugen0329 opened this issue Feb 16, 2017 · 4 comments

Comments

@eugen0329
Copy link

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.

@8vius
Copy link

8vius commented Mar 21, 2017

I'm having this same issue, my uploads work fine without the gem enabled but as soon as I place the setting for processing in background nothing gets uploaded besides the original image.

@Cameron2920
Copy link

I would suggest trying Paperclip v5.0.0. I was having problems with 5.1.0 and I'm using s3, but using v5.0.0 seems to fix most of my problems.

@11factory
Copy link

same issue and fixed by downgrading aws-sdk from 3.0.1 to 2.10.39

@Xosmond
Copy link

Xosmond commented Oct 18, 2017

On my case the DelayedPaperclip worker doesn't even appear on sidekiq log. And It stills upload on normal way to S3.

I have downgraded
aws-sdk from 3.0.1 to 2.10.39
Paperclip 5.1.0 to 5.0.0

And the same problem happens.

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

No branches or pull requests

5 participants