1896: Omitting the git repo path throws 500 error

Karr*****@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
Jan. 18, 2012
What version are you running?
ReviewBoard 1.5.1

What's the URL of the page containing the problem?
New repo creation

What steps will reproduce the problem?
1. Create a custom git repo
2. Fill in the raw file URL and remote path
3. Click save

What is the expected output? What do you see instead?
I expect to see a warning that the repo path is mandatory, but not specified. Instead, I get a 500 error, and this appears in the Apache error_log:

[Tue Nov 23 11:46:28 2010] [error] ERROR:root:Exception thrown for user admin at http://publictest4.fedoraproject.org/reviewboard/admin/db/scmtools/repository/1/
[Tue Nov 23 11:46:28 2010] [error]
[Tue Nov 23 11:46:28 2010] [error] 'path'
[Tue Nov 23 11:46:28 2010] [error] Traceback (most recent call last):
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 99, in get_response
[Tue Nov 23 11:46:28 2010] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/contrib/admin/options.py", line 225, in wrapper
[Tue Nov 23 11:46:28 2010] [error]     return self.admin_site.admin_view(view)(*args, **kwargs)
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
[Tue Nov 23 11:46:28 2010] [error]     response = view_func(request, *args, **kwargs)
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/contrib/admin/sites.py", line 186, in inner
[Tue Nov 23 11:46:28 2010] [error]     return view(request, *args, **kwargs)
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/db/transaction.py", line 240, in _commit_on_success
[Tue Nov 23 11:46:28 2010] [error]     res = func(*args, **kw)
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/contrib/admin/options.py", line 827, in change_view
[Tue Nov 23 11:46:28 2010] [error]     if form.is_valid():
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/reviewboard/scmtools/forms.py", line 578, in is_valid
[Tue Nov 23 11:46:28 2010] [error]     return (super(RepositoryForm, self).is_valid() and
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/forms/forms.py", line 119, in is_valid
[Tue Nov 23 11:46:28 2010] [error]     return self.is_bound and not bool(self.errors)
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/forms/forms.py", line 110, in _get_errors
[Tue Nov 23 11:46:28 2010] [error]     self.full_clean()
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/reviewboard/scmtools/forms.py", line 500, in full_clean
[Tue Nov 23 11:46:28 2010] [error]     return super(RepositoryForm, self).full_clean()
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/django/forms/forms.py", line 249, in full_clean
[Tue Nov 23 11:46:28 2010] [error]     self.cleaned_data = self.clean()
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/reviewboard/scmtools/forms.py", line 520, in clean
[Tue Nov 23 11:46:28 2010] [error]     self._verify_repository_path()
[Tue Nov 23 11:46:28 2010] [error]   File "/usr/lib/python2.4/site-packages/reviewboard/scmtools/forms.py", line 643, in _verify_repository_path
[Tue Nov 23 11:46:28 2010] [error]     path = self.cleaned_data['path']
[Tue Nov 23 11:46:28 2010] [error] KeyError: 'path'


What operating system are you using? What browser?
Red Hat Enterprise Linux 5.5
Firefox 3.6.12 and Chromium 8.0.560.0 both experience this.

Please provide any additional information below.
david
#1 david
  • +Component-Admin
#2 rcho*****@acun***** (Google Code) (Is this you? Claim this profile.)
Same for hg (seems obvious but worth mentioning) on Debian.

I guess it is a matter of blank=None in the django model.
#3 vinay******@gmai***** (Google Code) (Is this you? Claim this profile.)
I am facing the exact issue. Any Help please ?
#4 romainc*******@gmai***** (Google Code) (Is this you? Claim this profile.)
@vinay: read the description, you just need to specify the right fields (and among others, the repository path)
#5 ste****@gallaghe********* (Google Code) (Is this you? Claim this profile.)
Well, the problem is that the repo path should NOT be required if you're using the raw file URL and remote path.

Probably this could be better solved in the UI by having a set of fields revealed or hidden by selecting a "remote" vs "local" radiobutton.

(Just a suggestion)
#6 vinay******@gmai***** (Google Code) (Is this you? Claim this profile.)
Thanks guys for the update but I am specifying the "Mirror Path" and "Raw file URL mask" fields but not Path field, and this is causing the issue.
chipx86
#7 chipx86
This has been fixed in our git repo and will be part of the next 1.6 build.

A repo path is always required, though, for lookup purposes.
  • +Fixed
  • +Milestone-Release1.6.x
  • +david
#8 vinay******@gmai***** (Google Code) (Is this you? Claim this profile.)
Thanks.

I have a few questions.

1. So, is it mandatory to have a checkout of a git repository on the local disk? Can we avoid this?

2. If we use gitweb, without having a local checkout, can we setup git repositories (can you please brief it?)
chipx86
#9 chipx86
A git repository on the local disk hasn't been necessary since we released 1.5. You need a Path field, but that's just for repository matching. The raw file URL mask field can point to gitweb or other services to fetch the files necessary.

There's examples for this in http://www.reviewboard.org/docs/manual/dev/admin/configuration/repositories/#gitweb
#10 vinay******@gmai***** (Google Code) (Is this you? Claim this profile.)
Can you please let me know what is to be specified in Path field? I can see that 
"For git, this should be the path to the .git repository on the local disk.". How can I  point to a .git repository on local disk with out having a checkout?

I am using Reviewboard-1.5.1 version.
chipx86
#11 chipx86
It should be the origin. Same thing you would clone.

post-review will do a 'git remote show origin' and try to find a matching repository (comparing Path) on Review Board.
#12 vinay******@gmai***** (Google Code) (Is this you? Claim this profile.)
We have set the git repo config as follows:

Method 1
---------
Path: user@mydomain.com:test/test1.git
Mirror Path: user@mydomain.com:test/test1.git
Raw file URL mask: user@mydomain.com:test/test1.git

Method 2
---------
Path: user@mydomain.com:test/test1
Mirror Path: user@mydomain.com:test/test1
Raw file URL mask: user@mydomain.com:test/test1


The repos got added successfully but when I post for review it throws the following error

"Error creating review request: The repository path specified is not in the list of known repositories (code 206)"

What might be the issue?/ Are we missing something?

Thanks.