Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2430 by stid.s...@gmail.com: post-review fails to post diff to reviewboard server if anonymous access disabled
http://code.google.com/p/reviewboard/issues/detail?id=2430

* NOTE: Do not post confidential information in this bug report. *
*       If you need immediate support, please contact            *
*       reviewbo...@googlegroups.com                             *

What version are you running?
reviewboard 1.6.2, rbtools 0.3.2_1

What's the URL of the page containing the problem?
http://<review-board-url>/api/repositories

What steps will reproduce the problem?
1. Checkout source code and make some changes
2. Specify the url for reviewboard server in .reviewboardrc file
3. Run post-review to post the diff to the server

What is the expected output? What do you see instead?
User/password should be prompted to the user and diff is posted to the server. But actually I see the following error messages:
$ post-review
Traceback (most recent call last):
  File "/usr/local/bin/post-review", line 8, in <module>
    load_entry_point('RBTools==0.3.2', 'console_scripts', 'post-review')()
File "build/bdist.freebsd-8.2-RELEASE-amd64/egg/rbtools/postreview.py", line 3741, in main File "build/bdist.freebsd-8.2-RELEASE-amd64/egg/rbtools/postreview.py", line 434, in check_api_version File "build/bdist.freebsd-8.2-RELEASE-amd64/egg/rbtools/postreview.py", line 876, in api_get File "build/bdist.freebsd-8.2-RELEASE-amd64/egg/rbtools/postreview.py", line 846, in http_get
  File "/usr/local/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/local/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
File "build/bdist.freebsd-8.2-RELEASE-amd64/egg/rbtools/postreview.py", line 317, in http_response
  File "/usr/local/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 884, in http_error_401
    url, req, headers)
File "/usr/local/lib/python2.7/urllib2.py", line 859, in http_error_auth_reqed
    response = self.retry_http_basic_auth(host, req, realm)
File "build/bdist.freebsd-8.2-RELEASE-amd64/egg/rbtools/postreview.py", line 342, in retry_http_basic_auth
AttributeError: 'NoneType' object has no attribute 'code'

What operating system are you using? What browser?
FreeBSD 8.2 Release. It's rbtools issue.

Please provide any additional information below.
It seems that the post-review tool will first try to access the URL
http://<review-board-url>/api/repositories before user login.
But if the administrator has disabled anonymous access of the reviewboard site, the URL above is not allowed to access until the user logs in. So I guess that the post-review tool should try to authenticate the user before visiting '/api/repositories' URL.

The apache configuration is as follows:

        DocumentRoot "/usr/local/www/reviewboard/htdocs"

        # Error handlers
        ErrorDocument 500 /errordocs/500.html

        WSGIPassAuthorization On
WSGIScriptAlias "/" "/usr/local/www/reviewboard/htdocs/reviewboard.wsgi/"

        <Directory "/usr/local/www/reviewboard/htdocs">
                AllowOverride All
                Options -Indexes FollowSymLinks
                Allow from all
        </Directory>

        # Alias static media requests to filesystem
        Alias /media "/usr/local/www/reviewboard/htdocs/media"
        Alias /errordocs "/usr/local/www/reviewboard/htdocs/errordocs"
Alias /favicon.ico "/usr/local/www/reviewboard/htdocs/media/rbcommons/images/favicon.png"


--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to