fjordllc / bootcamp

プログラマー向けEラーニングシステム
https://bootcamp.fjord.jp
MIT License
284 stars 71 forks source link

ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_bookmarks_unique" DETAIL: Key (bookmarkable_id, bookmarkable_type, user_id)=(434, Page, 1466) already exists. #7957

Open komagata opened 3 months ago

komagata commented 3 months ago

View details in Rollbar: https://app.rollbar.com/a/komagata/fix/item/Bootcamp/1704



PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_bookmarks_unique"
DETAIL:  Key (bookmarkable_id, bookmarkable_type, user_id)=(434, Page, 1466) already exists.

  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb", line 672, in exec_params
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb", line 672, in block (2 levels) in exec_no_cache
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/dependencies/interlock.rb", line 48, in block in permit_concurrent_loads
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/share_lock.rb", line 187, in yield_shares
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/dependencies/interlock.rb", line 47, in permit_concurrent_loads
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb", line 671, in block in exec_no_cache
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract_adapter.rb", line 696, in block (2 levels) in log
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 26, in block (2 levels) in synchronize
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 25, in handle_interrupt
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 25, in block in synchronize
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 21, in handle_interrupt
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 21, in synchronize
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract_adapter.rb", line 695, in block in log
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/notifications/instrumenter.rb", line 24, in instrument
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract_adapter.rb", line 687, in log
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb", line 670, in exec_no_cache
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb", line 649, in execute_and_clear
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb", line 53, in exec_query
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb", line 136, in exec_insert
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb", line 91, in exec_insert
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb", line 171, in insert
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/query_cache.rb", line 22, in insert
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb", line 375, in _insert_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb", line 929, in _create_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/counter_cache.rb", line 166, in _create_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/locking/optimistic.rb", line 79, in _create_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/attribute_methods/dirty.rb", line 201, in _create_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/callbacks.rb", line 461, in block in _create_record
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb", line 98, in run_callbacks
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb", line 824, in _run_create_callbacks
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/callbacks.rb", line 461, in _create_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/timestamp.rb", line 108, in _create_record
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb", line 900, in create_or_update
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/callbacks.rb", line 457, in block in create_or_update
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb", line 106, in run_callbacks
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/callbacks.rb", line 824, in _run_save_callbacks
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/callbacks.rb", line 457, in create_or_update
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/timestamp.rb", line 126, in create_or_update
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/persistence.rb", line 507, in save!
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/validations.rb", line 53, in save!
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/transactions.rb", line 302, in block in save!
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/transactions.rb", line 354, in block in with_transaction_returning_status
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb", line 320, in block in transaction
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/abstract/transaction.rb", line 319, in block in within_new_transaction
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 26, in block (2 levels) in synchronize
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 25, in handle_interrupt
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 25, in block in synchronize
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 21, in handle_interrupt
  File "/usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb", line 21, in synchronize
  File "/usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/c
github-actions[bot] commented 1 month ago

このissue|PRは60日間更新がないため7日後にcloseします。closeしたくない場合はstaleラベルを外してください。