danReynolds/SummonerExpert

ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_summoners_on_summoner_id" DETAIL: Key (summoner_id)=(82669267) already exists. : INSERT INTO "summoners" ("name", "account_id", "summoner_id

Closed this issue · 0 comments

View details in Rollbar: https://rollbar.com/danreynolds/SummonerExpert/items/139/


PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_summoners_on_summoner_id"
DETAIL:  Key (summoner_id)=(82669267) already exists.

  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb", line 598, in async_exec
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb", line 598, in block in exec_no_cache
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb", line 566, in block in log
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb", line 21, in instrument
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb", line 560, in log
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb", line 598, in exec_no_cache
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb", line 587, in execute_and_clear
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb", line 103, in exec_query
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb", line 135, in exec_insert
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb", line 124, in insert
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb", line 14, in insert
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/relation.rb", line 65, in insert
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/persistence.rb", line 554, in _create_record
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/counter_cache.rb", line 128, in _create_record
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/locking/optimistic.rb", line 75, in _create_record
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/attribute_methods/dirty.rb", line 123, in _create_record
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/callbacks.rb", line 302, in block in _create_record
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 126, in call
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 506, in block (2 levels) in compile
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 455, in call
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 101, in __run_callbacks__
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 750, in _run_create_callbacks
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/callbacks.rb", line 302, in _create_record
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/timestamp.rb", line 68, in _create_record
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/persistence.rb", line 534, in create_or_update
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/callbacks.rb", line 298, in block in create_or_update
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 126, in call
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 506, in block (2 levels) in compile
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 455, in call
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 101, in __run_callbacks__
  File "/usr/local/bundle/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb", line 750, in _run_save_callbacks
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/callbacks.rb", line 298, in create_or_update
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/persistence.rb", line 125, in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/validations.rb", line 44, in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/attribute_methods/dirty.rb", line 22, in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 319, in block (2 levels) in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 395, in block in with_transaction_returning_status
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb", line 230, in transaction
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 211, in transaction
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 392, in with_transaction_returning_status
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 319, in block in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 334, in rollback_active_record_state!
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb", line 318, in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/suppressor.rb", line 41, in save
  File "/usr/local/bundle/gems/newrelic_rpm-3.16.2.321/lib/new_relic/agent/instrumentation/active_record_helper.rb", line 26, in block in save
  File "/usr/local/bundle/gems/newrelic_rpm-3.16.2.321/lib/new_relic/agent/transaction.rb", line 855, in with_database_metric_name
  File "/usr/local/bundle/gems/newrelic_rpm-3.16.2.321/lib/new_relic/agent.rb", line 569, in with_database_metric_name
  File "/usr/local/bundle/gems/newrelic_rpm-3.16.2.321/lib/new_relic/agent/instrumentation/active_record_helper.rb", line 25, in save
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/persistence.rb", line 34, in create
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/relation.rb", line 150, in block in create
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/relation.rb", line 351, in scoping
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/relation.rb", line 150, in create
  File "/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/relation.rb", line 224, in find_or_create_by
  File "/app/lib/match_helper.rb", line 50, in block (2 levels) in store_match
  File "/app/lib/match_helper.rb", line 41, in map
  File "/app/lib/match_helper.rb", line 41, in with