Bug 1650323
| Summary: | dnf subcommand for profile uploads | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Partha Aji <paji> |
| Component: | subscription-manager | Assignee: | Jiri Hnidek <jhnidek> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.0 | CC: | cdonnell, csnyder, jhnidek, jsefler, liliu, nmoumoul, paji, qianzhan, sgao |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.0 | ||
| 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-06-14 01:31:26 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: | 1630942 | ||
|
Description
Partha Aji
2018-11-15 20:47:25 UTC
Partha/Jiri, Could one of you clarify what it is that I should be testing here? Is this going to be in regard to the `dnf uploadprofile` sub-command? Also, is this going to be Satellite 6 specific? Thanks. Craig, This is something that hosted will eventually support, though the intended use is with Satellite. This bug is regarding the dnf uploadprofile subcommand. I think what should be tested here is essentially as follows: 1) When registered to Satellite 6.5 with the report_package_profile setting set to '1' in /etc/rhsm/rhsm.conf, run `dnf uploadprofile` This should exit with a good exit status and should start an errata applicability calculation job on Satellite. If you capture the json this should include 3 profiles. One for the rpms installed on the system, one for the modules installed on the system and a final one describing which repositories are enabled for the system. All this data should be PUT to <hostname_of_satellite>/rhsm/consumers/<consumer_uuid>/profiles. 2) When registered to a Satellite 6.4 with the report_package_profile setting set to '1' in /etc/rhsm/rhsm.conf, run `dnf uploadprofile` This should exit with a good exit status and should start an errata applicability calculation job on Satellite. If you capture the json this should include just ONE profile, the RPM profile. This data should be PUT to <hostname_of_satellite>/rhsm/consumers/<consumer_uuid>/packages. Until hosted supports this if you were to register to hosted, the expected outcome is essentially the same as case #2 above. This bug failed on both Satellite 6.4 and Satellite 6.5, please check following steps:
Satellite 6.4:
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.7.0.42-Unknown
subscription management rules: 5.26
subscription-manager: 1.23.8-14.el8
tfm-rubygem-katello-3.7.0.42-2.el7sat.noarch
katello-3.7.0-8.el7sat.noarch
candlepin-2.4.8-1.el7.noarch
1, register and auto attach, set report_package_profile = [1]
# subscription-manager register --auto-attach
# subscription-manager identity
system identity: 47d5d471-4e1e-49ce-be73-2d815fecf6b5
name: kvm-01-guest05.rhts.eng.tlv.redhat.com
org name: Default Organization
org ID: Default_Organization
environment name: Library
# subscription-manager config | grep package
package_profile_on_trans = [0]
report_package_profile = [1]
2, run dnf uploadprofile, check exit status, rhsm.log and candlepin.log
# dnf uploadprofile
Updating Subscription Management repositories.
Package profile updates
status: 1
updates: []
exceptions:
# echo $?
0
in /var/log/rhsm/rhsm.log, it did show "PUT /rhsm/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/packages"
...
2019-01-18 10:47:18,731 [INFO] dnf:22892:MainThread @connection.py:926 - Connection built: host=ent-01-vm-01.lab.eng.nay.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2019-01-18 10:47:18,732 [INFO] dnf:22892:MainThread @connection.py:926 - Connection built: host=ent-01-vm-01.lab.eng.nay.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2019-01-18 10:47:21,645 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/certificates/serials"
2019-01-18 10:47:21,646 [INFO] dnf:22892:MainThread @entcertlib.py:131 - certs updated:
Total updates: 0
Found (local) serial# [75305173382616646]
Expected (UEP) serial# [75305173382616646]
Added (new)
<NONE>
Deleted (rogue):
<NONE>
2019-01-18 10:47:24,441 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/status"
2019-01-18 10:47:27,227 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/"
2019-01-18 10:47:30,004 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/content_overrides"
2019-01-18 10:47:30,012 [INFO] dnf:22892:MainThread @repolib.py:464 - repos updated: Repo updates
Total repo updates: 1
Updated
b'[id:rhel-8-for-x86_64-baseos-htb-rpms Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)]'
Added (new)
<NONE>
Deleted
<NONE>
2019-01-18 10:47:30,019 [INFO] dnf:22892:MainThread @connection.py:926 - Connection built: host=ent-01-vm-01.lab.eng.nay.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2019-01-18 10:47:32,765 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/"
2019-01-18 10:47:40,437 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/status"
2019-01-18 10:47:46,441 [INFO] dnf:22892:MainThread @connection.py:638 - Response: status=200, request="PUT /rhsm/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/packages"
...
in /var/log/candlepin/candlepin.log
...
2019-01-18 04:00:47,198 [thread=http-bio-8443-exec-8] [req=d618f943-f929-4ba0-98b6-4ff287012c84, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/certificates/serials
2019-01-18 04:00:47,245 [thread=http-bio-8443-exec-8] [req=d618f943-f929-4ba0-98b6-4ff287012c84, org=Default_Organization, csid=] INFO org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=47
2019-01-18 04:00:50,019 [thread=http-bio-8443-exec-1] [req=8e05f8fd-681f-4c3c-bfad-2afb7a99e83f, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/status
2019-01-18 04:00:50,023 [thread=http-bio-8443-exec-1] [req=8e05f8fd-681f-4c3c-bfad-2afb7a99e83f, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=4
2019-01-18 04:00:55,613 [thread=http-bio-8443-exec-6] [req=656e6700-fe94-4a4b-a8dd-1d4f3621215b, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/content_overrides
2019-01-18 04:00:55,622 [thread=http-bio-8443-exec-6] [req=656e6700-fe94-4a4b-a8dd-1d4f3621215b, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=9
2019-01-18 04:01:06,161 [thread=http-bio-8443-exec-2] [req=cb003513-06da-47ad-b70d-1f93b6b39dcf, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/status
2019-01-18 04:01:06,164 [thread=http-bio-8443-exec-2] [req=cb003513-06da-47ad-b70d-1f93b6b39dcf, org=, csid=] INFO org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=3
2019-01-18 04:01:11,645 [thread=http-bio-8443-exec-4] [req=2226bd92-0e5d-455b-b259-21aa02e93c39, org=, csid=f7a0a20b] INFO org.candlepin.common.filter.LoggingFilter - Request: verb=GET, uri=/candlepin/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5
2019-01-18 04:01:11,717 [thread=http-bio-8443-exec-4] [req=2226bd92-0e5d-455b-b259-21aa02e93c39, org=Default_Organization, csid=f7a0a20b] INFO org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=72
...
3, however Satellite server do not have json data "packages"
# curl --stderr /dev/null https://ent-01-vm-01.lab.eng.nay.redhat.com/rhsm/consumers/47d5d471-4e1e-49ce-be73-2d815fecf6b5/packages
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
....
Satellite 6.5:
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.7.0.42-Unknown
subscription management rules: 5.26
subscription-manager: 1.23.8-14.el8
tfm-rubygem-katello-3.10.0.9-1.el7sat.noarch
katello-3.10.0-0.6.rc1.el7sat.noarch
candlepin-2.5.8-1.el7.noarch
1, register and auto attach, set report_package_profile = [1]
# subscription-manager register --auto-attach
# subscription-manager identity
system identity: 9135eb1a-c002-4781-9388-6d8644e10e2d
name: kvm-01-guest05.rhts.eng.tlv.redhat.com
org name: Default Organization
org ID: Default_Organization
environment name: Library
# subscription-manager config | grep package
package_profile_on_trans = [0]
report_package_profile = [1]
2, run dnf uploadprofile, check exit status, rhsm.log
# dnf uploadprofile
Updating Subscription Management repositories.
Package profile updates
status: 1
updates: []
exceptions:
# echo $?
0
in /var/log/rhsm/rhsm.log, it shows "PUT /rhsm/consumers/9135eb1a-c002-4781-9388-6d8644e10e2d/profiles"
...
2019-01-18 11:07:55,433 [INFO] dnf:24656:MainThread @connection.py:926 - Connection built: host=ent-01-vm-02.lab.eng.nay.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2019-01-18 11:07:55,434 [INFO] dnf:24656:MainThread @connection.py:926 - Connection built: host=ent-01-vm-02.lab.eng.nay.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2019-01-18 11:07:58,307 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/consumers/9135eb1a-c002-4781-9388-6d8644e10e2d/certificates/serials"
2019-01-18 11:07:58,308 [INFO] dnf:24656:MainThread @entcertlib.py:131 - certs updated:
Total updates: 0
Found (local) serial# [7883612337361120500]
Expected (UEP) serial# [7883612337361120500]
Added (new)
<NONE>
Deleted (rogue):
<NONE>
2019-01-18 11:08:01,086 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/status"
2019-01-18 11:08:03,858 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/"
2019-01-18 11:08:06,652 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/consumers/9135eb1a-c002-4781-9388-6d8644e10e2d/content_overrides"
2019-01-18 11:08:06,656 [INFO] dnf:24656:MainThread @repolib.py:464 - repos updated: Repo updates
Total repo updates: 0
Updated
<NONE>
Added (new)
<NONE>
Deleted
<NONE>
2019-01-18 11:08:06,662 [INFO] dnf:24656:MainThread @connection.py:926 - Connection built: host=ent-01-vm-02.lab.eng.nay.redhat.com port=443 handler=/rhsm auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2019-01-18 11:08:09,429 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/"
2019-01-18 11:08:12,441 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/status"
2019-01-18 11:08:17,157 [INFO] dnf:24656:MainThread @connection.py:638 - Response: status=200, request="PUT /rhsm/consumers/9135eb1a-c002-4781-9388-6d8644e10e2d/profiles"
...
3, however Satellite server do not have json data "profiles", nor "packages"
# curl --stderr /dev/null https://ent-01-vm-02.lab.eng.nay.redhat.com/rhsm/consumers/9135eb1a-c002-4781-9388-6d8644e10e2d/profiles
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
....
# curl --stderr /dev/null https://ent-01-vm-02.lab.eng.nay.redhat.com/rhsm/consumers/9135eb1a-c002-4781-9388-6d8644e10e2d/packages
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
To verify on Sat 6.4. 1) Pick a few packages to verify (you can dnf install screen or something that is not in the base - not necessary on new systems who's package profiles haven't gotten uploaded yet). 2) Run the following command on satellite using the hostname # hammer package list --host=<hostname> | grep <package> This should match To verify on Sat 6.5. 0) repeat the steps for 6.4 1) Assuming you have rhel8 consumer. Pick a few module to verify (you can dnf module install nodejs - not necessary on new systems who's package profiles haven't gotten uploaded yet). 2) Run the following command on satellite using the hostname # hammer module-stream list --hosts=<hostname> | grep <module stream> Hi Partha, thanks for your info. For Satellite 6.4, it always return nothing when running # hammer package list --host=<hostname> | grep <package> as follows:
# hammer package list --host=ibm-x3650m4-01-vm-08.lab.eng.bos.redhat.com
---|----------|-----------
ID | FILENAME | SOURCE RPM
---|----------|-----------
And I found #hammer host package list --host=<hostname> | grep <package> can list packages installed, is it OK to verify this bug with this command, please check following steps, thanks.
Satellite 6.4:
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.7.0.42-Unknown
subscription management rules: 5.26
subscription-manager: 1.23.8-14.el8
1, register and auto attach, set report_package_profile = [1]
# subscription-manager register --auto-attach
# subscription-manager config | grep package
package_profile_on_trans = [0]
report_package_profile = [1]
2, enable repo rhel-8-for-x86_64-baseos-htb-rpms in satellite server and sync it, install one package (eg. zsh)
# dnf install -y zsh
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs) 979 kB/s | 12 MB 00:12
Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs) 434 kB/s | 6.5 MB 00:15
Last metadata expiration check: 0:00:07 ago on Tue 22 Jan 2019 05:04:18 AM EST.
Dependencies resolved.
===================================================================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================================================================
Installing:
zsh x86_64 5.5.1-6.el8 rhel-8-for-x86_64-baseos-htb-rpms 2.9 M
Transaction Summary
===================================================================================================================================================================================================================
Install 1 Package
...
Installed:
zsh-5.5.1-6.el8.x86_64
Complete!
3, before running # dnf uploadprofile, package is not listed in server, after then it is listed
# hammer host package list --host=ibm-x3650m4-01-vm-08.lab.eng.bos.redhat.com | grep zsh
# dnf uploadprofile
Updating Subscription Management repositories.
Package profile updates
status: 1
updates: []
exceptions:
# hammer host package list --host=ibm-x3650m4-01-vm-08.lab.eng.bos.redhat.com | grep zsh
zsh-5.5.1-6.el8.x86_64
Note: # hammer package list always return nothing before or after running # dnf uploadprofile
# hammer package list --host=ibm-x3650m4-01-vm-08.lab.eng.bos.redhat.com
---|----------|-----------
ID | FILENAME | SOURCE RPM
---|----------|-----------
4, check /var/lib/rhsm/cache/profile.json to see what subscription manager sends to satellite
# cat /var/lib/rhsm/cache/profile.json | python3 -m json.tool | grep -B 10 -A 10 zsh
},
{
"name": "acl",
"version": "2.2.53",
"release": "1.el8",
"arch": "x86_64",
"epoch": 0,
"vendor": "Red Hat, Inc."
},
{
"name": "zsh",
"version": "5.5.1",
"release": "6.el8",
"arch": "x86_64",
"epoch": 0,
"vendor": "Red Hat, Inc."
},
{
"name": "man-db",
"version": "2.7.6.1",
"release": "17.el8",
1) hammer host package list is accurate. Good catch Or you can try curl -X GET -s -k -u admin:<passwd> 'https://localhost/api/v2/hosts/<host_id>/packages 2) For modules though we don't have a hammer call available. curl -X GET -s -k -u admin:<passwd> 'https://localhost/api/v2/hosts/<host_id>/module_streams In both cases you should be able to get the host_id information from hammer host list|grep <hostname> or hammer host info --name=<hostname> module_streams do not work on satellite 6.5 yet, "https://localhost/api/v2/hosts/<host_id>/module_streams" return nothing after running "dnf uploadprofile", actually it has the same behavior like satellite 6.4 in Comment 8, please check following steps: Satellite 6.5: katello-3.10.0-0.6.rc1.el7sat.noarch candlepin-2.5.8-1.el7.noarch # subscription-manager version server type: Red Hat Subscription Management subscription management server: 3.10.0.15-Unknown subscription management rules: 5.30 subscription-manager: 1.23.8-14.el8 1, register and auto attach, set report_package_profile = [1] # subscription-manager register --auto-attach # subscription-manager config | grep package package_profile_on_trans = [0] report_package_profile = [1] 2, enable repo rhel-8-for-x86_64-baseos-htb-rpms in satellite server and sync it, install one package (eg. zsh) # dnf install -y zsh ... Installed: zsh-5.5.1-6.el8.x86_64 Complete! 3, before running "dnf uploadprofile", package is not listed in server, after then listed # curl -X GET -s -k -u admin:admin 'https://ent-01-vm-02.lab.eng.nay.redhat.com/api/v2/hosts/4/packages?per_page=1000' | python3 -m json.tool | grep zsh # dnf uploadprofile Updating Subscription Management repositories. Package profile updates status: 1 updates: [] exceptions: # curl -X GET -s -k -u admin:admin 'https://ent-01-vm-02.lab.eng.nay.redhat.com/api/v2/hosts/4/packages?per_page=1000' | python3 -m json.tool | grep -B 3 -A 3 zsh }, { "id": 1129, "name": "zsh", "nvrea": "zsh-5.5.1-6.el8.x86_64", "nvra": "zsh-5.5.1-6.el8.x86_64" } ] Note: module_streams return nothing after running "dnf uploadprofile" # curl -X GET -s -k -u admin:admin 'https://ent-01-vm-02.lab.eng.nay.redhat.com/api/v2/hosts/4/module_streams' | python3 -m json.tool { "total": 0, "subtotal": 0, "page": 1, "per_page": 20, "error": null, "search": null, "sort": { "by": "name", "order": "asc" }, "results": [] } 4, check /var/lib/rhsm/cache/profile.json to see what subscription manager sends to satellite # cat /var/lib/rhsm/cache/profile.json | python3 -m json.tool | grep -B 10 -A 10 zsh }, { "name": "gpg-pubkey", "version": "2fa658e0", "release": "45700c69", "arch": null, "epoch": 0, "vendor": null }, { "name": "zsh", "version": "5.5.1", "release": "6.el8", "arch": "x86_64", "epoch": 0, "vendor": "Red Hat, Inc." }, { "name": "restraint-rhts", "version": "0.1.36", "release": "1.git.2.4e1c859.el8", In Comment 10, after enable and sync several repos on Satellite 6.5 server, I tried to "dnf module install <package>", but "No matching Modules to list" # subscription-manager repos --list +----------------------------------------------------------+ Available Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ Repo ID: rhel-8-for-x86_64-appstream-htb-source-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (Source RPMs) Repo URL: https://ent-01-vm-01.lab.eng.nay.redhat.com/pulp/repos/Default_Organization/Library/content/htb/rhel8/8/x86_64/appstream/source/SRPMS Enabled: 1 Repo ID: rhel-8-for-x86_64-baseos-htb-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs) Repo URL: https://ent-01-vm-01.lab.eng.nay.redhat.com/pulp/repos/Default_Organization/Library/content/htb/rhel8/8/x86_64/baseos/os Enabled: 1 # dnf module list Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (Source RPMs) 1.0 kB/s | 2.5 kB 00:02 Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs) 998 B/s | 2.5 kB 00:02 No matching Modules to list VERIFIED from the plugin side + sat 6.5 API:
To verify this, I installed a module (postgresql 10 - as default stream) from download.devel appstream repo, prior to registering to sgao's sat 6.5.
The reason his test failed was because he does not have the Standard AppStream RPMs repository synced, so there are no Modules available from the Satellite itself.
Regardless, the plugin does upload the proper profile - and the Satellite does display the state of this module on the profile of the system/content-host.
[root@unused cache]# rpm -q dnf-plugin-subscription-manager
dnf-plugin-subscription-manager-1.23.8-14.el8.x86_64
[root@unused cache]# pwd
/var/lib/rhsm/cache
[root@unused cache]# /usr/libexec/platform-python -m json.tool profile.json | grep postgres -B10 -A10 | grep 820190104140132 -B3 -A13
{
"name": "postgresql",
"stream": "10",
"version": "820190104140132",
"context": "9edba152",
"arch": "x86_64",
"profiles": [
"client",
"server"
],
"installed_profiles": [
"server"
<snip>
[root@unused cache]# curl -X GET -s -k -u admin:admin 'https://ent-01-vm-02.lab.eng.nay.redhat.com/api/v2/hosts/8/module_streams?per_page=100' | /usr/libexec/platform-python -m json.tool | grep postgres -B4 -A3 | grep 10\"$ -A1 -B15
"installed_profiles": [
"server"
],
"upgradable": false,
"name": "postgresql",
"stream": "10",
"module_spec": "postgresql:10"
},
Since this bug is specific to RHEL 8, I am marking this as verified - the testing of hammer ouput is non-specific to subscription-manager, and our piece appears to be working as expected for packages and modules.
|