Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1595826

Summary: No notification and 500 ISE while disabling repository included in published content view
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: RepositoriesAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: ehelms, jomitsch, walden
Target Milestone: 6.4.0Keywords: Regression, Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.7.0.7-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:10:31 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:
Attachments:
Description Flags
screenshot of UI disable repo none

Description Nikhil Kathole 2018-06-27 14:54:50 UTC
Description of problem: While trying to disable repository which has already been included in a published Content View, no notification for user in UI and production.log shows 500 internal server error.


Version-Release number of selected component (if applicable):  Satellite 6.4 snap 9
# rpm -q satellite
satellite-6.4.0-9.beta.el7sat.noarch


How reproducible: always


Steps to Reproduce:
1. Go to content -> red hat repositories page
2. Try to disable any repo which is included in content view.


Actual results: No warning/notification in UI and log shows

GET: https://<satellite_hostname>/pulp/api/v2/users/: {"content_type"=>"application/json", "accept"=>"application/json"}
Response: 200: [{"_id": {"$oid": "5b2f5d6b2c4873df9935f858"}, "name": "admin", "roles": ["super-users"], "_ns": "users", "login": "admin", "_href": "/pulp/api/v2/users/admin/"}]
2018-06-27T10:45:53 [I|app|4c4df] Current user: admin (administrator)
2018-06-27T10:45:53 [I|aud|4c4df] destroy event for Katello::Repository with id 2
2018-06-27T10:45:53 [E|bac|4c4df] Repository cannot be deleted since it has already been included in a published Content View. Please delete all Content View versions containing this repository before attempting to delete it. (RuntimeError)
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1/app/models/katello/model.rb:8:in `destroy!'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1/app/lib/actions/katello/repository/destroy.rb:27:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/execution_plan.rb:376:in `switch_flow'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action.rb:401:in `sequence'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.rc1/app/lib/actions/katello/repository/destroy.rb:26:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action.rb:493:in `block (3 levels) in execute_plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.13.2/app/lib/actions/middleware/keep_current_user.rb:10:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.13.2/app/lib/actions/middleware/keep_current_user.rb:31


Expected results: Notification/warning with message
"Repository cannot be disabled since it has already been included in a published Content View."


Additional info:

Comment 3 Walden Raines 2018-07-19 14:33:27 UTC
Created redmine issue https://projects.theforeman.org/issues/24310 from this bug

Comment 4 Satellite Program 2018-07-20 16:20:57 UTC
Upstream bug assigned to jomitsch

Comment 5 Satellite Program 2018-07-25 18:20:53 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/24310 has been resolved.

Comment 7 Nikhil Kathole 2018-07-30 09:59:12 UTC
Version tested:
Satellite 6.4 snap 14

I see the notification appears while disabling repository included in CV

"Repository cannot be deleted since it has already been included in a published Content View. Please delete all Content View versions containing this repository before attempting to delete it."

But still production.log showed 500 ISE with long traceback. 

/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.7/app/models/katello/model.rb:8:in `destroy!'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.7/app/lib/actions/katello/repository/destroy.rb:27:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/execution_plan.rb:376:in `switch_flow'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action.rb:401:in `sequence'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.7/app/lib/actions/katello/repository/destroy.rb:26:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action.rb:493:in `block (3 levels) in execute_plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.13.3/app/lib/actions/middleware/keep_current_user.rb:10:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.13.3/app/lib/actions/middleware/keep_current_user.rb:31:in `with_current_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.13.3/app/lib/actions/middleware/keep_current_user.rb:9:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.7/app/lib/actions/middleware/remote_action.rb:9:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:26:in `pass'


Is this expected or the error needs to handle? if needs to handle, shall I open different BZ or move this to assigned?

Comment 8 John Mitsch 2018-07-30 14:27:03 UTC
Yes, this is expected. The server throws an error with the appropriate message about not being able to delete a Repository that has been included in a CV. This is propagated to the user in the notification. If you are not seeing any other errors, everything is working as expected.

Comment 9 Nikhil Kathole 2018-07-30 14:28:45 UTC
VERIFIED

Version tested:
Satellite 6.4 snap 14

Comment 10 Nikhil Kathole 2018-07-30 14:29:22 UTC
Created attachment 1471564 [details]
screenshot of UI disable repo

Comment 11 Bryan Kearney 2018-10-16 19:10:31 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-2018:2927