-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Errno::E2BIG: Argument list too long #1670
Comments
We haven't seen this error since we lowered our number of threads (we are using AWS m3.large - for reference)
Although point 3 was done this week and we haven't seen anything related with this issue by just doing 1 and 2. |
I've run into the same problem. We're using Paperclip with Sidekiq and after a while it ends up throwing Paperclip.options[:command_path] = '/usr/local/bin'
Leaving
|
The problem is this line: Cocaine::CommandLine.path = [Cocaine::CommandLine.path, command_path].flatten.compact.uniq https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/helpers.rb#L27 Here's the relevant method in Cocaine: def path=(supplemental_path)
@supplemental_path = supplemental_path
@supplemental_environment ||= {}
@supplemental_environment['PATH'] = (Array(supplemental_path) + [ENV['PATH']]).join(File::PATH_SEPARATOR)
end When multiple workers set the value simultaneously, it ends up prepending My quick and dirty fix is to set module Paperclip
module Helpers
def run(cmd, arguments = "", interpolation_values = {}, local_options = {})
command_path = options[:command_path]
# set path only when it's nil
Cocaine::CommandLine.path ||= command_path
if logging? && (options[:log_command] || local_options[:log_command])
local_options = local_options.merge(:logger => logger)
end
Cocaine::CommandLine.new(cmd, arguments, local_options).run(interpolation_values)
end
end
end |
This might not be an issue since the latest release of Cocaine specifically this commit: thoughtbot/cocaine@e61a678 |
I was having a same issue with Rails 4.2 + paperclip 4.2.1 + cocaine 0.5.5. I used the pch's patch. As @pch said, the problem was in this line.
Cocaine::CommandLine.path returns a string like "/usr/bin/:/usr/local/bin/", and command_path returns an array like ["/usr/bin", "/usr/local/bin"]. |
Fixed in master. Thanks for reporting! |
Hello guys,
Seems I'm not the first one to have this problem #722
We just changed to sidekiq very recently (almost two weeks).
We are using:
rails 3.2.18
paperclip 4.2.0
sidekiq 3.2.5
Error message:
Argument list too long - identify -format '%wx%h,%[exif:orientation]' '/tmp/919c8b643b7133116b02fc0d9bb7df3f20141007-1108-zjkewb.jpg[0]' 2>/dev/null
This is the backtrace we get from sidekiq, hope it can be somehow helpful to debug the problem
Thank you
The text was updated successfully, but these errors were encountered: