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 1700441

Summary: With no /etc/yum.repos.d no repo file is created after successful registration & attach, no log message or error
Product: Red Hat Enterprise Linux 8 Reporter: Martin Kolman <mkolman>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: low Docs Contact:
Priority: low    
Version: 8.1CC: csnyder, jhnidek, jsefler, jstavel, mkolman, redakkan, wpoteat
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: subscription-manager-1.27.9-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:38:37 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 Martin Kolman 2019-04-16 14:59:43 UTC
Description of problem:
On a system with no /etc/yum.repos.d subscription manager will not create the necessary repo file after successful registration and attach. There also are no log messages or errors being reported about thins anywhere as fas as I can tell.

I've did the registration & attach over DBUS, but it's likely the same wil happen when done via CLI as well.

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


How reproducible:
always

Steps to Reproduce:
1. register via DBUS
2. attach via DBUS

Actual results:
No repo file is created in /etc/yum.repos.d & there is still no such folder. No error or log message is emitted.

Expected results:
Either RHSM creates /etc/yum.repos.d and puts it's generated repo sile into the folder as expected or should at least report an error due to the expected folder not existing.

Additional info:
If /etc/yum.repos.d is maunally created before running RHSM, the repo file is correctly generated and placed into /etc/yum.repos.d as expected.

Comment 2 Martin Kolman 2019-11-26 11:42:33 UTC
So this is still happening with subscription-manager-1.26.5-1.el8 - if /etc/yum.repos.d does not exist, it will not be created and attach will fail.

Comment 7 Jan Stavel 2020-08-07 11:17:00 UTC
[root@kvm-02-guest02 rhsm-scenarios]# rpm -qa | egrep 'subscription|cockpit'

cockpit-bridge-224.1-1.el8.x86_64
subscription-manager-cockpit-1.27.11-1.el8.noarch
python3-subscription-manager-rhsm-1.27.11-1.el8.x86_64
dnf-plugin-subscription-manager-1.27.11-1.el8.x86_64
subscription-manager-1.27.11-1.el8.x86_64
cockpit-system-224.1-1.el8.noarch
subscription-manager-initial-setup-addon-1.27.11-1.el8.x86_64
subscription-manager-plugin-ostree-1.27.11-1.el8.x86_64
cockpit-ws-224.1-1.el8.x86_64
cockpit-224.1-1.el8.x86_64
subscription-manager-migration-data-2.0.51-1.noarch
cockpit-packagekit-224.1-1.el8.noarch
subscription-manager-rhsm-certificates-1.27.11-1.el8.x86_64
subscription-manager-migration-1.27.11-1.el8.x86_64


[root@kvm-02-guest02 rhsm-scenarios]# mv /etc/yum.repos.d/ /etc/yum.repos.d.orig
[root@kvm-02-guest02 rhsm-scenarios]# subscription-manager register --username jstavel_stage_demo01 --password ********

Registering to: subscription.rhsm.stage.redhat.com:443/subscription
CACHED_SYSPURPOSE: /var/lib/rhsm/cache/syspurpose.json
The system has been registered with ID: 2ebad4d3-5642-429b-9f1d-2a56082a5286
The registered system name is: kvm-02-guest02.lab.eng.rdu2.redhat.com

[root@kvm-02-guest02 rhsm-scenarios]# ls -al /etc | grep yum.repos

drwxr-xr-x.   2 root root     4096  7. srp 04.41 yum.repos.d.orig


If I use dbus call than the directory is created.

  # Create new unix socket used for registration 
  echo "starting RegisterServer..."
  dbus-send --system --print-reply --dest='com.redhat.RHSM1' \
        '/com/redhat/RHSM1/RegisterServer' com.redhat.RHSM1.RegisterServer.Start string:"" > /root/register_server_output.txt
  
  if [[ $? -eq 0 ]]
  then
        export my_addr=`cat /root/register_server_output.txt | gawk '/string/{ print $2 }' | sed 's/\"//g'`
  fi
  
  # Try to register
  echo "registering..."
  dbus-send --address=${my_addr} --print-reply --dest='com.redhat.RHSM1.Register' \
        '/com/redhat/RHSM1/Register' com.redhat.RHSM1.Register.Register string:"" string:"jstavel_stage_demo01" \
        string:"********" dict:string:string:"","" dict:string:string:"","" string:"" > /root/register_output.txt
  
  if [[ $? -eq 0 ]]
  then
        echo "Registration sucess"
  else
        echo "Registration FAILED"
  fi
  
  echo "stoping RegisterServer..."
  dbus-send --system --print-reply --dest='com.redhat.RHSM1' \
        '/com/redhat/RHSM1/RegisterServer' com.redhat.RHSM1.RegisterServer.Stop string:"" > /dev/null
  
  # Unregister
  echo "unregistering..."
  dbus-send --system --print-reply --dest='com.redhat.RHSM1' '/com/redhat/RHSM1/Unregister' \
        com.redhat.RHSM1.Unregister.Unregister dict:string:string:"","" string:"" > /dev/null


root@kvm-02-guest02 rhsm-scenarios]# ls -al /etc | grep yum.repos
drwxr-xr-x.   2 root root        6  7. srp 07.14 yum.repos.d

Comment 10 errata-xmlrpc 2020-11-04 01:38:37 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 (subscription-manager bug fix and enhancement update), 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-2020:4460