3512: Cannot add SSL Perforce repository

mohy*****@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
Aug. 26, 2014
What version are you running?
2.0.5

What's the URL of the page containing the problem?
http://localhost/reviewboard/admin/db/scmtools/repository/1/

What steps will reproduce the problem?
1. Add Perforce SSL repository 

What is the expected output? What do you see instead?
Repository is added and can be shown 

What operating system are you using? What browser?
IE/Windows/Bitnami deployment 
Also can repro on Ubuntu and Google Chrome 


Please provide any additional information below.

Whenever I try to add the repository it complains about "A verified SSL certificate is required to connect to this repository."
when I click "I trust this host" nothing happen and I cant add the repository 

Please see attached
david
#1 david
Can you check the reviewboard log files to see if there's anything in there?
  • +NeedInfo
#2 mohy*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Yes here is what I have in the log

 - Exception thrown for user admin at http://localhost/admin/db/scmtools/repository/1/

accept_certificate() got an unexpected keyword argument 'username'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/contrib/admin/options.py", line 450, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/contrib/admin/sites.py", line 198, in inner
    return view(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/db/transaction.py", line 371, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/contrib/admin/options.py", line 1229, in change_view
    if form.is_valid():
  File "/usr/lib/python2.7/site-packages/ReviewBoard-2.0.6-py2.7.egg/reviewboard/scmtools/forms.py", line 1024, in is_valid
    if not super(RepositoryForm, self).is_valid():
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/forms/forms.py", line 129, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/forms/forms.py", line 121, in errors
    self.full_clean()
  File "/usr/lib/python2.7/site-packages/ReviewBoard-2.0.6-py2.7.egg/reviewboard/scmtools/forms.py", line 813, in full_clean
    super(RepositoryForm, self).full_clean()
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/forms/forms.py", line 274, in full_clean
    self._clean_form()
  File "/usr/lib/python2.7/site-packages/Django-1.6.6-py2.7.egg/django/forms/forms.py", line 300, in _clean_form
    self.cleaned_data = self.clean()
  File "/usr/lib/python2.7/site-packages/ReviewBoard-2.0.6-py2.7.egg/reviewboard/scmtools/forms.py", line 862, in clean
    self._verify_repository_path()
  File "/usr/lib/python2.7/site-packages/ReviewBoard-2.0.6-py2.7.egg/reviewboard/scmtools/forms.py", line 1194, in _verify_repository_path
    certificate=e.certificate)
TypeError: accept_certificate() got an unexpected keyword argument 'username'
#3 mohy*****@gmai***** (Google Code) (Is this you? Claim this profile.)
I did just upgrade to 2.0.6, but its pretty much the same issue in 2.0.5
david
#4 david
Thanks for the traceback! We'll get this fixed for the next release.
  • -NeedInfo
    +Confirmed
  • +Component-SCMTools
    +Project-ReviewBoard
  • +david
david
#5 david
Fixed in release-2.0.x (fda8dd5). Thanks!
  • -Confirmed
    +Fixed
#6 mohy*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Thank you, just verified the fixed, its working.
When I added the perforce repo, I went to dashboard to create a review, but I wasnt able to see any of the commits to pick from and create a review (unlike github repo, it shows all of the commits.) Is this by design? 
david
#7 david
The post-commit UI feature is currently only available for GitHub and SVN repositories. Support for more will be coming in the future.
#9 mohy*****@gmai***** (Google Code) (Is this you? Claim this profile.)
I applied this fix locally, it works.
I was able to add SSL P4 repository
Now I am facing a problem where when you rbt setup-repo you have to have a mirror path to match with P4 info.
the server path for P4 sometimes will have something like Server address: ip-00-000-0-00.ec2.internal:1666
So in order to be able to add a repo for rbt you have to have such a thing in mirror path
Now this produce an issue when you try to post a review, where it try to use this IP to query the diff

To get unblocked I had to remove repository.mirror_path from line 272
maybe you should include this only when it have a valid address.