thoughtbot/paperclip — Issue #722: Paperclip issues when processing too much - Errno::E2BIG: Argument list too long - identify -format %wx%h
Author: YavorIvanov
Created: 2012-01-30 08:16:46+00:00
State: open

Hi,

I'm having 2 projects. One of them is Rails 2.3.14 (ruby 1.8.7) and the other one is 3.2 (ruby 1.9.3).
In both projects we are experiencing the same couple of errors.

The Rails 2 one is dealing with small images and runs fine but when running a mass job to reprocess pictures in about 400 items (each needs to reprocess about 6 pictures) it starts getting an error and needs a restart.

In the Rails 3 one, its dealing with large files and when the app runs certain amount of time it just starts to produce the error at random and crashes the app until restart is made.

That being said I want to focus on the one particular error that is popping too often and isn't triggered by a job as it crashes a perfectly good operating application on the current stable ruby and rails versions.

Errno::E2BIG: Argument list too long - identify -format %wx%h '/tmp/stream20120129-17335-xtxzs1.jpg[0]'

``ruby
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
[GEM_ROOT]/gems/cocaine-0.2.1/lib/cocaine/command_line.rb:30:in `block in run'
[GEM_ROOT]/gems/cocaine-0.2.1/lib/cocaine/command_line.rb:51:in `with_modified_path'
[GEM_ROOT]/gems/cocaine-0.2.1/lib/cocaine/command_line.rb:28:in `run'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip.rb:101:in `run'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/geometry.rb:22:in `from_file'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/thumbnail.rb:35:in `initialize'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/processor.rb:33:in `new'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/processor.rb:33:in `make'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:440:in `block in post_process_style'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:439:in `each'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:439:in `inject'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:439:in `post_process_style'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:430:in `post_process_styles'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:424:in `block (2 levels) in post_process'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:403:in `_run__404196128518846007__photo_post_process__2799403801532999261__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_photo_post_process_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/callback_compatibility.rb:54:in `run_paperclip_callbacks'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:423:in `block in post_process'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:403:in `_run__404196128518846007__post_process__2799403801532999261__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_post_process_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/callback_compatibility.rb:54:in `run_paperclip_callbacks'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:422:in `post_process'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip/attachment.rb:119:in `assign'
[GEM_ROOT]/gems/paperclip-2.5.0/lib/paperclip.rb:344:in `block in has_attached_file'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/attribute_assignment.rb:85:in `block in assign_attributes'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/attribute_assignment.rb:78:in `each'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/base.rb:488:in `initialize'
app/controllers/administration/pictures_controller.rb:20:in `new'
app/controllers/administration/pictures_controller.rb:20:in `create'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/abstract_controller/base.rb:167:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:436:in `_run__1999084427942207763__process_action__2474360422919765723__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/abstract_controller/callbacks.rb:17:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/rescue.rb:29:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/notifications.rb:123:in `block in instrument'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/notifications.rb:123:in `instrument'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/abstract_controller/base.rb:121:in `process'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/abstract_controller/rendering.rb:45:in `process'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal.rb:203:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_controller/metal.rb:246:in `block in action'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:66:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:66:in `dispatch'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:30:in `call'
[GEM_ROOT]/gems/journey-1.0.0/lib/journey/router.rb:60:in `block in call'
[GEM_ROOT]/gems/journey-1.0.0/lib/journey/router.rb:48:in `each'
[GEM_ROOT]/gems/journey-1.0.0/lib/journey/router.rb:48:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:570:in `call'
[GEM_ROOT]/gems/omniauth-1.0.2/lib/omniauth/strategy.rb:168:in `call!'
[GEM_ROOT]/gems/omniauth-1.0.2/lib/omniauth/strategy.rb:148:in `call'
[GEM_ROOT]/gems/omniauth-1.0.2/lib/omniauth/builder.rb:42:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/head.rb:14:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/flash.rb:242:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:338:in `call'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/query_cache.rb:64:in `call'
[GEM_ROOT]/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `_run__2897959931721585378__call__2799403801532999261__callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/sendfile.rb:102:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
[GEM_ROOT]/gems/railties-3.2.0/lib/rails/rack/logger.rb:26:in `call_app'
[GEM_ROOT]/gems/railties-3.2.0/lib/rails/rack/logger.rb:16:in `call'
[GEM_ROOT]/gems/actionpack-3.2.0/lib/action_dispatch/middleware/request_id.rb:22:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
[GEM_ROOT]/gems/activesupport-3.2.0/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
[GEM_ROOT]/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
[GEM_ROOT]/gems/rack-cache-1.1/lib/rack/cache/context.rb:132:in `forward'
[GEM_ROOT]/gems/rack-cache-1.1/lib/rack/cache/context.rb:139:in `pass'
[GEM_ROOT]/gems/rack-cache-1.1/lib/rack/cache/context.rb:151:in `invalidate'
[GEM_ROOT]/gems/rack-cache-1.1/lib/rack/cache/context.rb:70:in `call!'
``
I was unable to determine any resin behind this.
I can provide more info about our configuration if necessary.

Regards,
Yavor