Bug 2213340

Summary: leapp fails when proxy_scheme is missing from rhsm.conf
Product: Red Hat Enterprise Linux 7 Reporter: jcastran
Component: leapp-repositoryAssignee: Leapp Notifications Bot <leapp-notifications-bot>
Status: NEW --- QA Contact: upgrades-and-conversions
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: cbesson
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 jcastran 2023-06-07 21:08:56 UTC
If rhsm.conf is missing proxy_scheme, and a proxy is configured, leapp assumes the scheme is https. If the proxy is http, the update fails.

This example is a satellite customer so there is a backup of rhsm.conf to compare. 

~~~
# grep proxy_scheme etc/rhsm/rhsm.conf*
  etc/rhsm/rhsm.conf.rpmnew:proxy_scheme = http
# grep proxy_scheme etc/rhsm/rhsm.conf* -c
  etc/rhsm/rhsm.conf:0
  etc/rhsm/rhsm.conf.rpmnew:1


# grep ^proxy etc/rhsm/rhsm.conf
  proxy_hostname = 10.108.132.161
  proxy_port = 3128
  proxy_user =
  proxy_password =

# grep proxy etc/yum.repos.d/redhat.repo | sort -u
  proxy = http://10.108.132.161:3128
~~~


leapp is defaulting to https

~~~
# sqlite3 leapp.db 'select message_data from messages_data where context = "7d5f75e8-3c0e-4f40-a5ee-f28eaa23d50d"' | jq . | grep 10.108.132.161 -C1 | tail -n3
  "configured_proxies": [
    "https://10.108.132.161:3128"
  ],
~~~


Expectation:
If proxy_scheme is missing, and a proxy is present, then we should report that and request the user correct the missing variable in /etc/rhsm/rhsm.conf