Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[production][unknown] PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_chats_on_user_... #181

Open
dwilkie opened this issue Jun 6, 2015 · 0 comments

Comments

@dwilkie
Copy link
Owner

dwilkie commented Jun 6, 2015

See this exception on Errbit

PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_chats_on_user_id_and_friend_id"

DETAIL: Key (user_id, friend_id)=(85526, 90420) already exists.

Summary

Where

unknown

Occured

Jun 06 10:25am

Similar

0

Params

{
  "args" => "[\"SMART\", \"85587330316\", \"2442\", \"Em e? Hayourd\\n!z\", \"0\", \"1\", \"1\"]",
  "class" => "MoMessageReceivedJob",
  "error_class" => "ActiveRecord::RecordNotUnique",
  "error_message" => "PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint \"index_chats_on_user_id_and_friend_id\"\nDETAIL:  Key (user_id, friend_id)=(85526, 90420) already exists.\n: INSERT INTO \"chats\" (\"user_id\", \"starter_id\", \"starter_type\", \"friend_id\", \"created_at\", \"updated_at\") VALUES ($1, $2, $3, $4, $5, $6) RETURNING \"id\"",
  "failed_at" => "1433561102.1494722",
  "queue" => "urgent",
  "retry" => "true",
  "retry_count" => "0",
  "vars" => nil
}

Session

{
}

Backtrace

602:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb -> **exec_prepared**
602:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb -> **block in exec_cache**
473:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb -> **block in log**
20:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb -> **instrument**
467:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb -> **log**
601:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb -> **exec_cache**
585:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb -> **execute_and_clear**
160:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb -> **exec_query**
192:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb -> **exec_insert**
108:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb -> **insert**
14:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/query_cache.rb -> **insert**
64:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/relation.rb -> **insert**
522:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/persistence.rb -> **_create_record**
139:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/counter_cache.rb -> **_create_record**
75:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/locking/optimistic.rb -> **_create_record**
131:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/attribute_methods/dirty.rb -> **_create_record**
306:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/callbacks.rb -> **block in _create_record**
117:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
117:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
555:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **block (2 levels) in compile**
505:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
505:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
92:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **_run_callbacks**
776:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **_run_create_callbacks**
306:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/callbacks.rb -> **_create_record**
57:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/timestamp.rb -> **_create_record**
502:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/persistence.rb -> **create_or_update**
302:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/callbacks.rb -> **block in create_or_update**
117:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
117:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
555:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **block (2 levels) in compile**
505:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
505:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
92:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **_run_callbacks**
776:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **_run_save_callbacks**
302:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/callbacks.rb -> **create_or_update**
142:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/persistence.rb -> **save!**
43:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/validations.rb -> **save!**
29:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/attribute_methods/dirty.rb -> **save!**
291:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **block in save!**
347:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **block in with_transaction_returning_status**
211:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb -> **transaction**
220:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **transaction**
344:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **with_transaction_returning_status**
291:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **save!**
107:  app/models/chat.rb -> **activate!**
214:  app/models/chat.rb -> **initialize_and_activate_for_friend!**
60:  app/models/chat.rb -> **activate_multiple!**
228:  app/models/message.rb -> **activate_chats!**
188:  app/models/message.rb -> **route_to_destination**
54:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/core/transition.rb -> **invoke_callbacks_compatible_with_guard**
32:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/core/transition.rb -> **execute**
115:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/core/event.rb -> **block in _fire**
107:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/core/event.rb -> **each**
107:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/core/event.rb -> **_fire**
26:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/core/event.rb -> **fire**
77:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/aasm.rb -> **aasm_fire_event**
175:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/persistence/active_record_persistence.rb -> **block in aasm_fire_event**
213:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb -> **block in transaction**
188:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/transaction.rb -> **within_new_transaction**
213:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb -> **transaction**
220:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **transaction**
175:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/persistence/active_record_persistence.rb -> **aasm_fire_event**
89:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-dad5b44bcfed/lib/aasm/base.rb -> **block in event**
16:  app/jobs/mo_message_received_job.rb -> **perform**
75:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb -> **execute_job**
52:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb -> **block (2 levels) in process**
127:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb -> **block in invoke**
6:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/active_record.rb -> **call**
129:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb -> **block in invoke**
74:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/retry_jobs.rb -> **call**
129:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb -> **block in invoke**
15:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/logging.rb -> **block in call**
24:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/logging.rb -> **with_context**
11:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/server/logging.rb -> **call**
129:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb -> **block in invoke**
132:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb -> **call**
132:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/middleware/chain.rb -> **invoke**
51:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb -> **block in process**
98:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb -> **stats**
50:  [GEM_ROOT]/gems/sidekiq-3.3.4/lib/sidekiq/processor.rb -> **process**
26:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/calls.rb -> **public_send**
26:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/calls.rb -> **dispatch**
122:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/calls.rb -> **dispatch**
60:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/cell.rb -> **block in invoke**
71:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/cell.rb -> **block in task**
357:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/actor.rb -> **block in task**
57:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/tasks.rb -> **block in initialize**
15:  [GEM_ROOT]/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb -> **block in create**

Environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant