ajc113 / currents

Currents Fishing Network Application
3 stars 3 forks source link

Admin::UsersController#destroy (ActiveRecord::InvalidForeignKey) "PG::ForeignKeyViolation: ERROR: update or delete on table "users" violates foreign key constraint "fk_rails_c7699d537d" on table "reports" DETAIL: Key (id)=(15) is still referenced from table "reports". : DELETE FROM "users" WHERE "users"."id" = $1" #191

Open ajc113 opened 6 years ago

ajc113 commented 6 years ago
ExceptionPG::ForeignKeyViolation: ERROR: update or delete on table "users" violates foreign key constraint "fk_rails_c7699d537d" on table "reports" DETAIL: Key (id)=(15) is still referenced from table "reports". : DELETE FROM "users" WHERE "users"."id" = $1
Last OccurrenceApril 23, 2018 19:04:49 +0000
Count5

Stack Trace

[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:602:in `exec_prepared'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:602:in `block in exec_cache'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:601:in `exec_cache'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:585:in `execute_and_clear'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:173:in `exec_delete'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:119:in `delete'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `delete'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/relation.rb:478:in `delete_all'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:487:in `destroy_row'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/counter_cache.rb:152:in `destroy_row'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/locking/optimistic.rb:115:in `destroy_row'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:172:in `destroy'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/callbacks.rb:292:in `block in destroy'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in `call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in `call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_destroy_callbacks'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/callbacks.rb:292:in `destroy'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:281:in `block in destroy'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:220:in `transaction'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/transactions.rb:281:in `destroy'
[bundle].../bundler/gems/activeadmin-d5730a012e46/lib/active_admin/resource_controller/data_access.rb:182:in `block in destroy_resource'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/try.rb:77:in `public_send'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/try.rb:77:in `try!'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/try.rb:63:in `try'
[bundle].../bundler/gems/activeadmin-d5730a012e46/lib/active_admin/callbacks.rb:79:in `block (2 levels) in define_active_admin_callbacks'
[bundle].../bundler/gems/activeadmin-d5730a012e46/lib/active_admin/resource_controller/data_access.rb:181:in `destroy_resource'
[bundle].../gems/inherited_resources-1.8.0/lib/inherited_resources/actions.rb:58:in `destroy'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
[bundle].../gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:198:in `process_action'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
[bundle].../gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in `call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in `call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
[bundle].../gems/sentry-raven-2.7.2/lib/raven/integrations/rails/controller_transaction.rb:7:in `block in included'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:441:in `instance_exec'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:441:in `block in make_lambda'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:312:in `block in halting'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:497:in `block in around'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in `call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
[bundle].../gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/rescue.rb:29:in `process_action'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `block in instrument'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `instrument'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
[bundle].../gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:137:in `process'
[bundle].../gems/actionview-4.2.7.1/lib/action_view/rendering.rb:30:in `process'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal.rb:196:in `dispatch'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
[bundle].../gems/actionpack-4.2.7.1/lib/action_controller/metal.rb:237:in `block in action'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:43:in `serve'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in `each'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in `serve'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:817:in `call'
[bundle].../gems/party_foul-1.5.5/lib/party_foul/middleware.rb:8:in `call'
[bundle].../gems/warden-1.2.7/lib/warden/manager.rb:36:in `block in call'
[bundle].../gems/warden-1.2.7/lib/warden/manager.rb:35:in `catch'
[bundle].../gems/warden-1.2.7/lib/warden/manager.rb:35:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/etag.rb:24:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/conditionalget.rb:38:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/head.rb:13:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/session/abstract/id.rb:225:in `context'
[bundle].../gems/rack-1.6.9/lib/rack/session/abstract/id.rb:220:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/query_cache.rb:36:in `call'
[bundle].../gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
[bundle].../gems/railties-4.2.7.1/lib/rails/rack/logger.rb:38:in `call_app'
[bundle].../gems/railties-4.2.7.1/lib/rails/rack/logger.rb:20:in `block in call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:26:in `tagged'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:68:in `tagged'
[bundle].../gems/railties-4.2.7.1/lib/rails/rack/logger.rb:20:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/methodoverride.rb:22:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/runtime.rb:18:in `call'
[bundle].../gems/activesupport-4.2.7.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
[bundle].../gems/rack-cache-1.7.1/lib/rack/cache/context.rb:140:in `forward'
[bundle].../gems/rack-cache-1.7.1/lib/rack/cache/context.rb:147:in `pass'
[bundle].../gems/rack-cache-1.7.1/lib/rack/cache/context.rb:159:in `invalidate'
[bundle].../gems/rack-cache-1.7.1/lib/rack/cache/context.rb:74:in `call!'
[bundle].../gems/rack-cache-1.7.1/lib/rack/cache/context.rb:51:in `call'
[bundle].../gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/static.rb:120:in `call'
[bundle].../gems/rack-1.6.9/lib/rack/sendfile.rb:113:in `call'
[bundle].../gems/sentry-raven-2.7.2/lib/raven/integrations/rack.rb:51:in `call'
[bundle].../gems/railties-4.2.7.1/lib/rails/engine.rb:518:in `call'
[bundle].../gems/railties-4.2.7.1/lib/rails/application.rb:165:in `call'
[bundle].../gems/puma-3.11.3/lib/puma/configuration.rb:225:in `call'
[bundle].../gems/puma-3.11.3/lib/puma/server.rb:624:in `handle_request'
[bundle].../gems/puma-3.11.3/lib/puma/server.rb:438:in `process_client'
[bundle].../gems/puma-3.11.3/lib/puma/server.rb:302:in `block in run'
[bundle].../gems/puma-3.11.3/lib/puma/thread_pool.rb:120:in `block in spawn_thread'

Fingerprint: 652d29a368f276c3e1ea1bb309a369f396c2a97f