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 2177219 - [Regression] Proxy specified in kickstart through "url" stanza is not taken into account
Summary: [Regression] Proxy specified in kickstart through "url" stanza is not taken i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: anaconda
Version: 9.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Konecny
QA Contact: Release Test Team
Sagar Dubewar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-10 12:57 UTC by Renaud Métrich
Modified: 2024-01-09 11:20 UTC (History)
6 users (show)

Fixed In Version: anaconda-34.25.3.4-1.el9
Doc Type: Bug Fix
Doc Text:
.The installation program now correctly processes the `--proxy` option of the `url` Kickstart command Previously, the installation program did not correctly process the `--proxy` option of the `url` Kickstart command. As a consequence, you could not use the specified proxy to fetch the installation image. With this update, the issue is fixed and the `--proxy` option now works as expected.
Clone Of:
Environment:
Last Closed: 2023-11-07 08:31:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-151435 0 None None None 2023-03-10 12:58:06 UTC
Red Hat Issue Tracker RTT-5283 0 None None None 2023-05-02 10:46:16 UTC
Red Hat Issue Tracker RTT-5284 0 None None None 2023-05-02 10:46:21 UTC
Red Hat Issue Tracker RTT-5285 0 None None None 2023-05-02 10:46:26 UTC
Red Hat Product Errata RHBA-2023:6414 0 None None None 2023-11-07 08:32:14 UTC

Description Renaud Métrich 2023-03-10 12:57:04 UTC
Description of problem:

Specifying a proxy to fetch Stage2 was working fine with RHEL8, e.g.:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
url --url=http://localhost/rhel91 --proxy=http://192.168.122.1:3128
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Such stanza doesn't work on RHEL9 anymore, we get the following on boot:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[   16.790278] dracut-initqueue[1181]: ////lib/url-lib.sh@77(curl_fetch_url): curl --globoff --location --retry 3 --retry-connrefused --fail --show-error --remote-name http://localhost/rhel91/images/install.img
[   16.790596] dracut-initqueue[1182]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[   16.790629] dracut-initqueue[1182]:                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[   16.790680] dracut-initqueue[1182]: curl: (7) Failed to connect to localhost port 80: Connection refused
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Here above we can see `curl` didn't execute with `--proxy` argument.
The root cause for this is `curl` command, built by `lib/url-lib.sh` snippet below, relies on "proxy=" command-line variable:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
 59 curl_args="--globoff --location --retry 3 --fail --show-error"
 60 getargbool 0 rd.noverifyssl && curl_args="$curl_args --insecure"
 61 
 62 proxy=$(getarg proxy=)
 63 [ -n "$proxy" ] && curl_args="$curl_args --proxy $proxy"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Unfortunately, there is no such `proxy=` variable anymore, since with commit **b88e10fe3029602b369c719506588097fcbdf80b**, `parse-kickstart` now generates a `inst.proxy=` variable instead:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -157,7 +157,7 @@ class DracutURL(Url, DracutArgsMixin):
         if self.noverifyssl:
             args.append("rd.noverifyssl")
         if self.proxy:
-            args.append("proxy=%s" % self.proxy)
+            args.append("inst.proxy=%s" % self.proxy)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

We can confirm the generated cmdline snippet:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# cat /etc/cmdline.d/80-kickstart.conf 
inst.text
ip=enp1s0:dhcp: bootdev=enp1s0
inst.repo=http://localhost/rhel91
inst.proxy=http://192.168.122.1:3128
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

On RHEL8, it was:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# cat /etc/cmdline.d/80-kickstart.conf 
inst.text
ip=enp1s0:dhcp: bootdev=enp1s0
inst.repo=http://localhost/rhel91
proxy=http://192.168.122.1:3128
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

If new variable (`inst.proxy`) is expected, then lib/url-lib.sh must search for `inst.proxy` as well, but this file is shipped with *dracut*, not *dracut-anaconda*, so this would become inconsistent.

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

RHEL9.0+ DVD

How reproducible:

Always

Steps to Reproduce:
1. Boot a VM with RHEL9 kernel and initramfs and kickstart containing a URL with a proxy

Actual results:

Can't load Stage2

Expected results:

Can load Stage2

Comment 2 Jiri Konecny 2023-05-31 16:33:15 UTC
PR: https://github.com/rhinstaller/anaconda/pull/4794

Comment 4 Jan Stodola 2023-06-09 08:57:08 UTC
Confirmed that it's now possible to use "url --url=... --proxy=..." to fetch stage2 and packages via the specified proxy.

Tested with anaconda-34.25.3.2-1.el9, no regression has been found during the testing.

Marking as Verified:Tested.

Comment 7 Jiri Konecny 2023-06-12 15:51:18 UTC
Additional fix for this issue: https://github.com/rhinstaller/anaconda/pull/4829

Comment 11 Jan Stodola 2023-06-23 08:57:31 UTC
Retested with anaconda-34.25.3.4-1.el9 to make sure that an incorrect warning about using the proxy option fixed by the PR from comment 7 is resolved.

Comment 13 Jan Stodola 2023-06-26 10:38:30 UTC
Checked that anaconda-34.25.3.4-1.el9 is in nightly compose RHEL-9.3.0-20230626.34

Moving to VERIFIED

Comment 16 errata-xmlrpc 2023-11-07 08:31: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 (anaconda 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-2023:6414


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