Hide Forgot
Description of problem: As subject, using nitrate.py and f14 x86_64 Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: See comment 1 Actual results: Connection time out, trackback: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "nitrate.py", line 383, in get_me return self.do_command("User.get_me") File "nitrate.py", line 359, 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 "nitrate.py", line 78, 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) httplib.BadStatusLine: '' >>> n.get_me() self.server.User.get_me() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "nitrate.py", line 383, in get_me return self.do_command("User.get_me") File "nitrate.py", line 359, 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 "nitrate.py", line 71, in request self.send_request(h,handler,request_body) File "/usr/lib64/python2.7/xmlrpclib.py", line 1391, in send_request connection.putrequest("POST", handler, skip_accept_encoding=True) File "/usr/lib64/python2.7/httplib.py", line 845, in putrequest raise CannotSendRequest() httplib.CannotSendRequest Expected results: Can work correctly. Additional info:
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.
It's fixed in https://fedorahosted.org/nitrate/changeset/77dbc0349583d8d94cc48c3644c8aded6edb1b70/
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