Bug 1744254

Summary: Unable to remove puppet module by uuid from content-view using hammer
Product: Red Hat Satellite Reporter: Lai <ltran>
Component: Content ViewsAssignee: Ian Ballou <iballou>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: sghai, zhunting
Target Milestone: 6.6.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-3.12.0.21-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 19:47:48 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 Lai 2019-08-21 16:11:33 UTC
Description of problem:
Trying to remove a puppet-module's UUID from content-view gives warning that uuid cannot be found when it clearly shows that it's present in the content-view.

Version-Release number of selected component (if applicable):
6.6.0 Snap 16

How reproducible:
100%

Steps to Reproduce:
1. Create a repo with puppet module
2. Sync repo
3. Create a content-view and add puppet module in
4. Remove puppet module using hammer command: hammer content-view puppet-module remove --content-view-id=<id> --uuid=<uuid>

Actual results:
Couldn't remove puppet module from the content view
Error: content_view_puppet_module not found.

Expected results:
Successfully remove puppet module form the content view.

Comment 3 Lai 2019-08-21 16:18:31 UTC
This is a regression issue.  Tested on 6.5.2 and it passed there.  For QE testing, just run the automation test: tests/foreman/cli/test_contentview.py::ContentViewTestCase::test_positive_remove_puppet_module_by_uuid

Comment 4 Jonathon Turel 2019-08-21 16:18:48 UTC
From the logs:

2019-08-21T11:51:21 [E|app|0d35d2fd] Invalid search: PG::UndefinedColumn: ERROR:  column katello_content_view_puppet_modules.pulp_id does not exist
LINE 1: ...t_view_puppet_modules"."content_view_id" = $1 AND "katello_c...
                                                             ^
: SELECT COUNT(DISTINCT "katello_content_view_puppet_modules"."id") FROM "katello_content_view_puppet_modules" WHERE "katello_content_view_puppet_modules"."content_view_id" = $1 AND "katello_content_view_puppet_modules"."pulp_id" = $2
2019-08-21T11:51:21 [I|app|0d35d2fd]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.9/app/views/katello/api/v2/content_view_puppet_modules/index.json.rabl within katello/api/v2/layouts/collection
2019-08-21T11:51:21 [I|app|0d35d2fd]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.9/app/views/katello/api/v2/content_view_puppet_modules/index.json.rabl within katello/api/v2/layouts/collection (1.5ms)

Comment 6 Ian Ballou 2019-08-27 18:08:55 UTC
Created redmine issue https://projects.theforeman.org/issues/27718 from this bug

Comment 7 Bryan Kearney 2019-09-03 18:06:35 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27718 has been resolved.

Comment 9 Lai 2019-09-16 21:21:19 UTC
Steps to Test:
1. Create a repo with puppet module
2. Sync repo
3. Create a content-view and add puppet module in.  (be sure to NOT select "Always use latest")
4. Remove puppet module using hammer command: hammer content-view puppet-module remove --content-view-id=<id> --uuid=<uuid>

Expected result:
Puppet module removed from content view.

Actual result:
Puppet module removed from content view.

Verified on 6.6.0 snap 20.

Marking issue as verified.

Comment 10 Bryan Kearney 2019-10-22 19:47:48 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.

https://access.redhat.com/errata/RHSA-2019:3172