Search code examples
ruby-on-railsimagemagickpaperclipsidekiq

ImageMagick/Paperclip - Paperclip fails during large job


I'm using Paperclip with ImageMagick to process a few thousands images and upload them to S3. It goes through hundreds of images with no issues, and then gives this error:

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

I've seen other questions referencing this error, but it seems strange to me that it can process fine one second, and then the next not be able to find ImageMagick. I'm processing with Sidekiq with 25 concurrent workers.

It's interesting to note that when shutting down sidekiq and restarting, it starts to work again.


Solution

  • It appears as though this problem was solved by limiting the number of concurrent workers used with sidekiq to just 1. This can be done by specifying -c 1 when booting up sidekiq.