Bug 1125023 - Foreman-rake clean_backend_objects fails due to activation key
Summary: Foreman-rake clean_backend_objects fails due to activation key
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Jan Hutař
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1125020
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-30 21:38 UTC by James Genus Jr.
Modified: 2019-09-25 21:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:21:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Foreman-debug from satellite.rhsat.rdu.salab.redhat.com (351.43 KB, application/x-xz)
2014-07-31 10:40 UTC, James Genus Jr.
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 6915 0 None None None 2016-04-22 16:34:41 UTC

Description James Genus Jr. 2014-07-30 21:38:35 UTC
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:

Comment 1 RHEL Program Management 2014-07-30 21:43:42 UTC
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.

Comment 3 James Genus Jr. 2014-07-31 10:40:08 UTC
Created attachment 922872 [details]
Foreman-debug from satellite.rhsat.rdu.salab.redhat.com

Comment 4 Justin Sherrill 2014-08-04 14:23:15 UTC
Created redmine issue http://projects.theforeman.org/issues/6915 from this bug

Comment 5 Bryan Kearney 2014-08-06 14:04:41 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/6915 has been closed
-------------
Justin Sherrill
Applied in changeset commit:katello|a91ee65677d57dea81bb34a6ede6c11e176fe015.

Comment 8 Jan Hutař 2014-09-02 07:32:56 UTC
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.

Comment 9 Bryan Kearney 2014-09-11 12:21:55 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.


Note You need to log in before you can comment on or make changes to this bug.