ImageMagick / Paperclip - Paperclip does not work during big work

I use Paperclip with ImageMagick to process several thousand images and upload them to S3. It goes through hundreds of images without problems, and then gives this error:

An error was received while processing: #<Paperclip::Errors::CommandNotFoundError: Could not run the define command. Please install ImageMagick> command. Please install ImageMagick>

I saw other questions referencing this error, but it seems strange to me that it can process perfectly for one second, and then the next one will not be able to find ImageMagick. I process Sidekiq with 25 parallel workers.

It is interesting to note that when sidekiq is turned off and restarted, it starts working again.

+5
source share
2 answers

It seems that this problem has been solved by limiting the number of concurrent workers using sidekiq to 1. This can be done by specifying -c 1 when loading sidekiq.

+2
source

I had the same issue and traced it back to the thread safety issue in Paperclip. See https://github.com/thoughtbot/paperclip/issues/1709

+3
source

Source: https://habr.com/ru/post/1200792/


All Articles