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 1955480 - D-Bus method Register() do not create redhat.repo, when SCA mode is used
Summary: D-Bus method Register() do not create redhat.repo, when SCA mode is used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: beta
: 8.6
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1921131 2031835
TreeView+ depends on / blocked
 
Reported: 2021-04-30 08:21 UTC by Jiri Hnidek
Modified: 2022-05-10 16:39 UTC (History)
4 users (show)

Fixed In Version: subscription-manager-1.28.28-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2031835 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:22:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2948 0 None Merged 1955480: Backport of D-Bus registration 2022-01-28 11:29:46 UTC
Red Hat Product Errata RHBA-2022:2047 0 None None None 2022-05-10 15:23:20 UTC

Description Jiri Hnidek 2021-04-30 08:21:17 UTC
Description of problem:
When system is registered using D-Bus method Register() (Cockpit plugin or Anaconda plugin) and SCA mode is used, then calling Register() method does not populate redhat.repo with repository definitions, because SCA entitlement certificate is not obtained.


Version-Release number of selected component (if applicable):
server type: Red Hat Subscription Management
subscription management server: 3.2.11-1
subscription management rules: 5.41
subscription-manager: 1.29.5-1.git.7.a14a61b.el8

How reproducible:
100%

Steps to Reproduce:
1. Try to register system using following bash script. This script call D-Bus methods using dbus-send CLI. Note that organization snowwhite in this example uses SCA mode:


#!/bin/bash

# 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

echo "Using address: $my_addr"

# Try to register using username and password
echo "registering using username and password and org..."
dbus-send --address=${my_addr} --print-reply --dest='com.redhat.RHSM1.Register' \
        '/com/redhat/RHSM1/Register' \
        com.redhat.RHSM1.Register.Register \
        string:"snowwhite" \
        string:"admin" \
        string:"admin" \
        dict:string:string:"","" \
        dict:string:string:"","" \
        string:"" > /root/register_output.txt

if [[ $? -eq 0 ]]
then
        echo "Registration sucess"
        export registered=1
else
        echo "Registration FAILED"
        export registered=0
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


2. Check content of generated /etc/yum.repos.d/redhat.repo

[root@thinkpad-t580 subscription-manager]# cat /etc/yum.repos.d/redhat.repo 
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated.  Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#


Actual results: Empty redhat.repo file and no entitlement certificate installed in /etc/pki/entitlement


Expected results: redhat.repo file populated with definitions of repositories generated from installed SCA entitlement certificate.


Additional info:
Running following command fixes the issue. Calling AutoAttach() D-Bus method can also fix this issue, but it is strange to call auto-attach in SCA mode.

[root@thinkpad-t580 subscription-manager]# subscription-manager repos --list-enabled 
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   fake-content-38072
Repo Name: fake-content-38072
Repo URL:  http://svice:8080/path/to/fake-content/38072-3902
Enabled:   1

Repo ID:   awesomeos-deb-38070
Repo Name: awesomeos-deb-38070
Repo URL:  http://svice:8080/path/to/awesomeos-deb/38070-3901
Enabled:   1

Comment 11 errata-xmlrpc 2022-05-10 15:22:56 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-2022:2047


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