Error uploading new diff: fatal: Not a git repository: 'None'

2,831 views
Skip to first unread message

mhoydis

unread,
Jan 24, 2011, 5:58:46 PM1/24/11
to reviewboard
Trying to use post-review with our custom git setup. My repository is
configured in ReviewBoard with the path being
git@server:my_project.git. I've setup the SSH key in ReviewBoard to
use that git URL, and confirmed that's working. ReviewBoard 1.6
alpha 0 (dev)

I'm running this command on my Mac desktop:
git config reviewboard.url http://reviewboard.mydomain.com
post-review --parent=aa1c05d4bab33156cd3feaeb8ea6ed669eb92eee --
revision-range=aa1c05d4bab33156cd3feaeb8ea6ed669eb92eee:
1015d188c7d28c3b543b1e528ab34e8ee2a62cdf --guess-summary --guess-
description --publish --debug

---------------------------------------------

This is the error I'm getting from post-review on my Mac desktop:

>>> svn info
>>> git rev-parse --git-dir
>>> git symbolic-ref -q HEAD
>>> git svn info
>>> git svn --version
>>> git config --get svn-remote.svn.url
>>> git config --get branch.master.merge
>>> git config --get branch.master.remote
>>> git config remote.origin.url
>>> repository info: Path: git@server:my_project.git, Base path: , Supports changesets: False
>>> git config --get reviewboard.url
>>> git log --pretty=format:%s aa1c05d4bab33156cd3feaeb8ea6ed669eb92eee..1015d188c7d28c3b543b1e528ab34e8ee2a62cdf
>>> git log --pretty=format:%s%n%n%b aa1c05d4bab33156cd3feaeb8ea6ed669eb92eee..1015d188c7d28c3b543b1e528ab34e8ee2a62cdf
>>> git diff --no-color --full-index aa1c05d4bab33156cd3feaeb8ea6ed669eb92eee..1015d188c7d28c3b543b1e528ab34e8ee2a62cdf
>>> Looking for 'reviewboard.mydomain.com /' cookie in /Users/myuser/.post-review-cookies.txt
>>> Loaded valid cookie -- no login required
>>> Attempting to create review request on git@server:my_project.git for None
>>> HTTP POSTing to http://reviewboard.mydomain.com/api/json/reviewrequests/new/: {'repository_path': 'git@server:my_project.git'}
>>> Review request created
>>> Attempting to set field 'summary' to 'Blah Blah #3135 - Blah blah blah yadayadaydada * blH, BAH, bah, New(template) added * blah written for model, controller(blah, hey), and New hey * Refactored component and blah authorization specs into seperate files * Added Administration namespace' for review request '48'
>>> HTTP POSTing to http://reviewboard.mydomain.com/api/json/reviewrequests/48/draft/set/: {'summary': 'Blah Blah #3135 - Blah blah blah yadayadaydada * blH, BAH, bah, New(template) added * blah written for model, controller(blah, hey), and New hey * Refactored component and blah authorization specs into seperate files * Added Administration namespace'}
>>> Attempting to set field 'description' to 'Blah Blah #3135 - Blah blah blah yadayadaydada * blH, BAH, bah, New(template) added * blah written for model, controller(blah, hey), and New hey * Refactored component and blah authorization specs into seperate files * Added Administration namespace' for review request '48'
>>> HTTP POSTing to http://reviewboard.mydomain.com/api/json/reviewrequests/48/draft/set/: {'description': 'Blah Blah #3135 - Blah blah blah yadayadaydada * blH, BAH, bah, New(template) added * blah written for model, controller(blah, hey), and New hey * Refactored component and blah authorization specs into seperate files * Added Administration namespace'}
>>> Uploading diff, size: 32902
>>> HTTP POSTing to http://reviewboard.mydomain.com/api/json/reviewrequests/48/diff/new/: {}
>>> Got API Error 105 (HTTP code 200): One or more fields had errors
>>> Error data: {u'fields': {u'path': [u"fatal: Not a git repository: 'None'\n"]}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors', u'code': 105}, u'deprecated': {u'in_version': u'1.5'}}

Error uploading diff

The generated diff file was empty. This usually means no files were
modified in this change.

Try running with --output-diff and --debug for more information.

Your review request still exists, but the diff is not attached.







-------------------------------------

This is the error that's in apache's error.log on my server running
ReviewBoard:

ERROR:root:Error uploading new diff: fatal: Not a git repository:
'None'
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/webapi/json.py", line
1168, in new_diff
request.FILES.get('parent_diff_path'))
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/reviews/forms.py",
line 284, in create
history)
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/diffviewer/forms.py",
line 63, in create
diff_file, basedir, check_existance=(not parent_diff_file)))
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/diffviewer/forms.py",
line 149, in _process_files
not tool.file_exists(filename, revision))):
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/scmtools/git.py", line
75, in file_exists
return self.client.get_file_exists(path, revision)
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/scmtools/git.py", line
348, in get_file_exists
contents = self._cat_file(path, revision, "-t")
File "/usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6alpha0.dev-py2.6.egg/reviewboard/scmtools/git.py", line
394, in _cat_file
raise SCMError(errmsg)
SCMError: fatal: Not a git repository: 'None'



----------------------------------------------------




Any ideas? I've tried all sorts of variations of flags for the post-
review command to no avail. I think the issue is somewhere on the
server side. It seems somewhere my git URL is not being set ('None')
or perhaps ignored.
-Michael


Christian Hammond

unread,
Jan 24, 2011, 7:11:01 PM1/24/11
to revie...@googlegroups.com
Hi Michael,

Would you mind (privately, if you like) showing me the repository configuration on the server?

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com




--
Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en

mhoydis

unread,
Jan 25, 2011, 2:50:51 PM1/25/11
to reviewboard
Ahhhh, I got this to work.
In the repository's configuration in ReviewBoard, the "path" is the
path to a local clone of the git project. Like /clones/project/.git
The "Mirror Path" is whatever your project's origin is. Like
git@server:project.git

-Michael






On Jan 24, 7:11 pm, Christian Hammond <chip...@chipx86.com> wrote:
> Hi Michael,
>
> Would you mind (privately, if you like) showing me the repository
> configuration on the server?
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
>
> On Mon, Jan 24, 2011 at 2:58 PM, mhoydis <michael.hoy...@gmail.com> wrote:
> > Trying to use post-review with our custom git setup.  My repository is
> > configured in ReviewBoard with the path being
> > git@server:my_project.git.  I've setup the SSH key in ReviewBoard to
> > use that git URL, and confirmed that's working.   ReviewBoard 1.6
> > alpha 0 (dev)
>
> > I'm running this command on my Mac desktop:
> > git config reviewboard.urlhttp://reviewboard.mydomain.com
> > Happy user? Let us know athttp://www.reviewboard.org/users/
> > -~----------~----~----~----~------~----~------~--~---
> > To unsubscribe from this group, send email to
> > reviewboard...@googlegroups.com<reviewboard%2Bunsu...@googlegroups.com>

mhoydis

unread,
Jan 25, 2011, 11:25:57 AM1/25/11
to reviewboard
Sure. I think the notable clues here are...

>>> Attempting to create review request on git@server:my_project.git for None

and...

>>> Error data: {u'fields': {u'path': [u"fatal: Not a git repository: 'None'\n"]}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors', u'code': 105}, u'deprecated': {u'in_version': u'1.5'}}

and...

ERROR:root:Error uploading new diff: fatal: Not a git repository:
'None'

-------------


What value is "None" referring to, here?

-Michael










On Jan 24, 7:11 pm, Christian Hammond <chip...@chipx86.com> wrote:
> Hi Michael,
>
> Would you mind (privately, if you like) showing me the repository
> configuration on the server?
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
>
> On Mon, Jan 24, 2011 at 2:58 PM, mhoydis <michael.hoy...@gmail.com> wrote:
> > Trying to use post-review with our custom git setup.  My repository is
> > configured in ReviewBoard with the path being
> > git@server:my_project.git.  I've setup the SSH key in ReviewBoard to
> > use that git URL, and confirmed that's working.   ReviewBoard 1.6
> > alpha 0 (dev)
>
> > I'm running this command on my Mac desktop:
> > git config reviewboard.urlhttp://reviewboard.mydomain.com
> > Happy user? Let us know athttp://www.reviewboard.org/users/
> > -~----------~----~----~----~------~----~------~--~---
> > To unsubscribe from this group, send email to
> > reviewboard...@googlegroups.com<reviewboard%2Bunsu...@googlegroups.com>

Christian Hammond

unread,
Jan 26, 2011, 12:02:28 AM1/26/11
to revie...@googlegroups.com
Right, Path is what Review Board will use to access the files. Mirror Path is more of an Alias field (I intend to redo all that and make it a bit more clear).

If you have gitweb or something set up, you can make use of the raw URL mask instead, which will provide for a better setup. That's covered in the docs.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


Happy user? Let us know at http://www.reviewboard.org/users/

-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com

Christian Hammond

unread,
Jan 26, 2011, 12:02:55 AM1/26/11
to revie...@googlegroups.com
Honestly, I have no idea where None is coming from.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


Happy user? Let us know at http://www.reviewboard.org/users/

-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com

Christopher Orr

unread,
Feb 2, 2011, 8:12:00 AM2/2/11
to reviewboard
I just reproduced this while trying to use RB 1.5.2 with a custom
remote repository (git+ssh://).
By trial-and-error, it seems the 'None' error occurs if the "Raw file
URL mask" field is empty.

Is it correct to say there's no way to set up a git repository in
Review Board, if the git server is remote and you have no web-based
access to it?

Regards,
Chris


On Jan 26, 6:02 am, Christian Hammond <chip...@chipx86.com> wrote:
> Honestly, I have no idea where None is coming from.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
>
> > > >http://reviewboard.mydomain.com/api/json/reviewrequests/48/diff/new/:{}<http://reviewboard.mydomain.com/api/json/reviewrequests/48/diff/new/:...>
> > <reviewboard%2Bunsu...@googlegroups.com<reviewboard%252Buns...@googlegroups.com>

Stephen Gallagher

unread,
Feb 2, 2011, 2:42:08 PM2/2/11
to revie...@googlegroups.com
On 02/02/2011 08:12 AM, Christopher Orr wrote:
> I just reproduced this while trying to use RB 1.5.2 with a custom
> remote repository (git+ssh://).
> By trial-and-error, it seems the 'None' error occurs if the "Raw file
> URL mask" field is empty.
>
> Is it correct to say there's no way to set up a git repository in
> Review Board, if the git server is remote and you have no web-based
> access to it?

In that situation, I think what you would want to do is clone the git
repository locally and use a cron job to keep it up to date with the
remote repository. That's probably the only way around this.

Or, if you have control of the remote repository, add a post-commit hook
that notifies your clone to update itself (this would be less wasteful
of network resources).

Christian Hammond

unread,
Feb 2, 2011, 4:18:01 PM2/2/11
to revie...@googlegroups.com
Yeah, unfortunately, Git provides no way to access individual files from a remote repository without a full local clone, which is why the only two options are having that clone or accessing over gitweb or a similar service.

We should definitely do better validation to make sure you can never enter a remote URL without the raw file mask.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


--
Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/

-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com

Christopher Orr

unread,
Feb 2, 2011, 4:47:33 PM2/2/11
to reviewboard
Thanks for the confirmation.

Is there any chance of an option that just allows the full local clone
to be done over git (if the user says that's fine)?
Or would that be too strenuous on Review Board, as it would
(presumably) have to call "git clone" any time someone hits "Upload
diff"?

Chris


On Feb 2, 10:18 pm, Christian Hammond <chip...@chipx86.com> wrote:
> Yeah, unfortunately, Git provides no way to access individual files from a
> remote repository without a full local clone, which is why the only two
> options are having that clone or accessing over gitweb or a similar service.
>
> We should definitely do better validation to make sure you can never enter a
> remote URL without the raw file mask.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
>
> On Wed, Feb 2, 2011 at 11:42 AM, Stephen Gallagher <
>
>
>
>
>
>
>
> step...@gallagherhome.com> wrote:
> > On 02/02/2011 08:12 AM, Christopher Orr wrote:
> > > I just reproduced this while trying to use RB 1.5.2 with a custom
> > > remote repository (git+ssh://).
> > > By trial-and-error, it seems the 'None' error occurs if the "Raw file
> > > URL mask" field is empty.
>
> > > Is it correct to say there's no way to set up a git repository in
> > > Review Board, if the git server is remote and you have no web-based
> > > access to it?
>
> > In that situation, I think what you would want to do is clone the git
> > repository locally and use a cron job to keep it up to date with the
> > remote repository. That's probably the only way around this.
>
> > Or, if you have control of the remote repository, add a post-commit hook
> > that notifies your clone to update itself (this would be less wasteful
> > of network resources).
>
> > --
> > Want to help the Review Board project? Donate today at
> >http://www.reviewboard.org/donate/
> > Happy user? Let us know athttp://www.reviewboard.org/users/
> > -~----------~----~----~----~------~----~------~--~---
> > To unsubscribe from this group, send email to
> > reviewboard...@googlegroups.com<reviewboard%2Bunsubscribe@googlegr oups.com>

Christopher Orr

unread,
Feb 2, 2011, 4:49:21 PM2/2/11
to reviewboard
On Feb 2, 10:47 pm, Christopher Orr <ch...@orr.me.uk> wrote:
> Is there any chance of an option that just allows the full local clone
> to be done over git (if the user says that's fine)?
> Or would that be too strenuous on Review Board, as it would
> (presumably) have to call "git clone" any time someone hits "Upload
> diff"?

Oops, I meant "git pull", not a full "clone" each time.

Christian Hammond

unread,
Feb 2, 2011, 7:26:48 PM2/2/11
to revie...@googlegroups.com
Having Review Board manage the clone means adding new pieces of infrastructure for scheduling changes. At that point, you may as well use crontab.

We don't want Review Board to do the pulls on demand, because you may end up with two requests happening at once, each causing a pull and generating conflicts.

So it's something we basically need admins to handle themselves. The very easiest way is to get gitweb or something going.

We're considering rolling our own little thing to stick on a server with a Git repository that Review Board will be able to know about and talk to in an effort to simplify a lot of this, but we're not there yet.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


Happy user? Let us know at http://www.reviewboard.org/users/

-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages