Bug #6915
closedForeman-rake clean_backend_objects fails due to activation key
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1125023
Description of problem:
Running foreman-rake katello:clean_backend_objects --trace
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. foreman-rake katello:clean_backend_objects --trace
2. read error
3.
Actual results:
/opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'
caused by: (PGError) ERROR: update or delete on table "katello_systems" violates foreign key constraint "system_activation_keys_system_id_fk" on table "katello_system_activation_keys"
DETAIL: Key (id)=(4) is still referenced from table "katello_system_activation_keys".
[root@satellite ~]# hammer activation-key list --organization ACME_Corporation
---|---------------|----------------|-----------------------|-------------
ID | NAME | CONSUMED | LIFECYCLE ENVIRONMENT | CONTENT VIEW
---|---------------|----------------|-----------------------|-------------
1 | LAMP-Complete | 5 of Unlimited | Development | LAMP-Press
---|---------------|----------------|-----------------------|-------------
Expected results:
Successful run of foreman-rake katello:clean_backend_objects since activation_key id=4 does not exist.
Additional info: