shrinerb / shrine

File Attachment toolkit for Ruby applications
https://shrinerb.com
MIT License
3.18k stars 275 forks source link

WARN: Job arguments to PromoteJob do not serialize to JSON safely. This will raise an error in Sidekiq 7.0. #673

Closed QuentinRoadstr closed 6 months ago

QuentinRoadstr commented 8 months ago

Hi According to the documentation, we could pass file_data as argument but as reported in the title, this will raise an error : "Job arguments to PromoteJob do not serialize to JSON safely. This will raise an error in Sidekiq 7.0."

More information here : https://github.com/sidekiq/sidekiq/wiki/Best-Practices

Could documentation suggest another way to make it ? I think transmitting the temporary path of the file_data could be a fix.

jrochkind commented 8 months ago

(I'm not a maintainer, just a peer)

Can you check and see what file_data actually is? I'm surprised it's not already json-able, and I wonder if it might be close.

QuentinRoadstr commented 8 months ago

I found an exemple value on Sidekiq :

{"id"=>"production/car_pictures/original/image/3e9817fa23f14ceaba41d65ff897feae.jpg", "storage"=>"cache"}

janko commented 6 months ago

Note sure what exactly isn't serializable to JSON here, could you post all the arguments?