| Summary: | [xmlrpc] - xmlrpc loses connection to the server after a short timeout | ||
|---|---|---|---|
| Product: | [Other] TCMS | Reporter: | Yuguang Wang <yuwang> |
| Component: | Application | Assignee: | Yuguang Wang <yuwang> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | tools-bugs <tools-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.3 | CC: | ctang, junzhang, jzhao, mbenenso, nli, vchen, xgao |
| Target Milestone: | --- | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | 3.4-5 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-05-30 08:58:49 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 704162 | ||
|
Description
Yuguang Wang
2011-03-24 10:29:12 UTC
Hi guys,
I am using your nitrate.py file for our automation purposes and it worked fine till the last week.
Since the last week it seems like the connection between Nitrate xmlrpc service
and TCMS MySql DB resets after few seconds (see ipython output, TcmsAgent uses nitrate.py):
In [2]: obj = TcmsAgent('mbenenso')
self.server.Auth.login_krbv()
In [3]: obj.init(test_type='Functionality', build_name='ic105', product_name='RHEVM', product_version='4.6', product_category='API', header_names='testName:sub_test,caseName:info,info:text,dcType:text')
self.server.Product.get_plans('119')
self.server.Product.get_cases('119')
self.server.Product.get_versions('119')
self.server.Product.get_categories('119')
self.server.Product.get_builds('119')
self.server.User.get_me()
self.server.TestPlan.check_plan_type('Functionality')
In [4]: obj._isTestCaseAttachedToPlan('72542', '3173')
self.server.TestCase.get_plans(72542)
Out[4]: True
In [5]: obj._isTestCaseAttachedToPlan('72542', '3173')
self.server.TestCase.get_plans(72542)
Out[5]: True
In [6]: obj._isTestCaseAttachedToPlan('72542', '3173')
self.server.TestCase.get_plans(72542)
''
Traceback (most recent call last):
File "nitrateApi.py", line 349, in do_command
return eval(cmd)
File "<string>", line 1, in <module>
File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request
verbose=self.__verbose
File "nitrateApi.py", line 74, in request
response = h.getresponse()
File "/usr/lib64/python2.7/httplib.py", line 1025, in getresponse
response.begin()
File "/usr/lib64/python2.7/httplib.py", line 401, in begin
version, status, reason = self._read_status()
File "/usr/lib64/python2.7/httplib.py", line 365, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
Out[6]: False
I am catching this exception in the do_command() method of nitrate.py using traceback.format_exc().
After additional call to NitrateKerbXmlrpc c'tor the connection re-connects and works again:
In [16]: obj.nitrateApi = nitrateApi.NitrateKerbXmlrpc(obj.tcmsUrl)
self.server.Auth.login_krbv()
In [17]: obj._isTestCaseAttachedToPlan('72542', '3173')
self.server.TestCase.get_plans(72542)
Out[17]: True
NOTE: I am using Python 2.7 and I already updated nitrate.py code to support the latest xmlrpc.
It's from Max Benenson (In reply to comment #1) > Hi guys, > > I am using your nitrate.py file for our automation purposes and it worked fine > till the last week. > Since the last week it seems like the connection between Nitrate xmlrpc service > and TCMS MySql DB resets after few seconds (see ipython output, TcmsAgent uses > nitrate.py): > > In [2]: obj = TcmsAgent('mbenenso') > self.server.Auth.login_krbv() > > In [3]: obj.init(test_type='Functionality', build_name='ic105', > product_name='RHEVM', product_version='4.6', product_category='API', > header_names='testName:sub_test,caseName:info,info:text,dcType:text') > self.server.Product.get_plans('119') > self.server.Product.get_cases('119') > self.server.Product.get_versions('119') > self.server.Product.get_categories('119') > self.server.Product.get_builds('119') > self.server.User.get_me() > self.server.TestPlan.check_plan_type('Functionality') > > In [4]: obj._isTestCaseAttachedToPlan('72542', '3173') > self.server.TestCase.get_plans(72542) > Out[4]: True > > In [5]: obj._isTestCaseAttachedToPlan('72542', '3173') > self.server.TestCase.get_plans(72542) > Out[5]: True > > In [6]: obj._isTestCaseAttachedToPlan('72542', '3173') > self.server.TestCase.get_plans(72542) > '' > Traceback (most recent call last): > File "nitrateApi.py", line 349, in do_command > return eval(cmd) > File "<string>", line 1, in <module> > File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__ > return self.__send(self.__name, args) > File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request > verbose=self.__verbose > File "nitrateApi.py", line 74, in request > response = h.getresponse() > File "/usr/lib64/python2.7/httplib.py", line 1025, in getresponse > response.begin() > File "/usr/lib64/python2.7/httplib.py", line 401, in begin > version, status, reason = self._read_status() > File "/usr/lib64/python2.7/httplib.py", line 365, in _read_status > raise BadStatusLine(line) > BadStatusLine: '' > > Out[6]: False > > > I am catching this exception in the do_command() method of nitrate.py using > traceback.format_exc(). > After additional call to NitrateKerbXmlrpc c'tor the connection re-connects and > works again: > > In [16]: obj.nitrateApi = nitrateApi.NitrateKerbXmlrpc(obj.tcmsUrl) > self.server.Auth.login_krbv() > > In [17]: obj._isTestCaseAttachedToPlan('72542', '3173') > self.server.TestCase.get_plans(72542) > Out[17]: True > > > NOTE: I am using Python 2.7 and I already updated nitrate.py code to support > the latest xmlrpc. Verify version: 3.4 on englab Actual result: xmlrpclib.ProtocolError: <ProtocolError for tcms.englab.nay.redhat.com/xmlrpc/: 401 Authorization Required> verify result: FAIL Verify version: 3.4 on stage (3.4-5) Actual result: Can not reproduce this issue on stage env. Verify result: PASS |