Bug 974487 - Loading manifest throws foreign key error
Summary: Loading manifest throws foreign key error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: katello
Version: 1.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 1.3
Assignee: Tom McKay
QA Contact: Tazim Kolhar
URL:
Whiteboard:
Depends On:
Blocks: sam13-tracker
TreeView+ depends on / blocked
 
Reported: 2013-06-14 09:17 UTC by Tazim Kolhar
Modified: 2016-04-26 00:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-01 10:58:05 UTC
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2013:1390 0 normal SHIPPED_LIVE Release 1.3 of Subscription Asset Manager 2013-10-01 14:43:14 UTC

Description Tazim Kolhar 2013-06-14 09:17:29 UTC
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
signo-katello-0.0.9-1.el6.noarch
katello-headpin-1.4.2-1.git.638.2148be1.el6.noarch
katello-certs-tools-1.4.2-1.el6.noarch
katello-cli-1.4.2-1.git.90.6c7a175.el6.noarch
katello-cli-common-1.4.2-1.git.90.6c7a175.el6.noarch
katello-glue-candlepin-1.4.2-1.git.638.2148be1.el6.noarch
katello-configure-1.4.3-1.git.62.f050662.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-glue-elasticsearch-1.4.2-1.git.638.2148be1.el6.noarch
katello-selinux-1.4.3-1.git.4.99dc194.el6.noarch
katello-common-1.4.2-1.git.638.2148be1.el6.noarch
katello-headpin-all-1.4.2-1.git.638.2148be1.el6.noarch
katello-repos-1.4.2-1.el6.noarch


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 Program Management 2013-06-14 09:23:52 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 Justin Sherrill 2013-06-17 22:10:46 UTC
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 08:01:53 UTC
Hi,

   I faced this issue on a headpin nightly setup


Regards,
Tazim

Comment 5 Justin Sherrill 2013-06-18 12:43:19 UTC
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 16:27:46 UTC
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 06:28:24 UTC
Created attachment 774032 [details]
Delete Manifests

Hi,

   I re-tested this for below rpm's :

    # rpm -qa | grep katello
    katello-glue-elasticsearch-1.4.2-1.git.837.d2ca1b8.el6.noarch
    signo-katello-0.0.9-1.el6.noarch
    katello-cli-common-1.4.2-1.git.121.7c18bf3.el6.noarch
    katello-common-1.4.2-1.git.837.d2ca1b8.el6.noarch
    katello-headpin-1.4.2-1.git.837.d2ca1b8.el6.noarch
    katello-certs-tools-1.4.2-1.el6.noarch
    katello-selinux-1.4.3-1.git.4.99dc194.el6.noarch
    katello-headpin-all-1.4.2-1.git.837.d2ca1b8.el6.noarch
    katello-candlepin-cert-key-pair-1.0-1.noarch
    katello-cli-1.4.2-1.git.121.7c18bf3.el6.noarch
    katello-configure-1.4.3-1.git.67.f71e590.el6.noarch
    katello-glue-candlepin-1.4.2-1.git.837.d2ca1b8.el6.noarch
    katello-repos-1.4.2-1.el6.noarch


    It is still failing .
Regards,
Tazim

Comment 8 Tom McKay 2013-07-16 11:10:53 UTC
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 12:34:13 UTC
Created attachment 774186 [details]
Delayed Job Log

Comment 10 Tazim Kolhar 2013-07-16 12:36:08 UTC
Created attachment 774187 [details]
katello-debug

Comment 11 Tazim Kolhar 2013-07-16 12:54:32 UTC
Created attachment 774212 [details]
Manifest used

Comment 15 Tom McKay 2013-07-16 14:19:44 UTC
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".
 | : COMMIT

Comment 16 Tom McKay 2013-07-16 17:49:27 UTC
1:30 PM
Branch: refs/heads/master
  Home:   https://github.com/Katello/katello
  Commit: 3f86f7b7755c7cedef66a7ce385816646faa0d6e
      https://github.com/Katello/katello/commit/3f86f7b7755c7cedef66a7ce385816646faa0d6e
  Author: Tom McKay <thomasmckay>
  Date:   2013-07-16 (Tue, 16 Jul 2013)

Comment 17 Bryan Kearney 2013-08-02 18:51:41 UTC
SNAP0 contains these bug fixes. Moving to ON_QA.

Comment 19 sthirugn@redhat.com 2013-08-13 18:10:59 UTC
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 10:58:05 UTC
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.

http://rhn.redhat.com/errata/RHEA-2013-1390.html


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