Bug 974487 - Loading manifest throws foreign key error
Loading manifest throws foreign key error
Product: Subscription Asset Manager
Classification: Red Hat
Component: katello (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: 1.3
Assigned To: Tom McKay
Tazim Kolhar
: Reopened, Triaged
Depends On:
Blocks: sam13-tracker
  Show dependency treegraph
Reported: 2013-06-14 05:17 EDT by Tazim Kolhar
Modified: 2016-04-25 20:55 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-01 06:58:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Manifest delete UI (65.47 KB, image/png)
2013-06-14 05:17 EDT, Tazim Kolhar
no flags Details
Delete Manifests (68.02 KB, image/png)
2013-07-16 02:28 EDT, Tazim Kolhar
no flags Details
Delayed Job Log (21.46 KB, text/x-log)
2013-07-16 08:34 EDT, Tazim Kolhar
no flags Details
katello-debug (88.27 KB, application/gzip)
2013-07-16 08:36 EDT, Tazim Kolhar
no flags Details
Manifest used (44.25 KB, application/zip)
2013-07-16 08:54 EDT, Tazim Kolhar
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2013:1390 normal SHIPPED_LIVE Release 1.3 of Subscription Asset Manager 2013-10-01 10:43:14 EDT

  None (edit)
Description Tazim Kolhar 2013-06-14 05:17:29 EDT
Created attachment 761183 [details]
Manifest delete UI

Description of problem:
After manifest delete, the list of subscriptions is still visible in the UI 

Version-Release number of selected component (if applicable):
# rpm -qa | grep katello

How reproducible:
# yum install -y katello-headpin-all
# katello-configure --user-pass=****

Steps to Reproduce:
1.Login to UI
2.Navigate to Content ->  Redhat Subscriptions
3.Upload the manifest
4.Delete the manifest
5.Manifest is deleted
6.But the UI is not refreshed

Actual results:
the list of subscriptions is still visible

Expected results:
After deletion no such list should be seen in UI 

Additional info:

Screen shot attached
Comment 1 RHEL Product and Program Management 2013-06-14 05:23:52 EDT
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 Justin Sherrill 2013-06-17 18:10:46 EDT
Hey Tazim,

Katello/Satellite does not support manifest deletion, only SAM/Headpin.  It looks like you have headpin installed, so I'm assuming that this was filed against the wrong product?
Comment 4 Tazim Kolhar 2013-06-18 04:01:53 EDT

   I faced this issue on a headpin nightly setup

Comment 5 Justin Sherrill 2013-06-18 08:43:19 EDT
Hey Tazim,

right that makes sense, i'm just confused why this is on the Satellite product.  I'll triage it for 6.0.2 since manifest deletion should be in it, but feel free to change the product to katello or SAM.
Comment 6 Tom McKay 2013-07-15 12:27:46 EDT
This works for me. The subscriptions are displayed until the async background task is completed in candlepin, at which point the UI is refreshed.

Please re-open if you have any further issues.
Comment 7 Tazim Kolhar 2013-07-16 02:28:24 EDT
Created attachment 774032 [details]
Delete Manifests


   I re-tested this for below rpm's :

    # rpm -qa | grep katello

    It is still failing .
Comment 8 Tom McKay 2013-07-16 07:10:53 EDT
I cannot reproduce this. Please attach katello-debug. Specifically, the delayed job log should show the problem. As I mentioned, when you select delete manifest it is run as an async job so the subscriptions will remain visible until that completes and the page refreshes.
Comment 9 Tazim Kolhar 2013-07-16 08:34:13 EDT
Created attachment 774186 [details]
Delayed Job Log
Comment 10 Tazim Kolhar 2013-07-16 08:36:08 EDT
Created attachment 774187 [details]
Comment 11 Tazim Kolhar 2013-07-16 08:54:32 EDT
Created attachment 774212 [details]
Manifest used
Comment 15 Tom McKay 2013-07-16 10:19:44 EDT
Attached manifests (private) to reproduce error in katello:

1. import manifest #1 into org 1
2. import manifest #2 into same org 1

[[31mERROR[0m [34m2013-07-16 10:13:39[0m [36mapp[0m] Error during manifest import: {"displayMessage"=>"PG::Error: ERROR:  update or delete on table \"products\" violates foreign key constraint \"marketing_engineering_products_marketing_product_id_fk\" on table \"marketing_engineering_products\"\nDETAIL:  Key (id)=(7) is still referenced from table \"marketing_engineering_products\".\n: COMMIT", "conflicts"=>["UNKNOWN"]}
[DEBUG [34m2013-07-16 10:13:39[0m [36mapp[0m] Task import manifest (4) error
[[31mERROR[0m [34m2013-07-16 10:13:39[0m [36mapp[0m] 2013-07-16T10:13:39-0400: [Worker(host:tomckay.csb pid:17348)] Provider#queue_import_manifest failed with ActiveRecord::InvalidForeignKey: PG::Error: ERROR:  update or delete on table "products" violates foreign key constraint "marketing_engineering_products_marketing_product_id_fk" on table "marketing_engineering_products"
 | DETAIL:  Key (id)=(7) is still referenced from table "marketing_engineering_products".
 | : COMMIT - 0 failed attempts
[[32m INFO[0m [34m2013-07-16 10:13:39[0m [36mapp[0m] 2013-07-16T10:13:39-0400: [Worker(host:tomckay.csb pid:17348)] PERMANENTLY removing Provider#queue_import_manifest because of 1 consecutive failures.
[[31mERROR[0m [34m2013-07-16 10:13:39[0m [36mapp[0m] PG::Error: ERROR:  update or delete on table "products" violates foreign key constraint "marketing_engineering_products_marketing_product_id_fk" on table "marketing_engineering_products"
 | DETAIL:  Key (id)=(7) is still referenced from table "marketing_engineering_products".
Comment 16 Tom McKay 2013-07-16 13:49:27 EDT
1:30 PM
Branch: refs/heads/master
  Home:   https://github.com/Katello/katello
  Commit: 3f86f7b7755c7cedef66a7ce385816646faa0d6e
  Author: Tom McKay <thomasmckay@redhat.com>
  Date:   2013-07-16 (Tue, 16 Jul 2013)
Comment 17 Bryan Kearney 2013-08-02 14:51:41 EDT
SNAP0 contains these bug fixes. Moving to ON_QA.
Comment 19 sthirugn@redhat.com 2013-08-13 14:10:59 EDT
Verified.  Manifest delete now removes the subscriptions. And the issue mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=974487#c15 here is tracked under a separate bug https://bugzilla.redhat.com/show_bug.cgi?id=996688

Package tested:
* candlepin-0.8.19-1.el6sam.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.8.19-1.el6sam.noarch
* candlepin-tomcat6-0.8.19-1.el6sam.noarch
* elasticsearch-0.19.9-8.el6sat.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-2.el6sat.noarch
* katello-cli-1.4.3-5.el6sat.noarch
* katello-cli-common-1.4.3-5.el6sat.noarch
* katello-common-1.4.3-6.el6sam_splice.noarch
* katello-configure-1.4.4-2.el6sat.noarch
* katello-glue-candlepin-1.4.3-6.el6sam_splice.noarch
* katello-glue-elasticsearch-1.4.3-6.el6sam_splice.noarch
* katello-headpin-1.4.3-6.el6sam_splice.noarch
* katello-headpin-all-1.4.3-6.el6sam_splice.noarch
* katello-selinux-1.4.4-2.el6sat.noarch
* thumbslug-0.0.32-1.el6sam.noarch
* thumbslug-selinux-0.0.32-1.el6sam.noarch
Comment 21 errata-xmlrpc 2013-10-01 06:58:05 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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