DuplicatePstatement

193 views
Skip to first unread message

AG

unread,
Oct 6, 2014, 1:25:21 PM10/6/14
to rub...@googlegroups.com
Hi everyone,

My rails app is hosted at AWS Opsworks and sporadically I get the error: PG::DuplicatePstatement

I would like to know if someone can let me know what causes this error, is is the PG gem? or the database layer? or the Ruby on Rails framework?

What is the best way to fix this issue? Should I disable prepared statements? And finally I would like to know if there is a way to add a begin rescue block for this exception in Ruby on Rails?

Thanks Regards,

Arturo

AG

unread,
Oct 6, 2014, 1:26:04 PM10/6/14
to rub...@googlegroups.com
PG::DuplicatePstatement: ERROR: prepared statement "a6" already exists : INSERT INTO "polls" ("answer_type", "auto_enable", "can_have_correct_answer", "created_at", "de", "en", "es", "event_id", "game_card_length", "game_card_start", "id_language_code", "is_custom_question", "ja", "language_id", "points_award", "poll_upload_id", "pop_up_length", "pop_up_start", "pop_up_trigger_type", "pt", "question", "question_identifier", "question_tag", "question_translation", "question_type", "scorecard_presentation", "show_at_minute", "show_n_seconds", "template_type", "th", "trigger_restriction", "updated_at", "vi", "vizrt_show_name", "vizrt_template_name", "vote_options", "vote_options_translation") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37) RETURNING "id"

URL: http://app.domain.com/admin/polls

BACKTRACE:
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `prepare'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `prepare_statement'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1168:in `exec_cache'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in `block in exec_query'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/instrumentation/active_record.rb:46:in `block in log_with_newrelic_instrumentation'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/method_tracer.rb:235:in `trace_execution_scoped'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/instrumentation/active_record.rb:43:in `log_with_newrelic_instrumentation'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in `exec_query'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:63:in `exec_insert'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/relation.rb:66:in `insert'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/persistence.rb:367:in `create'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/timestamp.rb:58:in `create'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/callbacks.rb:268:in `block in create'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:403:in `_run__355353764622945659__create__4467585814663071278__callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/callbacks.rb:268:in `create'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/persistence.rb:348:in `create_or_update'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/callbacks.rb:264:in `block in create_or_update'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:447:in `_run__355353764622945659__save__4467585814663071278__callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/callbacks.rb:264:in `create_or_update'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/persistence.rb:84:in `save'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/validations.rb:50:in `save'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:208:in `transaction'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/method_tracer.rb:497:in `block in transaction_with_trace_ActiveRecord_self_name_transaction'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/method_tracer.rb:235:in `trace_execution_scoped'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/method_tracer.rb:493:in `transaction_with_trace_ActiveRecord_self_name_transaction'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:259:in `block in save'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/transactions.rb:258:in `save'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/resource_controller/data_access.rb:163:in `block in save_resource'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/callbacks.rb:78:in `run_save_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/resource_controller/data_access.rb:162:in `save_resource'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/resource_controller/data_access.rb:152:in `block in create_resource'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/callbacks.rb:78:in `run_create_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/resource_controller/data_access.rb:151:in `create_resource'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/inherited_resources-1.4.1/lib/inherited_resources/actions.rb:33:in `create'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/resource_controller/actions.rb:48:in `create'
/srv/www/app_pro/releases/20140930174854/app/admin/polls.rb:13:in `create'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/abstract_controller/base.rb:167:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/rendering.rb:10:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:480:in `_run__674118340747155841__process_action__4403365755486731848__callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/rescue.rb:29:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/notifications.rb:123:in `block in instrument'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/notifications.rb:123:in `instrument'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:38:in `block in process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:357:in `perform_action_with_newrelic_trace'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:37:in `process_action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/abstract_controller/base.rb:121:in `process'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/abstract_controller/rendering.rb:45:in `process'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal.rb:203:in `dispatch'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_controller/metal.rb:246:in `block in action'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/routing/route_set.rb:73:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/routing/route_set.rb:36:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/routing/route_set.rb:608:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/omniauth-1.2.1/lib/omniauth/builder.rb:59:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/rack/error_collector.rb:55:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/rack/agent_hooks.rb:32:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/newrelic_rpm-3.8.1.221/lib/new_relic/rack/browser_monitoring.rb:27:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/deflater.rb:13:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/head.rb:14:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/flash.rb:242:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/cookies.rb:341:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/query_cache.rb:64:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:405:in `_run__1037584046338014875__call__4467585814663071278__callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/railties-3.2.19/lib/rails/rack/logger.rb:32:in `call_app'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/railties-3.2.19/lib/rails/rack/logger.rb:16:in `block in call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/tagged_logging.rb:22:in `tagged'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/railties-3.2.19/lib/rails/rack/logger.rb:16:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/activesupport-3.2.19/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/actionpack-3.2.19/lib/action_dispatch/middleware/static.rb:63:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `block in call'
/usr/local/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/railties-3.2.19/lib/rails/engine.rb:484:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/railties-3.2.19/lib/rails/application.rb:231:in `call'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/railties-3.2.19/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576:in `process_client'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670:in `worker_loop'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
/home/deploy/.bundler/app_pro/ruby/1.9.1/gems/unicorn-4.8.3/bin/unicorn_rails:209:in `'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bin/unicorn_rails:23:in `load'
/home/deploy/.bundler/app_pro/ruby/1.9.1/bin/unicorn_rails:23:in `'

larskanis

unread,
Oct 8, 2014, 10:14:12 AM10/8/14
to rub...@googlegroups.com
On Monday, October 6, 2014 7:26:04 PM UTC+2, AG wrote:
PG::DuplicatePstatement: ERROR: prepared statement "a6" already exists : INSERT INTO "polls" ("answer_type", "auto_enable", "can_have_correct_answer", "created_at", "de", "en", "es", "event_id", "game_card_length", "game_card_start", "id_language_code", "is_custom_question", "ja", "language_id", "points_award", "poll_upload_id", "pop_up_length", "pop_up_start", "pop_up_trigger_type", "pt", "question", "question_identifier", "question_tag", "question_translation", "question_type", "scorecard_presentation", "show_at_minute", "show_n_seconds", "template_type", "th", "trigger_restriction", "updated_at", "vi", "vizrt_show_name", "vizrt_template_name", "vote_options", "vote_options_translation") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37) RETURNING "id"


This looks like a threading issue either in ActiveRecord or in your application. Not sure if that helps you, but it's quite sure not an issue in ruby-pg.

--
Kind regards,
Lars

mar...@workable.com

unread,
Sep 28, 2017, 8:02:26 PM9/28/17
to ruby-pg
I'm guessing it might be related to job timeouts as well.

Don't know if the prepared statement pool is left in an inconsistent state e.g. the prepared statement counter doesn't advance, causing subsequent prepared statement to fail because the key is taken.

Reply all
Reply to author
Forward
0 new messages