Get your own customer support community
 

CollectionHelper#normalize_params is choking on ActionController::UploadedStringIO objects.

When trying to upload images, certain image types result in a parameter like this: #<actioncontroller::uploadedstringio:0x34c62d1622e0>

When RPM tries to process this action, it thinks that this object is of type "Enumerable" and tries to call ".first(20)" on it, which causes rails to throw this error:

undefined method `first' for #<actioncontroller::uploadedstringio:0x34c62d1622e0>

The stack trace is:

undefined method `first' for #<actioncontroller::uploadedstringio:0x34c62d1622e0>
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:19:in `normalize_params'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:15:in `normalize_params'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:14:in `each'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:14:in `normalize_params'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:15:in `normalize_params'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:14:in `each'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/collection_helper.rb:14:in `normalize_params'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/transaction_sampler.rb:260:in `set_transaction_info'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/transaction_sampler.rb:123:in `notice_transaction'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/rails/action_controller.rb:52:in `perform_action'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:41:in `trace_method_execution_with_scope'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/rails/action_controller.rb:47:in `perform_action'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:18:in `trace_method_execution_no_scope'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/rails/action_controller.rb:41:in `perform_action'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `sass_old_process'
/usr/local/lib/ruby/gems/1.8/gems/haml-2.0.2/lib/sass/plugin/rails.rb:19:in `process'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch_without_newrelic'
/home/gcafe/rails/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/dispatcher_instrumentation.rb:47:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:76:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:74:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:159:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:158:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:158:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:268:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:268:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel.rb:268:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/configurator.rb:282:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/configurator.rb:281:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/configurator.rb:281:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/command.rb:212:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/usr/local/bin/mongrel_rails:19:in `load'
/usr/local/bin/mongrel_rails:19</actioncontroller::uploadedstringio:0x34c62d1622e0></actioncontroller::uploadedstringio:0x34c62d1622e0></actioncontroller::uploadedstringio:0x34c62d1622e0>
 
sad I’m frustrated
Inappropriate?
3 people have this problem

The company marked this problem solved.


User_default_medium