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 1309308 - User shouldn't be able to install packages after un-registering a host from content-host page
Summary: User shouldn't be able to install packages after un-registering a host from c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-17 12:37 UTC by Sachin Ghai
Modified: 2019-09-26 17:36 UTC (History)
1 user (show)

Fixed In Version: rubygem-katello-3.0.0.31-1,rubygem-katello-3.0.0.31-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:00:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
packages tab still shows options to install packages when host is unregistered (65.97 KB, image/png)
2016-02-17 12:37 UTC, Sachin Ghai
no flags Details
on installing pkg on a unregistered content-host UI raises error: Host has not been registered with subscription-manager. (62.75 KB, image/png)
2016-05-30 12:00 UTC, Sachin Ghai
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 13756 0 None None None 2016-04-22 14:58:13 UTC

Description Sachin Ghai 2016-02-17 12:37:56 UTC
Created attachment 1127930 [details]
packages tab still shows options to install packages when host is unregistered

Description of problem:
I unregistered a content-host from webUI, host was unregistered successfully and I can see a message on UI on accessing subscription and errata tab like:

This Host is not currently registered with subscription-manager. Click here for registration information.

However, packages tab is still available to install packages though host is not registered. So use should get similar message as on accessing the 'packages' tab

Version-Release number of selected component (if applicable):
foreman-release-1.11.0-0.develop.201602111150gitf6014fb.el7.noarch
katello-installer-2.5.0-1.nightly.201602120122git5f95a31.el7.noarch
katello-2.5.0-4.nightly.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. unregister a content-host
2. select content-host and goto 'packages' tab. It allows to install/removes packages
3.

Actual results:
packages tab allows to install/remove/update packages on content-host which is unregistered.

Expected results:
user should get message similar to one accessing subscription/errata tabs like:

This Host is not currently registered with subscription-manager. Click here for registration information.

Additional info:

Comment 1 Sachin Ghai 2016-02-17 12:38:30 UTC
Created redmine issue http://projects.theforeman.org/issues/13756 from this bug

Comment 3 Bryan Kearney 2016-02-17 13:04:37 UTC
Upstream bug component is Content Management

Comment 4 Bryan Kearney 2016-02-27 17:04:53 UTC
Upstream bug assigned to jsherril

Comment 5 Bryan Kearney 2016-02-27 17:04:54 UTC
Upstream bug component is Hosts

Comment 6 Sachin Ghai 2016-03-07 10:09:26 UTC
Reproducible with sat 6.2 snap2.

At first place, we host is not registered then user should get a warning message on installing package:

Like: This Host is not currently registered with subscription-manager

However, now with sat6.2 snap2, user can install package but UI throws error:

Host id '6' content facet is missing a uuid 

Also production.log throws following traceback:

2016-03-07 04:51:59 [app] [I] Started PUT "/api/v2/hosts/6/packages/install" for 10.65.193.200 at 2016-03-07 04:51:59 -0500
2016-03-07 04:51:59 [app] [I] Processing by Katello::Api::V2::HostPackagesController#install as JSON
2016-03-07 04:51:59 [app] [I]   Parameters: {"id"=>6, "packages"=>["zsh"], "api_version"=>"v2", "host_id"=>"6", "host_package"=>{"id"=>6, "packages"=>["zsh"]}}
2016-03-07 04:51:59 [app] [E] Katello::HttpErrors::NotFound: Host id '6' content facet is missing a uuid
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.4/app/controllers/katello/api/v2/host_packages_controller.rb:95:in `find_editable_host_with_facet'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:143:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:143:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'

Comment 7 Justin Sherrill 2016-05-10 19:02:16 UTC
I plan on improving the experience with:

* At unregister time, delete installed_packages list as they
  may not be accurate
* If attempting to install a package, throw a nicer warning
* UI to attempt to install a package is still there for REX
* Remove duplicate error/success messages block

Comment 8 Bryan Kearney 2016-05-11 14:12:21 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/13756 has been closed

Comment 9 Sachin Ghai 2016-05-30 11:59:48 UTC
Thanks Justin,

Verified with sat62 GA snap13
Now I see proper error on trying to install package on unregistered content-host.

Comment 10 Sachin Ghai 2016-05-30 12:00:24 UTC
Created attachment 1162789 [details]
on installing pkg on a unregistered content-host UI raises error: Host has not been registered with subscription-manager.

Comment 11 Bryan Kearney 2016-07-27 11:00:57 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/RHBA-2016:1501


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