Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1426685

Summary: subscription-manager doesn't log errors when repository enabling failed.
Product: Red Hat Enterprise Linux 6 Reporter: Gennadii Altukhov <galtukho>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED WONTFIX QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: medium    
Version: 6.8CC: csnyder, jhnidek, khowell, mkolaja, redakkan, skallesh, toneata
Target Milestone: rcKeywords: Triaged
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: 2019-07-03 12:28:38 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:
Bug Depends On:    
Bug Blocks: 1415099    

Description Gennadii Altukhov 2017-02-24 15:27:28 UTC
Description of problem:
We're using the subscription-manager in a script to enable repositories. If enabling is failed there is nothing in /var/log/rhsm/rhsm.log

Version-Release number of selected component (if applicable):
subscription-manager-1.16.8-8.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. [root@ibm-x3650m4-03-vm09 mnt]# /usr/bin/subscription-manager repos --enable='rhel-?-dummy-repo'
Error: rhel-?-dummy-repo is not a valid repository ID. Use --list option to see valid repositories.


Actual results:
nothing about the error in a /var/log/rhsm/rhsm.log

Expected results:
error message with reason why it's failed

Comment 2 Chris Snyder 2017-02-27 15:44:07 UTC
Let's ensure that there is a warning level log message describing why the repo was not enabled (in this case that the id given was invalid).

We should also return a non-zero exit code in this case.

Comment 3 Shwetha Kallesh 2018-03-15 08:39:45 UTC
Preliminary Verification:

[root@hp-moonshot-01-c05 ~]# subscription-manager  version
server type: Red Hat Subscription Management
subscription management server: 2.2.2-1
subscription management rules: 5.26
subscription-manager: 1.20.10-2.el6


[root@hp-moonshot-01-c05 ~]# subscription-manager  register --serverurl subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_tier1_test
Password: 
The system has been registered with ID: 6d76960b-731d-4ee9-9dc6-7c9183b87aa1
The registered system name is: hp-moonshot-01-c05.ml3.eng.bos.redhat.com
Error updating system data on the server, see /var/log/rhsm/rhsm.log for more details.
[root@hp-moonshot-01-c05 ~]# /usr/bin/subscription-manager repos --enable='rhel-?-dummy-repo'
Error: 'rhel-?-dummy-repo' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.
[root@hp-moonshot-01-c05 ~]# echo $?
1


[root@hp-moonshot-01-c05 ~]# tail -f /var/log/rhsm/rhsm.log | grep "rhel-?-dummy-repo"
2018-03-15 04:37:21,423 [WARNING] subscription-manager:8167:MainThread @managercli.py:2078 - 'rhel-?-dummy-repo' does not match a valid repository ID.

Comment 7 Red Hat Bugzilla 2023-09-14 03:54:20 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days