Authentication failed while adding svn repository

1,049 views
Skip to first unread message

shravanthi s

unread,
Jul 8, 2014, 5:25:40 AM7/8/14
to revie...@googlegroups.com
Hi,

I have installed Review Board 2.0.2 on RHEL 6.5 machine. I installed subversion 1.6.11 and pysvn version 1.7.8. 
However when i tried to add a repository, even though my login credentials are correct, am unable to add it. It gives an error 'Authentication failed' . So currently review board is unusable.

The reviewboard log shows error as below

 ERROR -  - SVN: Failed to get repository information for https://test.com/svn/myfolder/Phoenix: callback_get_login required

Am not sure what is going wrong here. Anything to do with my pysvn version"?

shravanthi s

unread,
Jul 9, 2014, 12:38:29 AM7/9/14
to revie...@googlegroups.com


Any update on this? Am kinda stuck as review board in unusable right now. Can someone please point me in the right direction?

Christian Hammond

unread,
Jul 9, 2014, 3:36:27 PM7/9/14
to revie...@googlegroups.com
Can you verify that a username and password are provided in the repository configuration, and that those same credentials can be used if accessing SVN manually?

This error isn’t friendly (we’ll need to fix it), but it basically means that your credentials are incorrect.

Christian

-- 
Christian Hammond - chri...@beanbaginc.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

On July 8, 2014 at 9:38:31 PM, shravanthi s (shra...@gmail.com) wrote:



Any update on this? Am kinda stuck as review board in unusable right now. Can someone please point me in the right direction?
--
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shravanthi s

unread,
Jul 9, 2014, 11:24:16 PM7/9/14
to revie...@googlegroups.com
I have verified that credentials are correct and i can login using same credentials manually into svn. I also entered required credentials while adding repository info. It still gives the same error. Am not sure what else can go wrong here. Do you need any other information? I dont know what else to try, to fix this issue

shravanthi s

unread,
Jul 10, 2014, 6:55:35 AM7/10/14
to revie...@googlegroups.com
I tried this piece of code to check if pysvn was working fine

import pysvn
 
def login(realm, username, may_save):
    user = 'my_user'
    password = 'my_password'
    return True, user, password, False
 
def svnCo(repo_url,checkout_dir):
    client = pysvn.Client()
    client.callback_get_login = login
    client.checkout(repo_url,checkout_dir)
 
svnCo('https://my-svn-server.net/my-project','/data/local_repo/my-project/')

And it checked out the svn files without any issue. So it is nothing to do with svn link or credentials or pysvn version. 
What else do you think is causing the issue?



MoonWalker

unread,
Jul 11, 2014, 12:49:51 AM7/11/14
to revie...@googlegroups.com
If I remember well svn (in our case) will block the user if the credentials were wrong after 3 times. Have you tried to login in the reviewboard server and try to access the svn repository? 

shravanthi s

unread,
Jul 11, 2014, 6:52:50 AM7/11/14
to revie...@googlegroups.com
I have tried accessing the svn repo from the server and it works without any issue. So am not sure what else is causing the issue. Any pointers?

shravanthi s

unread,
Jul 12, 2014, 10:01:14 AM7/12/14
to revie...@googlegroups.com
Should i try to reinstall pysvn or subversion?

I have to get this working asap :( Can someone pls help me resolve this issue?

MoonWalker

unread,
Jul 13, 2014, 7:55:55 PM7/13/14
to revie...@googlegroups.com
Did you tried to enable logging to find out what is actually happening ?

shravanthi s

unread,
Jul 14, 2014, 1:45:47 AM7/14/14
to revie...@googlegroups.com
I have checked reviewboard.log and this is the only error which comes up in the log

 ERROR -  - SVN: Failed to get repository information for https://test.com/svn/myfolder/Phoenix: callback_get_login required

Any other log you want me to check?

Christian Hammond

unread,
Jul 14, 2014, 2:38:02 PM7/14/14
to revie...@googlegroups.com, shravanthi s
I wish I had an answer for you, but this is not typical behavior.

I’d try upgrading PySVN. I’d also delete your $sitedir/data/.subversion directory, to start from scratch.

Make sure the correct username and password are being used in the repository setup. Don’t specify a username in the URL.

If all that fails.. not sure, really. We’d have to investigate deeper by actually running code on your server, but we only offer that with support contracts.

Christian

-- 
Christian Hammond - chri...@beanbaginc.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

shravanthi s

unread,
Jul 15, 2014, 1:17:28 PM7/15/14
to revie...@googlegroups.com

Hi Christian,

Thanks for your suggestion. Let me try to upgrade pysvn and see if resolves the issue.


Message has been deleted

Alexis

unread,
Jul 16, 2014, 3:11:21 PM7/16/14
to revie...@googlegroups.com, shra...@gmail.com, chri...@beanbaginc.com
Hi Christian,

I am encountering the same issue. 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?

David Trowbridge

unread,
Jul 18, 2014, 4:51:55 PM7/18/14
to revie...@googlegroups.com, shra...@gmail.com, chri...@beanbaginc.com
It's expected that username and password would be None in the particular stack trace you included (since at that point it's just creating it to check that it can). The actual repository checking is a different code path that does include credentials.

-David

Alexis

unread,
Jul 18, 2014, 5:14:11 PM7/18/14
to revie...@googlegroups.com, shra...@gmail.com, chri...@beanbaginc.com
David,

Thanks for the response. All I am saying is that at that point of the code, it fails with authentication error not when it checks for the repository. I added log messages at the points where it checks for repository and it passes. It's at creation time that it fails not when it checks for the repository. After I comment out the exception so it can pass the creation without authentication, it passes the repository checking and the creation of a new repository. So there is one point where it tries to access the repository without authentication.

Maybe the error comes from from form.py, clean(self), self._verify_repository_path(), scmtool_class.check_repository(path, username, password,self.local_site_name)?

What can I do to debug this? Do you want me to put some logging printouts at any point of the code? I am obviously running at this point but with a monumental hack of commenting out error handling (exceptions).

Alexis

shravanthi s

unread,
Jul 19, 2014, 2:13:26 PM7/19/14
to revie...@googlegroups.com
I tried upgrading pysvn and upgraded my subversion as well. Still same error :(  . However when i try to save a repository with "Show this repository" option unchecked, then its able to save the repository. Am still seeing same error in logs. The only solution i can think of is to get rid of all installations and start on a clean slate! 

Holger

unread,
Jul 30, 2014, 3:40:16 AM7/30/14
to revie...@googlegroups.com
My Workaround:

I have the same problem but found a workaround inspired by Alexis' debug information:

Add the new repository with "Show this repository" option unchecked. Afterwards got directly to the database and change the visible flag for the repository in the table  scmtools_repository to 1.

Christian Hammond

unread,
Jul 30, 2014, 2:10:17 PM7/30/14
to revie...@googlegroups.com
Hi,

What version of Review Board? Are you using PySVN or Subvertpy?

Christian

--
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--
Christian Hammond - chi...@chipx86.com

Alexis Denis

unread,
Jul 30, 2014, 5:34:28 PM7/30/14
to revie...@googlegroups.com
Christian: Personally, I am running ReviewBoard 2.0.2 and I believe I am using the default which is PySVN. I still think it's the wrapper tools trying to access the repository without a username or password at first. The setup is simple and easy to reproduce: VisualSVN server with no public access and a user.
Holger: I am glad I am not the only one with this issue. I was starting to feel a little lonely. Glad to see you found your own workaround.
Alexis


You received this message because you are subscribed to a topic in the Google Groups "reviewboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard/r3Z_w3nJbkU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard...@googlegroups.com.

Christian Hammond

unread,
Jul 30, 2014, 5:42:42 PM7/30/14
to revie...@googlegroups.com, Alexis Denis
Hi Alexis,

From the code I’m seeing, it does look like we’re passing in the credentials. I am, however, seeing that we don’t pass in credentials when confirming an HTTPS certificate. Is that the point where things go wrong, or is it on the initial save?

Christian

-- 
Christian Hammond - chri...@beanbaginc.com

Alexis Denis

unread,
Jul 30, 2014, 6:09:38 PM7/30/14
to Christian Hammond, revie...@googlegroups.com
Hi Christian,
It is the original save: it fails even before asking to accept the SSL certificate (as mine is not signed by an authority, I have to accept it).
Alexis

Christian Hammond

unread,
Jul 30, 2014, 7:09:55 PM7/30/14
to revie...@googlegroups.com, Alexis Denis, revie...@googlegroups.com
Hi Alexis,

So, Review Board 2.0.2 is busted with SVN. That’s the primary cause of your problems. You need 2.0.3 or higher to have a working setup with a self-signed cert. (You should install 2.0.5 though.)

When trying to verify the issue, though, I hit some other problems with accepting a certificate. I’ve attached a patch that should smooth out another rough edge (though I don’t believe it’s required for this case, but may help if you hit any errors with a newer release.)

Christian

-- 
Christian Hammond - chri...@beanbaginc.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

0001-Pass-SVN-credentials-when-accepting-a-self-signed-ce.patch

Alexis Denis

unread,
Jul 30, 2014, 8:36:41 PM7/30/14
to Christian Hammond, revie...@googlegroups.com
Hi Christian,

It worked! No hitch. No need to install the patch.

Thanks,

Alexis

Jeffrey Javier

unread,
Feb 15, 2015, 10:30:58 PM2/15/15
to revie...@googlegroups.com, chri...@beanbaginc.com
Good day Alexis!
Do you mind sharing the fix for this issue? You just downloaded version 2.0.5 and it worked? please do share the link thanks :)
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscribe@googlegroups.com.

Alexis Denis

unread,
Feb 16, 2015, 10:25:03 AM2/16/15
to revie...@googlegroups.com
Hello Jeffrey,
The fix was to use PySVN which is the default in 2.0.5. Upgrading to 2.0.5 fixed it. I am sure you can download the latest version of Reviewboard and it would work https://www.reviewboard.org/downloads/.
At the time, I was also using the Bitnami installer for Reviewboard: https://bitnami.com/stack/reviewboard
Alexis

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
Reply all
Reply to author
Forward
0 new messages