CMUEMS/Pons — Issue #10: Invalid IR updates cause crash instead of error message
Author: mickeyreiss
Created: 2012-02-22 23:00:03+00:00
State: open

Possibly just invalid IRs due to duplicates.

A ActiveRecord::RecordInvalid occurred in incidents#update:

Validation failed: Incident narrative is not unique. Is this possibly a duplicate IR?
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/validations.rb:56:in `save!'

-------------------------------
Request:
-------------------------------

* URL : https://pons.cmuems.org/qab/incidents/1205002
* IP address: 128.237.237.4
* Parameters: {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=", "incident_action"=>{"description"=>"Duplicate of IR1205001."}, "incident"=>{"reviewed"=>"0", "nature_of_incident"=>"Missing On-Scene Form", "type_of_activity"=>"1100592", "cmpd_involved"=>"0", "pghems_involved"=>"0", "shs_involved"=>"0", "third_party_involved"=>"0", "subject_id"=>"", "supervisor_id"=>"", "crew_chief_id"=>"", "involved_ids"=>["341", "338"]}, "commit"=>"Save Incident", "action"=>"update", "controller"=>"qab/incidents", "id"=>"1205002"}
* Rails root: /var/www/pons.cmuems.org

-------------------------------
Session:
-------------------------------

* session id: [FILTERED]
* data: {"session_id"=>"7ae94efcb18b2981af3ef3aab57e5ea1",
"_csrf_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=",
"member_id"=>303}

-------------------------------
Environment:
-------------------------------

* CONTENT_LENGTH : 2164
* CONTENT_TYPE : multipart/form-data; boundary=----WebKitFormBoundaryMwXBOv4Mrl827yAH
* DOCUMENT_ROOT : /var/www/pons.cmuems.org/public/
* HTTPS : on
* HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
* HTTP_ACCEPT_CHARSET : ISO-8859-1,utf-8;q=0.7,*;q=0.3
* HTTP_ACCEPT_ENCODING : gzip,deflate,sdch
* HTTP_ACCEPT_LANGUAGE : en-US,en;q=0.8
* HTTP_CACHE_CONTROL : max-age=0
* HTTP_CONNECTION : keep-alive
* HTTP_COOKIE : __utma=212108875.2056586496.1327284159.1329553838.1329631240.6; __utmc=212108875; __utmz=212108875.1328804531.4.2.utmcsr=facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/l.php; _pons.cmuems.org_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTdhZTk0ZWZjYjE4YjI5ODFhZjNlZjNhYWI1N2U1ZWExBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUhxeHNpZm1HdXFnUmpuVm15NDZES2Q0RTIzblM5OExBR205U3hvbVJzQ2s9BjsARkkiDm1lbWJlcl9pZAY7AEZpAi8B--d51850b5ba7bf31c907278f502448237daf78598
* HTTP_HOST : pons.cmuems.org
* HTTP_ORIGIN : https://pons.cmuems.org
* HTTP_REFERER : https://pons.cmuems.org/qab/incidents/1205002
* HTTP_USER_AGENT : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11
* PASSENGER_CONNECT_PASSWORD : [FILTERED]
* PATH_INFO : /qab/incidents/1205002
* QUERY_STRING :
* REMOTE_ADDR : 128.237.237.4
* REMOTE_PORT : 54052
* REQUEST_METHOD : PUT
* REQUEST_URI : /qab/incidents/1205002
* SCRIPT_NAME :
* SERVER_ADDR : 128.2.100.36
* SERVER_ADMIN : webmaster@cmuems.org
* SERVER_NAME : pons.cmuems.org
* SERVER_PORT : 443
* SERVER_PROTOCOL : HTTP/1.1
* SERVER_SOFTWARE : Apache/2.2.16 (Debian)
* SSL_TLS_SNI : pons.cmuems.org
* _ : _
* action_controller.instance : incidents#update
* action_dispatch.cookies : #
* action_dispatch.parameter_filter : [:password, :password_confirmation, :api_key, /RAW_POST_DATA/, /RAW_POST_DATA/]
* action_dispatch.remote_ip : 128.237.237.4
* action_dispatch.request.content_type : multipart/form-data
* action_dispatch.request.formats : [text/html]
* action_dispatch.request.parameters : {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=", "incident_action"=>{"description"=>"Duplicate of IR1205001."}, "incident"=>{"reviewed"=>"0", "nature_of_incident"=>"Missing On-Scene Form", "type_of_activity"=>"1100592", "cmpd_involved"=>"0", "pghems_involved"=>"0", "shs_involved"=>"0", "third_party_involved"=>"0", "subject_id"=>"", "supervisor_id"=>"", "crew_chief_id"=>"", "involved_ids"=>["341", "338"]}, "commit"=>"Save Incident", "action"=>"update", "controller"=>"qab/incidents", "id"=>"1205002"}
* action_dispatch.request.path_parameters : {:action=>"update", :controller=>"qab/incidents", :id=>"1205002"}
* action_dispatch.request.query_parameters : {}
* action_dispatch.request.request_parameters : {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=", "incident_action"=>{"description"=>"Duplicate of IR1205001."}, "incident"=>{"reviewed"=>"0", "nature_of_incident"=>"Missing On-Scene Form", "type_of_activity"=>"1100592", "cmpd_involved"=>"0", "pghems_involved"=>"0", "shs_involved"=>"0", "third_party_involved"=>"0", "subject_id"=>"", "supervisor_id"=>"", "crew_chief_id"=>"", "involved_ids"=>["341", "338"]}, "commit"=>"Save Incident"}
* action_dispatch.request.unsigned_session_cookie: {"session_id"=>"7ae94efcb18b2981af3ef3aab57e5ea1", "_csrf_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=", "member_id"=>303}
* action_dispatch.routes : #
* action_dispatch.secret_token : 714946bd2b433e929763013a2309c4c1be922e7db3db05a1943fc1750d5e1e8d158ab4773d05e0e68e7cc7d1f17ea5bdd007ca86a1ad75dead9c1f22434ca049
* action_dispatch.show_exceptions : true
* exception_notifier.options : {:sender_address=>"\"Pons Exceptions\" ", :exception_recipients=>["webmaster@cmuems.org"], :email_prefix=>"[Pons ERROR] ", :sections=>["request", "session", "environment", "backtrace"], :ignore_exceptions=>[ActiveRecord::RecordNotFound, AbstractController::ActionNotFound, ActionController::RoutingError]}
* rack-cache.allow_reload : false
* rack-cache.allow_revalidate : false
* rack-cache.cache_key : Rack::Cache::Key
* rack-cache.default_ttl : 0
* rack-cache.entitystore : rails:/
* rack-cache.metastore : rails:/
* rack-cache.private_headers : ["Authorization", "Cookie"]
* rack-cache.storage : #
* rack-cache.verbose : true
* rack.errors : #
* rack.input : #
* rack.methodoverride.original_method : POST
* rack.multiprocess : true
* rack.multithread : false
* rack.request.cookie_hash : {"__utma"=>"212108875.2056586496.1327284159.1329553838.1329631240.6", "__utmc"=>"212108875", "__utmz"=>"212108875.1328804531.4.2.utmcsr=facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/l.php", "_pons.cmuems.org_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTdhZTk0ZWZjYjE4YjI5ODFhZjNlZjNhYWI1N2U1ZWExBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUhxeHNpZm1HdXFnUmpuVm15NDZES2Q0RTIzblM5OExBR205U3hvbVJzQ2s9BjsARkkiDm1lbWJlcl9pZAY7AEZpAi8B--d51850b5ba7bf31c907278f502448237daf78598"}
* rack.request.cookie_string : __utma=212108875.2056586496.1327284159.1329553838.1329631240.6; __utmc=212108875; __utmz=212108875.1328804531.4.2.utmcsr=facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/l.php; _pons.cmuems.org_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTdhZTk0ZWZjYjE4YjI5ODFhZjNlZjNhYWI1N2U1ZWExBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUhxeHNpZm1HdXFnUmpuVm15NDZES2Q0RTIzblM5OExBR205U3hvbVJzQ2s9BjsARkkiDm1lbWJlcl9pZAY7AEZpAi8B--d51850b5ba7bf31c907278f502448237daf78598
* rack.request.form_hash : {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=", "incident_action"=>{"description"=>"Duplicate of IR1205001."}, "incident"=>{"reviewed"=>"0", "nature_of_incident"=>"Missing On-Scene Form", "type_of_activity"=>"1100592", "cmpd_involved"=>"0", "pghems_involved"=>"0", "shs_involved"=>"0", "third_party_involved"=>"0", "subject_id"=>"", "supervisor_id"=>"", "crew_chief_id"=>"", "involved_ids"=>["341", "338"]}, "commit"=>"Save Incident"}
* rack.request.form_input : #
* rack.request.query_hash : {}
* rack.request.query_string :
* rack.run_once : false
* rack.session : {"session_id"=>"7ae94efcb18b2981af3ef3aab57e5ea1", "_csrf_token"=>"HqxsifmGuqgRjnVmy46DKd4E23nS98LAGm9SxomRsCk=", "member_id"=>303}
* rack.session.options : {:key=>"_pons.cmuems.org_session", :path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :coder=>#, :id=>"7ae94efcb18b2981af3ef3aab57e5ea1"}
* rack.url_scheme : https
* rack.version : [1, 0]
* Process: 15263
* Server : fascia

-------------------------------
Backtrace:
-------------------------------

vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/validations.rb:56:in `save!'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:246:in `block in save!'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:208:in `transaction'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:246:in `save!'
app/controllers/qab/incidents_controller.rb:75:in `block in update'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:208:in `transaction'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/transactions.rb:232:in `transaction'
app/controllers/qab/incidents_controller.rb:47:in `update'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/abstract_controller/base.rb:167:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:444:in `block in _run__3525036227805533105__process_action__1162385640889795378__callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:207:in `block in _conditional_callback_around_1254'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:318:in `around'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:302:in `_callback_around_13'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:206:in `_conditional_callback_around_1254'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:434:in `_run__3525036227805533105__process_action__1162385640889795378__callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/abstract_controller/callbacks.rb:17:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/rescue.rb:17:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/notifications.rb:53:in `block in instrument'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/notifications.rb:53:in `instrument'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/abstract_controller/base.rb:121:in `process'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/abstract_controller/rendering.rb:45:in `process'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal.rb:193:in `dispatch'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal.rb:236:in `block in action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:65:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:29:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'
vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:531:in `call'
vendor/bundle/ruby/1.9.1/gems/exception_notification-2.5.2/lib/exception_notifier.rb:25:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/conditionalget.rb:35:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/head.rb:14:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/flash.rb:243:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/session/abstract/id.rb:195:in `context'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/session/abstract/id.rb:190:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/cookies.rb:326:in `call'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/query_cache.rb:62:in `call'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/sendfile.rb:101:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/rack/logger.rb:13:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/methodoverride.rb:24:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.3.6/lib/rack/lock.rb:15:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.0.3/lib/rack/cache/context.rb:132:in `forward'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.0.3/lib/rack/cache/context.rb:139:in `pass'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.0.3/lib/rack/cache/context.rb:151:in `invalidate'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.0.3/lib/rack/cache/context.rb:70:in `call!'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.0.3/lib/rack/cache/context.rb:50:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:455:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.8) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.8) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
passenger (3.0.8) lib/phusion_passenger/rack/application_spawner.rb:170:in `block in handle_spawn_application'
passenger (3.0.8) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.8) lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.8) lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
:10:in `synchronize'
passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.8) helper-scripts/passenger-spawn-server:99:in `

'