Bug 735937 - RPC: 401 Authorization Required after 1000sec on Fedora
Summary: RPC: 401 Authorization Required after 1000sec on Fedora
Keywords:
Status: VERIFIED
Alias: None
Product: TCMS
Classification: Other
Component: Usability
Version: 3.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: June Zhang
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-06 08:13 UTC by Petr Sklenar ⛄
Modified: 2018-02-16 00:33 UTC (History)
10 users (show)

Fixed In Version: 3.6.3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Petr Sklenar ⛄ 2011-09-06 08:13:45 UTC
Description of problem:
there is error '401 Authorization Required' on fedora
Rhel6 is OK

Version-Release number of selected component (if applicable):
Nitrate 3.5.0 © 2011 Red Hat, Inc. All rights reserved.

python-2.7-8.fc14.1.x86_64

How reproducible:
deterministic

Steps to Reproduce:
1. have a simple script which uses kerberos authentication, for ex:
        from Nitrate import *
        import time
        for i in range(10000):
                print TestPlan(289)
                time.sleep(10)
                print Nitrate()

Nitrate.py: http://git.engineering.redhat.com/?p=users/psplicha/tcms;a=tree
2, start script and wait 1000s
  
Actual results:

Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 96
TP#289 - Tessst plan
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 97
TP#289 - Tessst plan
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 98
TP#289 - Tessst plan
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 99
TP#289 - Tessst plan
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 100
Traceback (most recent call last):
  File "./createplanbytag.py", line 186, in <module>
    print TestPlan(289)
  File "/usr/share/qa-tools/Nitrate.py", line 1705, in __str__
    return "{0} - {1}".format(self.identifier, self.name)
  File "/usr/share/qa-tools/Nitrate.py", line 193, in getter
    self._get()
  File "/usr/share/qa-tools/Nitrate.py", line 1783, in _get
    testplanhash = self._server.TestPlan.get(self.id)
  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 "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/share/qa-tools/nitrate.py", line 174, in single_request_with_cookies
    response.msg,
xmlrpclib.ProtocolError: <ProtocolError for tcms.engineering.redhat.com/xmlrpc/: 401 Authorization Required>


Expected results:


Additional info:
Important thing to add !!!! it works on RHEL6, it looks like it communicates with kerberos server during each request thats why it work and its slower.

Comment 1 Jin Zhao 2011-10-18 06:52:43 UTC
Hi Petr Sklenar

Could you help to try again on TCMS 3.6 now and confirm whether can reproduce this issue on TCMS 3.6? Thanks

Comment 2 Petr Sklenar ⛄ 2011-10-18 07:53:05 UTC
it was not fixed:
Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
Total requests handled: 100
Traceback (most recent call last):
  File "/tmp/test.py", line 9, in <module>
    print TestPlan(289)
  File "/usr/share/qa-tools/Nitrate.py", line 1844, in __str__
    return "{0} - {1}".format(self.identifier, self.name)
  File "/usr/share/qa-tools/Nitrate.py", line 233, in getter
    self._get()
  File "/usr/share/qa-tools/Nitrate.py", line 1922, in _get
    testplanhash = self._server.TestPlan.get(self.id)
  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 "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/share/qa-tools/nitrate.py", line 174, in single_request_with_cookies
    response.msg,
xmlrpclib.ProtocolError: <ProtocolError for tcms.engineering.redhat.com/xmlrpc/: 401 Authorization Required>
--
1, test script needs package qa-tools, 

wget -O /etc/yum.repos.d/qa-tools.repo http://liver.englab.brq.redhat.com/repo/qa-tools.repo
yum -y install -y qa-tools

2, cat /tmp/test.py
#!/usr/bin/python -i

# readline & tab completion support
import sys, rlcompleter, readline
sys.path.append("/usr/share/qa-tools")
from Nitrate import *
import time
for i in range(10000):
        print TestPlan(289)
        time.sleep(10)
        print Nitrate()

3, python /tmp/test.py
causes the issue

Comment 3 cqi 2011-12-27 07:58:23 UTC
Make sure your Kerberos ticket does not expire while the code is running.

(In reply to comment #2)
> it was not fixed:
> Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
> Total requests handled: 100
> Traceback (most recent call last):
>   File "/tmp/test.py", line 9, in <module>
>     print TestPlan(289)
>   File "/usr/share/qa-tools/Nitrate.py", line 1844, in __str__
>     return "{0} - {1}".format(self.identifier, self.name)
>   File "/usr/share/qa-tools/Nitrate.py", line 233, in getter
>     self._get()
>   File "/usr/share/qa-tools/Nitrate.py", line 1922, in _get
>     testplanhash = self._server.TestPlan.get(self.id)
>   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 "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
>     return self.single_request(host, handler, request_body, verbose)
>   File "/usr/share/qa-tools/nitrate.py", line 174, in
> single_request_with_cookies
>     response.msg,
> xmlrpclib.ProtocolError: <ProtocolError for
> tcms.engineering.redhat.com/xmlrpc/: 401 Authorization Required>
> --
> 1, test script needs package qa-tools, 
> 
> wget -O /etc/yum.repos.d/qa-tools.repo
> http://liver.englab.brq.redhat.com/repo/qa-tools.repo
> yum -y install -y qa-tools
> 
> 2, cat /tmp/test.py
> #!/usr/bin/python -i
> 
> # readline & tab completion support
> import sys, rlcompleter, readline
> sys.path.append("/usr/share/qa-tools")
> from Nitrate import *
> import time
> for i in range(10000):
>         print TestPlan(289)
>         time.sleep(10)
>         print Nitrate()
> 
> 3, python /tmp/test.py
> causes the issue

Comment 4 cqi 2011-12-31 05:03:10 UTC
(In reply to comment #2)
> it was not fixed:
> Nitrate server: https://tcms.engineering.redhat.com/xmlrpc/
> Total requests handled: 100
> Traceback (most recent call last):
>   File "/tmp/test.py", line 9, in <module>
>     print TestPlan(289)
>   File "/usr/share/qa-tools/Nitrate.py", line 1844, in __str__
>     return "{0} - {1}".format(self.identifier, self.name)
>   File "/usr/share/qa-tools/Nitrate.py", line 233, in getter
>     self._get()
>   File "/usr/share/qa-tools/Nitrate.py", line 1922, in _get
>     testplanhash = self._server.TestPlan.get(self.id)
>   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 "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
>     return self.single_request(host, handler, request_body, verbose)
>   File "/usr/share/qa-tools/nitrate.py", line 174, in
> single_request_with_cookies
>     response.msg,
> xmlrpclib.ProtocolError: <ProtocolError for
> tcms.engineering.redhat.com/xmlrpc/: 401 Authorization Required>
> --
> 1, test script needs package qa-tools, 
> 
> wget -O /etc/yum.repos.d/qa-tools.repo
> http://liver.englab.brq.redhat.com/repo/qa-tools.repo
> yum -y install -y qa-tools
> 
> 2, cat /tmp/test.py
> #!/usr/bin/python -i
> 
> # readline & tab completion support
> import sys, rlcompleter, readline
> sys.path.append("/usr/share/qa-tools")
> from Nitrate import *
> import time
> for i in range(10000):
>         print TestPlan(289)
>         time.sleep(10)
>         print Nitrate()
> 
> 3, python /tmp/test.py
> causes the issue

Code has been changed in nitrate.py. You may use new nitrate.py instead of the old one after the release of TCMS 3.6.3.

Comment 5 Xin Gao 2012-01-11 05:30:03 UTC
Verify version and result:
3.6.3 on englab --> PASSED

Verify step:
refer to comment 2

Actual results:
There is no error, and script can be executed successfully.


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