sebbacon/alaveteli — Issue #390: PGError: ERROR:  duplicate key value violates unique constraint "index_info_requests_on_url_title"
Author: robinhouston
Created: 2012-01-25 17:55:18+00:00
State: open

A ActiveRecord::StatementInvalid occurred in request#new:

PGError: ERROR: duplicate key value violates unique constraint "index_info_requests_on_url_title"
: INSERT INTO "info_requests" ("idhash", "created_at", "url_title", "handle_rejected_responses", "title", "public_body_id", "awaiting_description", "updated_at", "allow_new_responses_from", "described_state", "user_id", "prominence", "law_used") VALUES('b9483b4f', '2012-01-25 17:24:09.720614', 'it_support_services_572', 'bounce', 'IT Support Services', 4095, 'f', '2012-01-25 17:24:09.720614', 'anybody', 'waiting_response', 27381, 'normal', 'foi') RETURNING "id"
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in `execute'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:1002:in `select_raw'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:989:in `select'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `select_one'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:460:in `insert'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:2961:in `create_without_timestamps'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/timestamp.rb:53:in `create_without_callbacks'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/callbacks.rb:266:in `create'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:2927:in `create_or_update_without_callbacks'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:2594:in `save_without_validation!'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/validations.rb:1099:in `save_without_dirty!'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
[RAILS_ROOT]/app/controllers/request_controller.rb:328:in `new'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `send'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:1333:in `perform_action_without_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `run_before_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:189:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:189:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:635:in `run_before_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:615:in `call_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `run_before_filters'
[RAILS_ROOT]/app/controllers/application_controller.rb:95:in `record_memory'
[RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
[RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:186:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:635:in `run_before_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:615:in `call_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
[RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
[RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/flash.rb:151:in `perform_action'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `send'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process_without_filters'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
[RAILS_ROOT]/vendor/gems/rack-1.1.0/lib/rack/head.rb:9:in `call'
[RAILS_ROOT]/vendor/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in `call'
[RAILS_ROOT]/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
[RAILS_ROOT]/vendor/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
[RAILS_ROOT]/vendor/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
[RAILS_ROOT]/vendor/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
[RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:181:in `spawn_application!'
/usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:153:in `spawn_application!'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:272:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/phusion_passenger/passenger-spawn-server:61