Project

General

Profile

Actions

Bug #23415

closed

Clear taxable_taxonomies created by audit records on taxonomy deletion

Added by Kavita Gaikwad almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Fixed in Releases:
Found in Releases:

Description

Description:

Error:
Katello::OrganizationTestDelete#test_org_being_deleted:
ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: update or delete on table "taxonomies" violates foreign key constraint "taxable_taxonomies_taxonomy_id_fk" on table "taxable_taxonomies"
DETAIL: Key (id)=(61304186) is still referenced from table "taxable_taxonomies".
: DELETE FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."id" = $1
foreman-tasks (0.13.0) app/models/foreman_tasks/concerns/action_triggering.rb:35:in `block in destroy'
foreman-tasks (0.13.0) app/models/foreman_tasks/concerns/action_triggering.rb:121:in `dynflow_task_wrap'
foreman-tasks (0.13.0) app/models/foreman_tasks/concerns/action_triggering.rb:35:in `destroy'
/var/lib/workspace/workspace/katello-pr-test/app/models/katello/concerns/organization_extensions.rb:114:in `destroy!'
/var/lib/workspace/workspace/katello-pr-test/test/models/organization_test.rb:15:in `test_org_being_deleted'

Explanation on above error:
- For many resources, we have added audited which covers all CURD actions.
- Though we already added taxable_taxonomies :dependent => :destroy, when we try to destroy any taxonomy, it tries to destroy all dependent resources.
And which leads to many more audit records.
- These audit records creation occured after the deletion of existing taxable_taxonomies by :dependent => :destroy.
- For these audit records, taxable_taxonomies records get created which needs to be clear before taxonomy destroy.


Related issues 1 (0 open1 closed)

Blocks Katello - Feature #22690: [Audit] Add audit to more Katello resources - Content-view, Repository, Lifecycle environment and their associationsClosedKavita Gaikwad02/26/2018Actions
Actions #1

Updated by Kavita Gaikwad almost 6 years ago

  • Related to Feature #22690: [Audit] Add audit to more Katello resources - Content-view, Repository, Lifecycle environment and their associations added
Actions #2

Updated by Kavita Gaikwad almost 6 years ago

  • Related to deleted (Feature #22690: [Audit] Add audit to more Katello resources - Content-view, Repository, Lifecycle environment and their associations)
Actions #3

Updated by Kavita Gaikwad almost 6 years ago

  • Blocks Feature #22690: [Audit] Add audit to more Katello resources - Content-view, Repository, Lifecycle environment and their associations added
Actions #4

Updated by The Foreman Bot almost 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5502 added
Actions #5

Updated by Marek Hulán almost 6 years ago

  • translation missing: en.field_release set to 330

setting the 1.18 as this is required so other plugins can use the feature from 1.18, please let me know if there is a concern, but the patch is extremely safe to cherry-pick

Actions #6

Updated by The Foreman Bot almost 6 years ago

  • Pull request https://github.com/theforeman/foreman/pull/5505 added
Actions #7

Updated by Kavita Gaikwad almost 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF