Bug 1388073 - unable to PXE provision: http://<fqdn>/rhn/kickstart/... gives 302 to https://...
Summary: unable to PXE provision: http://<fqdn>/rhn/kickstart/... gives 302 to https:/...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Jan Dobes
QA Contact: Patrik Segedy
URL:
Whiteboard:
Depends On:
Blocks: 1340444 1398248
TreeView+ depends on / blocked
 
Reported: 2016-10-24 11:31 UTC by Jan Hutař
Modified: 2020-03-11 15:19 UTC (History)
7 users (show)

Fixed In Version: spacewalk-java-2.5.14-27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1398248 (view as bug list)
Environment:
Last Closed: 2017-06-21 12:08:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1485010 0 high CLOSED media_path incorrect set on Cobbler profile creation 2021-06-10 12:52:58 UTC
Red Hat Knowledge Base (Solution) 365943 0 None None None 2017-02-17 04:33:39 UTC

Internal Links: 1485010

Description Jan Hutař 2016-10-24 11:31:43 UTC
Description of problem:
I'm unable to PXE provision because when anaconda tries to get http://<fqdn>/rhn/kickstart/..., Satellite gives 302 to https://... and that fails. When URIs are compared to 5.7.0, they are http://<fqdn>/ks/dist/....


Version-Release number of selected component (if applicable):
Satellite-5.8-RHEL-6-20161017.n.0-Satellite-x86_64


How reproducible:
always


Steps to Reproduce:
1. Create KS profile
2. Check its rendered version
   System -> Kickstart -> Profile -> <profile> -> Kickstart File
3. E.g. check URL on "url --url http://..."

Better test: Do a PXE provisioning


Actual results:
url --url http://satellite.example.com/rhn/kickstart/ks-rhel-x86_64-server-7-7.2


Expected results:
On Satellite 5.7.0 where PXE works there is:
url --url http://elisha.brq.redhat.com/ks/dist/ks-rhel-x86_64-server-7-7.2

Comment 1 Jan Hutař 2016-10-24 11:32:41 UTC
This http config seems to be relevant and is same for both 5.7.0 and 5.8.0.n:

# This rule handles incoming kickstart file requests from
# machines actually performing a kickstart. This rule
# processes the incoming URL and converts it into something
# slightly more Struts friendly.
RewriteRule ^/ks/cfg([-a-zA-Z0-9\._/\%\ ]*)$ /rhn/kickstart/DownloadFile.do?ksurl=$1
RewriteRule ^/download/(.*)$ /rhn/common/DownloadFile.do?url=$1
RewriteRule ^/rpc/api /rhn/rpc/api
RewriteRule ^/ks/dist(.*)$ /rhn/common/DownloadFile.do?url=/ks/dist$1
RewriteRule ^(/ty/.*)$ /rhn/common/DownloadFile.do?url=$1

Comment 2 Jan Hutař 2016-10-24 11:33:54 UTC
From 5.8.0.n:

[root@satellite conf.d]# wget http://satellite.example.com/rhn/kickstart/ks-rhel-x86_64-server-7-7.2/LiveOS/squashfs.img
--2016-10-24 07:34:17--  http://satellite.example.com/rhn/kickstart/ks-rhel-x86_64-server-7-7.2/LiveOS/squashfs.img
Resolving satellite.example.com... 192.168.10.100
Connecting to satellite.example.com|192.168.10.100|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://satellite.example.com/rhn/kickstart/ks-rhel-x86_64-server-7-7.2/LiveOS/squashfs.img [following]
--2016-10-24 07:34:17--  https://satellite.example.com/rhn/kickstart/ks-rhel-x86_64-server-7-7.2/LiveOS/squashfs.img
Connecting to satellite.example.com|192.168.10.100|:443... connected.
ERROR: cannot verify satellite.example.com’s certificate, issued by “/C=CZ/ST=C/L=B/O=A/OU=satellite.example.com/CN=satellite.example.com”:
  Unable to locally verify the issuer’s authority.
To connect to satellite.example.com insecurely, use ‘--no-check-certificate’.
[root@satellite conf.d]# wget http://satellite.example.com/ks/dist/ks-rhel-x86_64-server-7-7.2/LiveOS/squashfs.img
--2016-10-24 07:34:27--  http://satellite.example.com/ks/dist/ks-rhel-x86_64-server-7-7.2/LiveOS/squashfs.img
Resolving satellite.example.com... 192.168.10.100
Connecting to satellite.example.com|192.168.10.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 274071552 (261M) [application/octet-stream]
Saving to: “squashfs.img.2”

100%[====================================================================================================================================================================================================>] 274,071,552  608M/s   in 0.4s    

2016-10-24 07:34:28 (608 MB/s) - “squashfs.img.2” saved [274071552/274071552]

Comment 3 Jan Hutař 2016-10-24 12:34:59 UTC
Note this is also reproducible using `cobbler buildiso` ISO boot.

Comment 5 Jan Hutař 2016-10-25 07:45:01 UTC
As a workaround I have added:

# diff -u /etc/httpd/conf.d/zz-spacewalk-www.conf{.ORIG,}
--- /etc/httpd/conf.d/zz-spacewalk-www.conf.ORIG	2016-10-25 03:39:45.511204405 -0400
+++ /etc/httpd/conf.d/zz-spacewalk-www.conf	2016-10-25 03:40:49.558204688 -0400
@@ -32,6 +32,7 @@
 RewriteRule ^/ks/cfg([-a-zA-Z0-9\._/\%\ ]*)$ /rhn/kickstart/DownloadFile.do?ksurl=$1
 RewriteRule ^/download/(.*)$ /rhn/common/DownloadFile.do?url=$1
 RewriteRule ^/rpc/api /rhn/rpc/api
+RewriteRule ^/rhn/kickstart(.*)$ /rhn/common/DownloadFile.do?url=/ks/dist$1
 RewriteRule ^/ks/dist(.*)$ /rhn/common/DownloadFile.do?url=/ks/dist$1
 RewriteRule ^(/ty/.*)$ /rhn/common/DownloadFile.do?url=$1

Comment 11 Jan Dobes 2016-11-24 10:11:56 UTC
spacewalk master commits:

99b6a15a83b2b8d749c2743e08f6cd43bd3ded16
6f475886359ab5d0e608180db30a417660985825

Comment 14 Patrik Segedy 2017-01-31 15:35:31 UTC
Steps to verify:

spacewalk-java-2.5.14-48.el6sat.noarch
1. Register system to Satellite
2. Create KS profile using synced kickstart tree
3. Check kickstart in
   System -> Kickstart -> Profile -> <profile> -> Kickstart File
4. There is correct url
   url --url http://<FQDN>/ks/dist/ks-rhel-x86_64-server-7-7.0
5. Provision registered system using this KS profile through WebUI
   System -> Provisioning -> Schedule -> Schedule Kickstart and Finish
   then run rhn_check on client
6. System is provisioned successfully

Second approach using custom distribution
spacewalk-java-2.5.14-46.el6sat.noarch

1. Register system
2. Mount ISO
3. Create KS distribution and KS profile
4. Check kickstart in
   System -> Kickstart -> Profile -> <profile> -> Kickstart File
5. There is correct url
   url --url http://<FQDN>/ks/dist/org/1/ks-custom-rhel7
6. Provision system through WebUI
   System -> Provisioning -> Schedule -> Schedule Kickstart and Finish
   then run rhn_check on client
7. System is provisioned successfully

VERIFIED

Comment 15 Ashfaqur Rahaman 2017-02-17 04:33:07 UTC
Another workaround is to manually modify the kickstart url part : 

From Gui : 

Kickstart Details > Advance option > 
 
--url /rhn/kickstart/ks-rhel-x86_64-server-7-7.2

with 

--url /ks/dist/ks-rhel-x86_64-server-7-7.2

Thanks


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