Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 664378

Summary: Timeout of the registration to RHN Satellite is more than expected
Product: Red Hat Enterprise Linux 5 Reporter: Linqing Lu <lilu>
Component: ovirt-nodeAssignee: Mike Burns <mburns>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: urgent    
Version: 5.6CC: apevec, cpelland, gouyang, gshipley, mburns, mshao, ovirt-maint
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 670241 (view as bug list) Environment:
Last Closed: 2011-07-27 14:41:20 UTC Type: ---
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: 670315    
Attachments:
Description Flags
Patch none

Description Linqing Lu 2010-12-20 08:37:54 UTC
Description of problem:
Timeout of the registration to RHN Satellite(9m+) is more than expected(90s)

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Hypervisor release 5.6 (6.1.el5)

How reproducible:
always

Steps to Reproduce:
1. insert a new rule in iptables to drop all https packages.
   #iptables -I OUTPUT -p tcp --dport 443 -j DROP
2. register the host to an existed RHN satellite
3. as designed, the function will not succeed because it is using https to register.
  
Actual results:
Timeout after more than 9 minutes

Expected results:
Timeout after 90 seconds

Additional info:

My suggestion
in line 59 of /usr/libexec/ovirt-config-rhn:
"if wget -q -r -nd --no-check-certificate --timeout=90 -O $location $CaCert; then"
the wget will retry 20 time by default, and 90s each.
so it will work as design with adding one more option "tries"here:
Such as "if wget -q -r -nd --no-check-certificate --timeout=90 --tries=1 -O $location $CaCert; then"

Comment 1 Alan Pevec 2010-12-20 11:05:05 UTC
Thanks for catching this!
BTW, from your suggestion looks like you actually have a patch,
feel free to post it here :)

Comment 3 Mike Burns 2011-01-17 16:38:58 UTC
Created attachment 473890 [details]
Patch

Updated patch -- changes to 30 seconds, 3 tries
Also handles issue with wget not returning valid error code

Testing:  went through the same steps as in the bug description.

Also manually tested error condition change

if [ -e $location -a ! "$(ll $location 2>/dev/null | awk '{print $5}')" = "0" ]; then echo "Success"; else echo "Failed"; fi

# location=/tmp/testing
# rm $location
# run if from above --> Failed (does not exist)
# touch #location
# run if from above --> Failed (exists, but 0 size)
# echo "test" > $location
# run if from above --> Success (exists, non-zero)

Comment 6 Guohua Ouyang 2011-04-22 07:14:42 UTC
Verified on rhevh 5.7-1:

Downloading Satellite CA cert.....
From: https://10.66.73.127/pub/RHN-ORG-TRUSTED-SSL-CERT To: /etc/sysconfig/rhn/RHN-ORG-TRUSTED-SSL-CERT
File already persisted: /etc/sysconfig/rhn/RHN-ORG-TRUSTED-SSL-CERT

Registering to RHN account.....
Warning: yum-rhn-plugin is not present, could not enable it.File already persisted: /etc/sysconfig/rhn/up2date
 File persisted

Successfully persisted /etc/sysconfig/rhn/systemid

System  sucessfuly registered https://10.66.73.127


Could see register to rhn satellite is successful.

Comment 7 errata-xmlrpc 2011-07-27 14:41:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1090.html