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:
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Created attachment 922872 [details] Foreman-debug from satellite.rhsat.rdu.salab.redhat.com
Created redmine issue http://projects.theforeman.org/issues/6915 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/6915 has been closed ------------- Justin Sherrill Applied in changeset commit:katello|a91ee65677d57dea81bb34a6ede6c11e176fe015.
I do not understand what is the steps to reproduce here (how did you got to the state that although activation_key id=4 does not exist that foreman rake command complains about it?) but due to state of the release doing just basic sanity test. VERIFIED on Satellite-6.0.4-RHEL-6-20140829.0 [root@ibm-x3250m4-13 ~]# hammer -u admin -p changeme activation-key list --organization Default_Organization ---|-----------|----------|-----------------------|-------------------------- ID | NAME | CONSUMED | LIFECYCLE ENVIRONMENT | CONTENT VIEW ---|-----------|----------|-----------------------|-------------------------- 1 | bz1125023 | 0 of | Library | Default Organization View ---|-----------|----------|-----------------------|-------------------------- [root@ibm-x3250m4-13 ~]# foreman-rake katello:clean_backend_objects --trace ** Invoke katello:clean_backend_objects (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute katello:clean_backend_objects [root@ibm-x3250m4-13 ~]# echo $? 0 [root@ibm-x3250m4-13 ~]# hammer -u admin -p changeme activation-key delete --name bz1125023 --organization Default_Organization Activation key deleted [root@ibm-x3250m4-13 ~]# foreman-rake katello:clean_backend_objects --trace ** Invoke katello:clean_backend_objects (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute katello:clean_backend_objects [root@ibm-x3250m4-13 ~]# echo $? 0 [root@ibm-x3250m4-13 ~]# hammer -u admin -p changeme activation-key list --organization Default_Organization No data.
This was delivered with Satellite 6.0 which was released on 10 September 2014.