CMUEMS/Pons — Issue #6: Inappropriate error for non-unique lithocode on call submission
Author: mickeyreiss
Created: 2012-02-20 21:35:17+00:00
State: open
Labels: BUG

A ActiveRecord::RecordInvalid occurred in calls#submit:

Validation failed: Lithocode has already been taken
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/calls/1200064/submit
* IP address: 128.237.80.83
* Parameters: {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=", "call"=>{"lithocode"=>"17518147"}, "commit"=>"Submit Tripsheet", "action"=>"submit", "controller"=>"calls", "id"=>"1200064"}
* Rails root: /var/www/pons.cmuems.org

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

* session id: [FILTERED]
* data: {"session_id"=>"720da2e48b4226c443239da43f30e3fd",
"_csrf_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=",
"member_id"=>281}

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

* CONTENT_LENGTH : 145
* CONTENT_TYPE : application/x-www-form-urlencoded
* 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 : _pons.cmuems.org_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTcyMGRhMmU0OGI0MjI2YzQ0MzIzOWRhNDNmMzBlM2ZkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVY1NEdiMlcyckt3aGhYTzdBNzdzOENWb3p4NWJWd1VyQlZHbzJMNmZCRFE9BjsARkkiDm1lbWJlcl9pZAY7AEZpAhkB--63ec4412a061a55173cbba1ad03d633f1a706a68
* HTTP_HOST : pons.cmuems.org
* HTTP_ORIGIN : https://pons.cmuems.org
* HTTP_REFERER : https://pons.cmuems.org/calls/1200064
* HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11
* PASSENGER_CONNECT_PASSWORD : [FILTERED]
* PATH_INFO : /calls/1200064/submit
* QUERY_STRING :
* REMOTE_ADDR : 128.237.80.83
* REMOTE_PORT : 63632
* REQUEST_METHOD : PUT
* REQUEST_URI : /calls/1200064/submit
* 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 : calls#submit
* action_dispatch.cookies : #
* action_dispatch.parameter_filter : [:password, :password_confirmation, :api_key, /RAW_POST_DATA/]
* action_dispatch.remote_ip : 128.237.80.83
* action_dispatch.request.content_type : application/x-www-form-urlencoded
* action_dispatch.request.formats : [text/html]
* action_dispatch.request.parameters : {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=", "call"=>{"lithocode"=>"17518147"}, "commit"=>"Submit Tripsheet", "action"=>"submit", "controller"=>"calls", "id"=>"1200064"}
* action_dispatch.request.path_parameters : {:action=>"submit", :controller=>"calls", :id=>"1200064"}
* action_dispatch.request.query_parameters : {}
* action_dispatch.request.request_parameters : {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=", "call"=>{"lithocode"=>"17518147"}, "commit"=>"Submit Tripsheet"}
* action_dispatch.request.unsigned_session_cookie: {"session_id"=>"720da2e48b4226c443239da43f30e3fd", "_csrf_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=", "member_id"=>281}
* 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 : {"_pons.cmuems.org_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTcyMGRhMmU0OGI0MjI2YzQ0MzIzOWRhNDNmMzBlM2ZkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVY1NEdiMlcyckt3aGhYTzdBNzdzOENWb3p4NWJWd1VyQlZHbzJMNmZCRFE9BjsARkkiDm1lbWJlcl9pZAY7AEZpAhkB--63ec4412a061a55173cbba1ad03d633f1a706a68"}
* rack.request.cookie_string : _pons.cmuems.org_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRkkiJTcyMGRhMmU0OGI0MjI2YzQ0MzIzOWRhNDNmMzBlM2ZkBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMVY1NEdiMlcyckt3aGhYTzdBNzdzOENWb3p4NWJWd1VyQlZHbzJMNmZCRFE9BjsARkkiDm1lbWJlcl9pZAY7AEZpAhkB--63ec4412a061a55173cbba1ad03d633f1a706a68
* rack.request.form_hash : {"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=", "call"=>{"lithocode"=>"17518147"}, "commit"=>"Submit Tripsheet"}
* rack.request.form_input : #
* rack.request.form_vars : utf8=%E2%9C%93&_method=put&authenticity_token=V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ%3D&call%5Blithocode%5D=17518147&commit=Submit+Tripsheet
* rack.request.query_hash : {}
* rack.request.query_string :
* rack.run_once : false
* rack.session : {"session_id"=>"720da2e48b4226c443239da43f30e3fd", "_csrf_token"=>"V54Gb2W2rKwhhXO7A77s8CVozx5bVwUrBVGo2L6fBDQ=", "member_id"=>281}
* rack.session.options : {:key=>"_pons.cmuems.org_session", :path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :coder=>#, :id=>"720da2e48b4226c443239da43f30e3fd"}
* rack.url_scheme : https
* rack.version : [1, 0]
* Process: 2891
* 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/calls_controller.rb:163:in `submit'
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__2418442363654756009__process_action__362318060127134378__callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:207:in `block in _conditional_callback_around_1249'
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_1249'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:434:in `_run__2418442363654756009__process_action__362318060127134378__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:82: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 `

'