Bug 1113684
Summary: | Removing a product, after removing a published version of a CV causes hanging on CV main page | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Corey Welton <cwelton> |
Component: | Configuration Management | Assignee: | Partha Aji <paji> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.0.3 | CC: | bbuckingham, bkearney, jmontleo, mmccune, paji |
Target Milestone: | Unspecified | ||
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/6409 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-09-11 12:28:01 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Corey Welton
2014-06-26 15:57:51 UTC
Proper repro: 1. Sync RHEL content and a custom product ("myproduct") with one or two repos. 2. Associate all of these in a CV, publish, promote, etc. 3. Remove a version of published content from CV 3. Remove "myproduct" via bulk actions. 4. Return to CV page. Note: trying to list CV from cli doesn't work. [root@cloud-qe-12 foreman]# hammer content-view list --organization cswiiitestorg undefined method `redhat?' for nil:NilClass Nor does removing (assuming user could remember the CV name anyway since list doesn't work) [root@cloud-qe-12 foreman]# hammer content-view remove --name goog --organization cswiiitestorg Could not remove objects from content view: undefined method `redhat?' for nil:NilClass fwiw, a rake is totally hosed after this, even after removing orphans (which has a "nice" side-effect of removing all CVs across all orgs). Created redmine issue http://projects.theforeman.org/issues/6409 from this bug The basic bug is that the Bulk products delete has not been updated to the dynflow code. While that bug is yet to be fixed, here is the work around or hack... This system had repositories that basically pointed to non existent products. 1) Identify which repo is bad. This can be done manually looping through each repo and trying to figure out which repo has redhat? or running the following sql script either via foreman-rake console or psql. "select product_id from katello_repositories where product_id not in (select id from katello_products)" . That should give you the list of bad repos 2) Create a new custom product in the same org as the repos via the UI or API. This product is meant to be deleted later. 3) Get the product id of the new product (you should be able to get it from the products url or product info cli). 4) Run the following in psql, UPDATE "katello_repositories" SET "product_id" = <product_id>, "updated_at" = '2014-06-26 20:09:16.307216' WHERE "katello_repositories"."id" in (select id from katello_repositories where product_id not in (select id from katello_products)) 5) Now the redhat? errors will not show up when you go to the page. 6) You can navigate to the product page and safely delete the product. https://github.com/Katello/katello/pull/4355 should fix this issue. Moving to POST since upstream bug http://projects.theforeman.org/issues/6409 has been closed Failing this :( After following the steps in comment #1 -- removing a published view, specifically -- i now get the following (particularly outdated?) message. An error occurred removing the Products: Repository cannot be deleted since it has already been promoted. Using a changeset, please delete the repository from existing environments before deleting it. First off, we shouldn't be seeing references to 'changesets' anymore. This should be a separate bug. This message occurs when you remove a CV publish version but don't click the "remove all" checkbox. The end result is user gets error message above ^ .... but product does in fact get removed! There is some sort of goo going on in dynflow too, which Partha has seen. Since the overarching scope of this bz was to fix the CV interfacing with dynflow (as opposed to, say, just making sure the CV page works), jsherrill has suggested I fail this bz. Version used above: Satellite-6.0.3-RHEL-6-20140702.0 So the bug in Dr Welton's case is that the product did not actually get removed from the database. Instead it just got deleted from elastic search. From what I gather "foreman-rake katello:reindex" fixed it. I have filed a redmine issue on this (since I couldnt reopen the linked one) -> http://projects.theforeman.org/issues/6513 will soon have a PR on this. Moving this to ON_QA since https://bugzilla.redhat.com/show_bug.cgi?id=1116933 should bve addressed this. Verified per bug #1116933 This was delivered with Satellite 6.0 which was released on 10 September 2014. |