dwilkie / chibi

Chibi
chibitxt.me
1 stars 0 forks source link

[production][phone_call_completions#create] PG::TRDeadlockDetected: ERROR: deadlock detected DETAIL: Process 6423 waits for ShareLock on tr... #180

Closed dwilkie closed 9 years ago

dwilkie commented 9 years ago

See this exception on Errbit

PG::TRDeadlockDetected: ERROR: deadlock detected

DETAIL: Process 6423 waits for ShareLock on transaction 150070929; blocked by process 12082. Process 12082 waits for ShareLock on transaction 150070934; blocked by process 6423. HINT: See server log for query details. #

Summary

URL

https://chibi.herokuapp.com/phone_call_completions.xml"

Where

phone_call_completions#create

Occured

Jun 02 9:48am

Similar

0

Params

{
  "ApiVersion" => "adhearsion-twilio-0.0.1",
  "CallDuration" => "3",
  "CallSid" => "2da23905-f6aa-4862-9b09-ee8694130e57",
  "CallStatus" => "no-answer",
  "From" => "+85587538974",
  "To" => "+2441",
  "action" => "create",
  "controller" => "phone_call_completions",
  "format" => "xml"
}

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**
173:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb -> **exec_delete**
114:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb -> **update**
14:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/query_cache.rb -> **update**
345:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/relation.rb -> **update_all**
472:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/persistence.rb -> **touch**
296:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/callbacks.rb -> **block in touch**
88:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
88:  [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_touch_callbacks**
296:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/callbacks.rb -> **touch**
295:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **block in touch**
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**
295:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **touch**
49:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/no_touching.rb -> **touch**
90:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/associations/builder/belongs_to.rb -> **touch_record**
103:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/associations/builder/belongs_to.rb -> **block in add_touch_callbacks**
448:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **instance_exec**
448:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **block in make_lambda**
228:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
228:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **block in halting_and_conditional**
506:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
506:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **block in call**
506:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **each**
506:  [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**
120:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/persistence.rb -> **save**
37:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/validations.rb -> **save**
21:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/attribute_methods/dirty.rb -> **save**
286:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **block (2 levels) 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**
286:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **block in save**
301:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **rollback_active_record_state!**
285:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/transactions.rb -> **save**
91:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-f394bde6462f/lib/aasm/persistence/active_record_persistence.rb -> **aasm_write_state**
86:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-f394bde6462f/lib/aasm/instance_base.rb -> **set_current_state_with_persistence**
103:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-f394bde6462f/lib/aasm/aasm.rb -> **aasm_fired**
78:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-f394bde6462f/lib/aasm/aasm.rb -> **aasm_fire_event**
175:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-f394bde6462f/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-f394bde6462f/lib/aasm/persistence/active_record_persistence.rb -> **aasm_fire_event**
81:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bundler/gems/aasm-f394bde6462f/lib/aasm/base.rb -> **block in event**
149:  app/models/phone_call.rb -> **complete!**
7:  app/controllers/phone_call_completions_controller.rb -> **create**
4:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/implicit_render.rb -> **send_action**
198:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/abstract_controller/base.rb -> **process_action**
10:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/rendering.rb -> **process_action**
20:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/abstract_controller/callbacks.rb -> **block in process_action**
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_process_action_callbacks**
81:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **run_callbacks**
19:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/abstract_controller/callbacks.rb -> **process_action**
29:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/rescue.rb -> **process_action**
32:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb -> **block in process_action**
164:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/notifications.rb -> **block in instrument**
20:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb -> **instrument**
164:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/notifications.rb -> **instrument**
30:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/instrumentation.rb -> **process_action**
250:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/params_wrapper.rb -> **process_action**
18:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/railties/controller_runtime.rb -> **process_action**
137:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/abstract_controller/base.rb -> **process**
30:  [GEM_ROOT]/gems/actionview-4.2.1/lib/action_view/rendering.rb -> **process**
196:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal.rb -> **dispatch**
13:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal/rack_delegation.rb -> **dispatch**
237:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_controller/metal.rb -> **block in action**
74:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb -> **call**
74:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb -> **dispatch**
43:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb -> **serve**
43:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/journey/router.rb -> **block in serve**
30:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/journey/router.rb -> **each**
30:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/journey/router.rb -> **serve**
819:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb -> **call**
24:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/etag.rb -> **call**
38:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/conditionalget.rb -> **call**
13:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/head.rb -> **call**
27:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/params_parser.rb -> **call**
260:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/flash.rb -> **call**
225:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/session/abstract/id.rb -> **context**
220:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/session/abstract/id.rb -> **call**
560:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/cookies.rb -> **call**
36:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/query_cache.rb -> **call**
649:  [GEM_ROOT]/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb -> **call**
29:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/callbacks.rb -> **block in call**
88:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **call**
88:  [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_call_callbacks**
81:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/callbacks.rb -> **run_callbacks**
27:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/callbacks.rb -> **call**
78:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/remote_ip.rb -> **call**
17:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/debug_exceptions.rb -> **call**
30:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/show_exceptions.rb -> **call**
38:  [GEM_ROOT]/gems/railties-4.2.1/lib/rails/rack/logger.rb -> **call_app**
20:  [GEM_ROOT]/gems/railties-4.2.1/lib/rails/rack/logger.rb -> **block in call**
68:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb -> **block in tagged**
26:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb -> **tagged**
68:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb -> **tagged**
20:  [GEM_ROOT]/gems/railties-4.2.1/lib/rails/rack/logger.rb -> **call**
21:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/request_id.rb -> **call**
22:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/methodoverride.rb -> **call**
18:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/runtime.rb -> **call**
28:  [GEM_ROOT]/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache_middleware.rb -> **call**
113:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/static.rb -> **call**
113:  [GEM_ROOT]/gems/rack-1.6.0/lib/rack/sendfile.rb -> **call**
24:  [GEM_ROOT]/gems/actionpack-4.2.1/lib/action_dispatch/middleware/ssl.rb -> **call**
29:  [GEM_ROOT]/gems/hirefire-resource-0.3.5/lib/hirefire/middleware.rb -> **call**
518:  [GEM_ROOT]/gems/railties-4.2.1/lib/rails/engine.rb -> **call**
164:  [GEM_ROOT]/gems/railties-4.2.1/lib/rails/application.rb -> **call**
576:  [GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb -> **process_client**
670:  [GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb -> **worker_loop**
525:  [GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb -> **spawn_missing_workers**
140:  [GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb -> **start**
126:  [GEM_ROOT]/gems/unicorn-4.8.3/bin/unicorn -> **<top (required)>**
23:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bin/unicorn -> **load**
23:  [PROJECT_ROOT]/vendor/bundle/ruby/2.2.0/bin/unicorn -> **<main>**

Environment

REMOTE_ADDR: 10.231.195.45
REQUEST_METHOD: POST
REQUEST_PATH: /phone_call_completions.xml
PATH_INFO: /phone_call_completions.xml
REQUEST_URI: /phone_call_completions.xml
SERVER_PROTOCOL: HTTP/1.1
HTTP_VERSION: HTTP/1.1
HTTP_HOST: chibi.herokuapp.com
HTTP_CONNECTION: close
HTTP_ACCEPT_ENCODING: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
HTTP_ACCEPT: */*
HTTP_USER_AGENT: Ruby
HTTP_AUTHORIZATION: Basic cGhvbnk6Ym9ub3NhcmlzMDcwMQ==
CONTENT_TYPE: application/x-www-form-urlencoded
HTTP_X_REQUEST_ID: ce2c2879-d19f-4c9b-8e7d-9e3865509049
HTTP_X_FORWARDED_FOR: 184.72.184.133
HTTP_X_FORWARDED_PROTO: https
HTTP_X_FORWARDED_PORT: 443
HTTP_VIA: 1.1 vegur
HTTP_CONNECT_TIME: 6
HTTP_X_REQUEST_START: 1433213315964
HTTP_TOTAL_ROUTE_TIME: 0
CONTENT_LENGTH: 146
rack_url_scheme: https
SERVER_NAME: chibi.herokuapp.com
SERVER_PORT: 443
QUERY_STRING:
rack_hijack: #
rack_multiprocess: true
rack_multithread: false
rack_run_once: false
rack_version: ["1", "2"]
SCRIPT_NAME:
SERVER_SOFTWARE: Unicorn 4.8.3
rack_hijack?: true
rack_logger: #
ORIGINAL_FULLPATH: /phone_call_completions.xml
ORIGINAL_SCRIPT_NAME:
action_dispatch_parameter_filter: ["password"]
action_dispatch_redirect_filter: []
action_dispatch_show_exceptions: true
action_dispatch_show_detailed_exceptions: false
action_dispatch_cookies_serializer: json
action_dispatch_cookies_digest:
ROUTES_69972627940300_SCRIPT_NAME:
rack_request_form_hash: {"From"=>"+85587538974", "To"=>"+2441", "CallSid"=>"2da23905-f6aa-4862-9b09-ee8694130e57", "CallStatus"=>"no-answer", "ApiVersion"=>"adhearsion-twilio-0.0.1", "CallDuration"=>"3"}
rack_request_form_input: #
action_dispatch_request_id: ce2c2879-d19f-4c9b-8e7d-9e3865509049
action_dispatch_remote_ip: 184.72.184.133
action_dispatch_request_content_type: application/x-www-form-urlencoded
action_dispatch_request_path_parameters: {"format"=>"xml", "controller"=>"phone_call_completions", "action"=>"create"}
action_dispatch_request_request_parameters: {"From"=>"+85587538974", "To"=>"+2441", "CallSid"=>"2da23905-f6aa-4862-9b09-ee8694130e57", "CallStatus"=>"no-answer", "ApiVersion"=>"adhearsion-twilio-0.0.1", "CallDuration"=>"3"}
rack_request_query_string:
rack_request_query_hash:
action_dispatch_request_query_parameters:
action_dispatch_request_parameters: {"From"=>"+85587538974", "To"=>"+2441", "CallSid"=>"2da23905-f6aa-4862-9b09-ee8694130e57", "CallStatus"=>"no-answer", "ApiVersion"=>"adhearsion-twilio-0.0.1", "CallDuration"=>"3", "format"=>"xml", "controller"=>"phone_call_completions", "action"=>"create"}
action_dispatch_request_formats: ["application/xml"]
dwilkie commented 9 years ago

Move this into background task so it will be automatically retried