Bug 1014092 - hwcert-backend submit fails when behind a proxy
Summary: hwcert-backend submit fails when behind a proxy
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Hardware Certification Program
Classification: Retired
Component: Test Suite (harness)
Version: 6.1
Hardware: All
OS: Linux
high
urgent
Target Milestone: ---
: ---
Assignee: Greg Nichols
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: 1052387
TreeView+ depends on / blocked
 
Reported: 2013-10-01 12:05 UTC by Rainer Koenig
Modified: 2020-09-10 09:17 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-04-02 12:10:16 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 505763 0 None None None Never

Description Rainer Koenig 2013-10-01 12:05:01 UTC
Description of problem:
After running some tests I wanted to submit the results with `hwcert-backend submit` but I only get a Error[111] "Connection refused"

Version-Release number of selected component (if applicable):
hwcert-client_14.6-57.el6

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL, hwcert 
2. Set the environment variables for the proxies. In my case its:
export http_proxy="http://172.25.159.7:81"
export https_proxy="http://172.25.159.7:81"

3. run some tests and then do a `hwcert-backend submit`

Actual results:
The submit tasks asks first time if it should create a new cert or add to an existing. Then it asks for User-ID and password. After everything is entered, then you get the message "Could not submit results" because connection is refused.

Expected results:
Submit works.

Additional info:
I did an 'strace hwcert-backend submit` and the last lines show, that instead of honoring the proxy settings the process wants to establish a direct connection to  209.132.183.70 (which is hardware.redhat.com). 

socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.2.1")}, 16) = 0
poll([{fd=3, events=POLLOUT}], 1, 0)    = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "\370\216\1\0\0\1\0\0\0\0\0\0\10hardware\6redhat\3com"..., 37, MSG_NOSIGNAL, NULL, 0) = 37
poll([{fd=3, events=POLLIN|POLLOUT}], 1, 5000) = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "t\356\1\0\0\1\0\0\0\0\0\0\10hardware\6redhat\3com"..., 37, MSG_NOSIGNAL, NULL, 0) = 37
poll([{fd=3, events=POLLIN}], 1, 4999)  = 1 ([{fd=3, revents=POLLIN}])
ioctl(3, FIONREAD, [81])                = 0
recvfrom(3, "t\356\201\200\0\1\0\0\0\1\0\0\10hardware\6redhat\3com"..., 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.2.1")}, [16]) = 81
poll([{fd=3, events=POLLIN}], 1, 4999)  = 1 ([{fd=3, revents=POLLIN}])
ioctl(3, FIONREAD, [504])               = 0
recvfrom(3, "\370\216\201\200\0\1\0\1\0\r\0\f\10hardware\6redhat\3com"..., 1967, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.2.1")}, [16]) = 504
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("209.132.183.70")}, 16) = -1 ECONNREFUSED (Connection refused)
close(3)                                = 0
write(1, "Error: could not submit certific"..., 47Error: could not submit certification results:
) = 47
write(1, "[Errno 111] Connection refused\n", 31[Errno 111] Connection refused
) = 31
unlink("/var/lock/subsys/hwcert")       = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x382420f500}, {0x3831703400, [], SA_RESTORER, 0x382420f500}, 8) = 0
exit_group(0)                           = ?

Note: If the https_proxy is not set correctly you won't even be able to enter the User-ID. So I assume that the proxy settings are right, but it looks like that the central submit function doesn't care about proxy settings.

Regards
Rainer

Comment 1 Christian Horn 2013-10-01 13:54:17 UTC
- Do you encounter the issue when no_proxy is used?
- Crosscheck of the variables with wget or curl: Does fetching a https page work?
- What are the exact versions of the hwcert packages you use there? Is the RHEL a 6.4GA ?

Comment 3 Christian Horn 2013-10-07 08:09:43 UTC
(In reply to Christian Horn from comment #1)
> - Crosscheck of the variables with wget or curl: Does fetching a https page
> work?
Rainer reports that this works.
The hwcert packages just seem to block "at some later state".

Any ideas to further debug this?  Do we have a testscenario which tests the proxy functionality?

Comment 4 Christian Horn 2013-10-07 11:47:26 UTC
I reproduced this here with 2 systems,
- one running squid default config
- the other one running hwcert-backend submit.

After setting {http|https|ftp}_proxy variables:
- 'hwcert-backend submit' here uses the proxy initially
- but then tries to lookup partner-hwcert.redhat.com via DNS from the system, instead of using the proxy

Comment 11 Christian Horn 2014-02-03 16:14:20 UTC
Same behavior on RHEL7 with latest client. On a system which has proxy access, verified with "elinks -dump ...":

Would you like to submit the results to the hardware catalog? (y|n) y
response: y
What certification is this system being tested for? (new|existing|none) new
response: new
Error: could not open a new certification:
[Errno -2] Name or service not known
Saving current results to:
/var/hwcert/store/Bochs/Bochs/Bochs/x86_64/RHEL/7/hwcert-results-rhel7a-20140203161334.xml.gz
Traceback (most recent call last):
  File "/usr/bin/hwcert", line 31, in <module>
    if not hwcert.run():
  File "/usr/share/hwcert/lib/hwcert/hardwarecertification.py", line 87, in run
    if not self.certify():
  File "/usr/share/hwcert/lib/hwcert/hardwarecertification.py", line 116, in certify
    if not self.doPlan():
  File "/usr/share/hwcert/lib/hwcert/harness.py", line 149, in doPlan
    self.planner.analyse(self.environment.getSourceDirectory())
  File "/usr/share/hwcert/lib/hwcert/planner.py", line 88, in analyse
    test = testClass()
  File "/usr/share/hwcert/tests/cpuscaling/cpuscaling.py", line 77, in __init__
    self.cpuPower = CPUPower()
  File "/usr/share/hwcert/tests/cpuscaling/cpupower.py", line 38, in __init__
    self.__getSupportInformation()
  File "/usr/share/hwcert/tests/cpuscaling/cpupower.py", line 124, in __getSupportInformation
    if maxFreq and not self.maximumFrequency:
UnboundLocalError: local variable 'maxFreq' referenced before assignment
[root@rhel7a ~]# rpm -qa|grep hwcert
hwcert-server-1.7.0-20140124.2.el7.noarch
hwcert-client-info-1.7.0-20140124.2.el7.noarch
hwcert-client-1.7.0-20140124.2.el7.noarch

Comment 18 Rainer Koenig 2019-04-02 12:10:16 UTC
Submitting works since long... so I close this bug.


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