Bug 1391874

Summary: some RHSM related messages leaks to installer output and in case of "RHSM Subscriptions" issue there is no helpful message in install log
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: InstallerAssignee: Gennadii Altukhov <galtukho>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 580CC: galtukho, ggainey, ktordeur, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-19 15:01:09 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:
Bug Depends On:    
Bug Blocks: 1340444    

Description Jan Hutař 2016-11-04 09:52:45 UTC
Description of problem:
Info about attached pool or system unregistration leaks to installer output which is othervise clean and all output starts with "*" except for warnings or errors or so.

  [...]
  * RHSM Registration.
  ** Registration: System is already registered with RHSM, but --re-register option used.  Re-registering.
  System has been unregistered.
  * RHSM Subscriptions.
  Successfully attached a subscription for: Red Hat Satellite Employee Subscription
  ** Subscriptions: Subscription providing 'Red Hat Satellite' successfully attached.
  [...]

Also in case of failure (messages should be there even when working correctly) like following, there is no helpful message/error in install log:

  [...]
  ** Subscriptions: Disabling all RHSM repositories ().
  ** Subscriptions: All repositories disabled.
  ** Subscriptions: Enabling RHEL repository.
  ** Subscriptions: Enabling RHEL repository failed. Stopping installation.


Version-Release number of selected component (if applicable):
Compose from Thu Nov  3 11:00:56 EDT 2016


How reproducible:
always


Steps to Reproduce:
1. # /tmp/media.mnt-TucEaz/install.pl --answer-file=/mnt/tests/CoreOS/RHN-Satellite/Installer/Sanity/install/answers.txt --non-interactive --run-updater
[...]
* RHSM Registration.
* RHSM Subscriptions.
Successfully attached a subscription for: Red Hat Satellite Employee Subscription
** Subscriptions: Subscription providing 'Red Hat Satellite' successfully attached.
** Subscriptions: Subscription providing 'Red Hat Enterprise Linux Server' already attached.
** Subscriptions: Disabling all RHSM repositories ().
** Subscriptions: All repositories disabled.
** Subscriptions: Enabling RHEL repository.
** Subscriptions: Enabling RHEL repository failed. Stopping installation.
2. Check /var/log/rhn/rhn_installation.log


Actual results:
Messages leaked into installer output and rhn_installation.log not having any output/hints for subscribing, disabling repos and enabling base rhel repo.


Expected results:
No leaked message in output and helpful content of installation log


Additional info:
# cat /var/log/rhn/rhn_installation.log
Installation log of Red Hat Satellite
(RHEL6)
Command: /tmp/media.mnt-TucEaz/install.pl --answer-file=/mnt/tests/CoreOS/RHN-Satellite/Installer/Sanity/install/answers.txt --non-interactive --run-updater --re-register

WARNING

This system has already been registered with Red Hat using RHN Classic.

Your system is being registered again using Red Hat Subscription Management. Red Hat recommends that customers only register once.

To learn how to unregister from either service please consult this Knowledge Base Article: https://access.redhat.com/kb/docs/DOC-45563
Registering to: subscription.rhsm.redhat.com:443/subscription
The system has been registered with ID: 59d59856-880c-4245-9fb8-7bd568291805

Comment 1 Jan Hutař 2016-11-04 10:05:56 UTC
And about empty parentheses in "** Subscriptions: Disabling all RHSM repositories ().": looking into the code there is:

  my $enabled_repos = `/usr/bin/subscription-manager repos --list-enabled --list-enabled | grep "Repo ID:" | awk '{print \$3}'`;
  $enabled_repos = join(', ', split(/\n/,$enabled_repos));

There is "--list-enabled" twice, but looks like this is not a problem. Maybe we can skip disabling repos if there is none enabler to save two seconds or so?

Comment 2 Jan Hutař 2016-11-04 10:15:47 UTC
When enabling the repo, it fails on s390x, because there is this code:

  use constant RHEL_BASE_REPO_ID => 'rhel-?-server-rpms';

and later in the code that seems to be substituted by OS version, but repository for s390x is "rhel-6-for-system-z-rpms".

Tested on:

  # rpm -q --queryformat '%{version} %{release} %{epoch} %{arch}' --whatprovides redhat-release
  6Server 6.8.0.5.el6 (none) s390x

Comment 3 Jan Hutař 2016-11-04 10:27:50 UTC
Oh, another issue is that when we are attaching pools, on s390x we are checking if we have pool providing:

  use constant RHEL_PRODUCT_NAME => 'Red Hat Enterprise Linux Server';

But we should be checking for "Red Hat Enterprise Linux for IBM z Systems".

Comment 6 Jan Hutař 2017-05-11 14:42:44 UTC
*** Bug 1415099 has been marked as a duplicate of this bug. ***

Comment 7 Grant Gainey 2017-05-19 15:01:09 UTC
Reversing the sense of the DUP - 1415099 has the fix-commits

*** This bug has been marked as a duplicate of bug 1415099 ***