Sidekiq warning about serializing job arguments
jesseminer opened this issue · 7 comments
Hi, I'm using Carrierwave Backgrounder and Sidekiq. Sidekiq 6.4.1 prints the following warning when backgrounder enqueues a job:
Job arguments to CarrierWave::Workers::ProcessAsset do not serialize to JSON safely. This will raise an error in Sidekiq 7.0. See https://github.com/mperham/sidekiq/wiki/Best-Practices or raise an error today by calling
Sidekiq.strict_args!
during Sidekiq initialization.
I think the only issue is that Carrierwave's mounted_as
returns a symbol, and it needs to be converted to a string before it's passed off to Sidekiq. mounted_as
is passed to enqueue_for_backend
in lib/backgrounder/orm/base.rb.
@jesseminer Can you please carrierwave backgrounder version you install and where you set call back for backgrounder
@waqasnazir-gr My gemfile loads carrierwave backgrounder from github:
gem 'carrierwave_backgrounder', github: 'lardawge/carrierwave_backgrounder'
And an example of an active record model that uses the gem:
class Group < ApplicationRecord
mount_uploader :logo, GroupLogoUploader
process_in_background :logo
end
Let me know if you need any more info!
@jesseminer thanks! One more thing please share your carrierwave version this is not working for me with
gem 'carrierwave', '~> 2.0'
@waqasnazir-gr I'm on carrierwave 2.1.1.
+1 same warning
remote: https://github.com/lardawge/carrierwave_backgrounder.git
revision: e1faa5e264d6a2ee0a58ade6b0d05d1147266b86
carrierwave (2.1.1)
sidekiq (6.4.2)
I've made a PR that fixes this, forgot to link the issue though 😅
#307
This has been fixed and released in version 0.4.3