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

New issue 3487 by alexisde...@gmail.com: Authentication error when connecting to svn without public access
http://code.google.com/p/reviewboard/issues/detail?id=3487

What version are you running?
2.0.2

What's the URL of the page containing the problem?
Not a public URL

What steps will reproduce the problem?
1. Create a svn server with no public access (only account access) (I am using VisualSVN) 2. Create a repository connection and make sure to enter the username and password for a valid account
3. Hit Save and it fails with an authentication errot

What is the expected output? What do you see instead?
Expect to have a new connection to my repository but instead it fails with authentication error The error in the log is "ERROR - - SVN: Failed to get repository information for https://test.com/svn/myfolder/Phoenix: callback_get_login required"

What operating system are you using? What browser?
Windows 7 x64 with Google Chrome

Please provide any additional information below.
it seems that before accessing the repository, review board checks that it exists by trying to access it without credentials (assumes there is public access to read) and then it accesses it using the credentials. I have made the code fail where the error occurs to get a traceback: 2014-07-15 15:31:52,529 - ERROR - - SVN: Failed to get repository information for https://example.com:81/svn/Test: callback_get_login required 2014-07-15 15:50:25,674 - ERROR - - Exception thrown for user admin at http://example.com:8181/reviewboard/admin/db/scmtools/repository/add/

unexpected indent (pysvn.py, line 39)
Traceback (most recent call last):
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\core\handlers\base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\contrib\admin\options.py", line 432, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\utils\decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\views\decorators\cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\contrib\admin\sites.py", line 198, in inner
    return view(request, *args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\utils\decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\utils\decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\utils\decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\db\transaction.py", line 371, in inner
    return func(*args, **kwargs)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\contrib\admin\options.py", line 1113, in add_view
    if form.is_valid():
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\forms.py", line 1024, in is_valid
    if not super(RepositoryForm, self).is_valid():
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\forms\forms.py", line 129, in is_valid
    return self.is_bound and not bool(self.errors)
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\forms\forms.py", line 121, in errors
    self.full_clean()
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\forms.py", line 813, in full_clean
    super(RepositoryForm, self).full_clean()
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\forms\forms.py", line 273, in full_clean
    self._clean_fields()
File "C:\BitNami\reviewboard-2.0.2-0\apps\django\django\forms\forms.py", line 291, in _clean_fields
    value = getattr(self, 'clean_%s' % name)()
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\forms.py", line 988, in clean_tool
    scmtool_class = tool.get_scmtool_class()
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\models.py", line 56, in get_scmtool_class
    [six.binary_type(attr)])
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\svn\__init__.py", line 552, in <module>
    recompute_svn_backend()
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\svn\__init__.py", line 527, in recompute_svn_backend
    fromlist=['Client', 'has_svn_backend'])
File "C:\BitNami\reviewboard-2.0.2-0\apps\reviewboard\Lib\site-packages\ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\svn\pysvn.py", line 39
    logging.debug('SVN: username: %s, password: %s' %
   ^
IndentationError: unexpected indent
2014-07-15 16:25:14,766 - INFO - - Using reviewboard.scmtools.svn.pysvn backend for SVN 2014-07-15 16:35:53,088 - INFO - - Using reviewboard.scmtools.svn.pysvn backend for SVN
2014-07-15 16:36:55,710 - DEBUG -  - SVN: username: None, password: None

As you can see at this point, username and password are both none. I created a hack by commenting out the exception code in ReviewBoard-2.0.2-py2.7.egg\reviewboard\scmtools\svn__init__.py but it is obviously not a proper fix:

def on_ssl_failure(e, path, cert_data):
        logging.error('SVN: Failed to get repository information '
                      'for %s: %s' % (path, e))
        #if 'callback_get_login required' in six.text_type(e):
        #    raise AuthenticationError(msg="Authentication failed")

        if cert_data:
            failures = cert_data['failures']

            reasons = []

            if failures & SVNCertificateFailures.NOT_YET_VALID:
                reasons.append(_('The certificate is not yet valid.'))

            if failures & SVNCertificateFailures.EXPIRED:
                reasons.append(_('The certificate has expired.'))

            if failures & SVNCertificateFailures.CN_MISMATCH:
                reasons.append(_('The certificate hostname does not '
                                 'match.'))

            if failures & SVNCertificateFailures.UNKNOWN_CA:
                reasons.append(_('The certificate is not issued by a '
                                 'trusted authority. Use the fingerprint '
                                 'to validate the certificate manually.'))

            raise UnverifiedCertificateError(
                Certificate(valid_from=cert_data['valid_from'],
                            valid_until=cert_data['valid_until'],
                            hostname=cert_data['hostname'],
                            realm=cert_data['realm'],
                            fingerprint=cert_data['finger_print'],
                            issuer=cert_data['issuer_dname'],
                            failures=reasons))

        #raise RepositoryNotFoundError()

Could you please help fix it properly?


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to