Description of problem: When user tries to install some package using dnf CLI tool on UBI container, then DNF plugin subscription-manager should not print confusing messages. Version-Release number of selected component (if applicable): [root@rhel9 ~]# subscription-manager version # version from host server type: Red Hat Subscription Management subscription management server: 4.2.15-1 subscription management rules: 5.43 subscription-manager: 1.29.33.1-1.el9_2 How reproducible: 100% Steps to Reproduce: 1. Get UBI image [user@rhel9 ~]# podman pull registry.access.redhat.com/ubi9/ubi 2. Create container and enter interactive mode: [user@rhel9 ~]# podman run -it --name=test_ubi registry.access.redhat.com/ubi9/ubi /bin/bash 3. Try to run some dnf command (e.g. install some RPM package) [root@b29696974b21 /]# dnf install zsh Actual results: Updating Subscription Management repositories. Unable to read consumer identity <==================================================================================== Useless & confusing Subscription Manager is operating in container mode. This system is not registered with an entitlement server. You can use subscription-manager to register. <============= Useless & confusing Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 621 kB/s | 12 MB 00:19 Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 586 kB/s | 21 MB 00:37 Red Hat Universal Base Image 9 (RPMs) - BaseOS 310 kB/s | 579 kB 00:01 Red Hat Universal Base Image 9 (RPMs) - AppStream 700 kB/s | 1.9 MB 00:02 Red Hat Universal Base Image 9 (RPMs) - CodeReady Builder 117 kB/s | 190 kB 00:01 Dependencies resolved. ======================================================================================================================================================== Package Architecture Version Repository Size ======================================================================================================================================================== Installing: zsh x86_64 5.8-9.el9 rhel-9-for-x86_64-baseos-rpms 3.2 M Transaction Summary ======================================================================================================================================================== Install 1 Package Total download size: 3.2 M Installed size: 7.6 M Is this ok [y/N]: y Downloading Packages: zsh-5.8-9.el9.x86_64.rpm 697 kB/s | 3.2 MB 00:04 -------------------------------------------------------------------------------------------------------------------------------------------------------- Total 696 kB/s | 3.2 MB 00:04 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : zsh-5.8-9.el9.x86_64 1/1 Running scriptlet: zsh-5.8-9.el9.x86_64 1/1 Verifying : zsh-5.8-9.el9.x86_64 1/1 Installed products updated. Installed: zsh-5.8-9.el9.x86_64 Complete! Expected results: Updating Subscription Management repositories. Subscription Manager is operating in container mode. Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 621 kB/s | 12 MB 00:19 Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 586 kB/s | 21 MB 00:37 Red Hat Universal Base Image 9 (RPMs) - BaseOS 310 kB/s | 579 kB 00:01 Red Hat Universal Base Image 9 (RPMs) - AppStream 700 kB/s | 1.9 MB 00:02 Red Hat Universal Base Image 9 (RPMs) - CodeReady Builder 117 kB/s | 190 kB 00:01 ... Additional info: When debugging of HTTP traffic is enabled (https://www.candlepinproject.org/docs/subscription-manager/debug_http_traffic.html), then it can be observed that DNF plugin also tries to communicate with candlepin server, which only slows down DNF in this case: [root@f2628134218a /]# export SUBMAN_DEBUG_PRINT_REQUEST=1; \ export SUBMAN_DEBUG_PRINT_REQUEST_HEADER=1; \ export SUBMAN_DEBUG_PRINT_REQUEST_BODY=1; \ export SUBMAN_DEBUG_PRINT_RESPONSE=1; \ export SUBMAN_DEBUG_TCP_IP=1 [root@f2628134218a /]# dnf install zsh Updating Subscription Management repositories. Unable to read consumer identity Subscription Manager is operating in container mode. <ssl.SSLSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.0.2.100', 43544), raddr=('10.2.89.172', 443)> Making (consumer auth) request: subscription.rhsm.redhat.com:443 GET /subscription/status {'Content-type': 'application/json', 'Accept': 'application/json', 'x-subscription-manager-version': '1.29.33.1-1.el9_2', 'Accept-Language': 'en-us', 'User-Agent': 'RHSM/1.0 (cmd=dnf) subscription-manager/1.29.33.1-1.el9_2', 'Content-Length': '0'} 200 {'Server': 'openresty', 'Date': 'Fri, 09 Jun 2023 10:44:05 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'x-candlepin-request-uuid': 'b6a7890d-9d78-47b2-81d9-84304b318789', 'x-version': '4.2.15-1'} {"mode":"NORMAL","modeReason":null,"modeChangeTime":null,"result":true,"version":"4.2.15","release":"1","standalone":false,"timeUTC":"2023-06-09T10:44:02+0000","rulesSource":"default","rulesVersion":"5.43","managerCapabilities":["keycloak_auth","cloud_registration","instance_multiplier","derived_product","vcpu","cert_v3","hypervisors_heartbeat","remove_by_pool_id","syspurpose","storage_band","device_auth","cores","ssl_verify_status","multi_environment","hypervisors_async","org_level_content_access","guest_limit","ram","batch_bind","combined_reporting"],"keycloakRealm":"redhat-external","keycloakAuthUrl":"https://sso.redhat.com/auth","keycloakResource":"rhsm-api","deviceAuthRealm":"redhat-external","deviceAuthUrl":"https://sso.redhat.com/auth","deviceAuthClientId":"rhsm-api","deviceAuthScope":""}
Done-Errata