The specified diff file could not be parsed.

2,836 views
Skip to first unread message

Jonathan Anderson

unread,
Feb 9, 2015, 8:49:44 PM2/9/15
to revie...@googlegroups.com
I am getting the following error whenever I attempt to "rbt post" a change that contains updates to an existing file.
Posting a change containing a single new file works as expected.

I have attached a fiddler archive with the reviewboard request.

I am using an ssh git repository. I am accessing the reviewboard instance from Windows 8.1 using RBTools for Windows.



$ rbt post --debug
>>> RBTools 0.7
>>> Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
>>> Running on Windows-8-6.2.9200
>>> Home = C:\Users\janderson\AppData\Roaming
>>> Current directory = c:\work
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.test.merge
>>> Running: git config --get branch.test.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: git@q-git:/opt/git/quosal.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://codereview/api/
>>> Cached response for HTTP GET http://codereview/api/ expired and was modified
>>> Running: git rev-parse refs/heads/test
>>> Running: git merge-base 7c9e3a6183f52cd33e4a203c6d53b46b6748c7af origin/master
>>> Running: git rev-parse dd3d91bf5665f5d3bf022b6ec170fdd96b8a6ac4
>>> Running: git status --porcelain --untracked-files=no
>>> Running: git diff --no-color --full-index --ignore-submodules -M --no-ext-diff dd3d91bf5665f5d3bf022b6ec170fdd96b8a6ac4..7c9e3a6183f52cd33e4a203c6d53b46b6748c7af
>>> Making HTTP GET request to http://codereview/api/validation/
>>> Cached response for HTTP GET http://codereview/api/validation/ expired and was not modified
>>> Making HTTP GET request to http://codereview/api/validation/diffs/
>>> Cached response for HTTP GET http://codereview/api/validation/diffs/ expired and was modified
>>> Making HTTP POST request to http://codereview/api/validation/diffs/
>>> Got API Error 224 (HTTP code 400): The specified diff file could not be parsed.
>>> Error data: {u'stat': u'fail', u'reason': u"fatal: Not a git repository: 'None'\n", u'err': {u'msg': u'The specified diff file could not be parsed.', u'code': 224}}
Traceback (most recent call last):
  File "c:/Program Files (x86)/RBTools/Python27/Scripts/rbt-script.py", line 8, in <module>
    load_entry_point('RBTools==0.7', 'console_scripts', 'rbt')()
  File "c:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7-py2.7.egg\rbtools\commands\main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "c:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7-py2.7.egg\rbtools\commands\__init__.py", line 538, in run_from_argv
    exit_code = self.main(*args) or 0
  File "c:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7-py2.7.egg\rbtools\commands\post.py", line 662, in main
    (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

The specified diff file could not be parsed. (HTTP 400, API Error 224)

Reviewboard Diff File Could Not Be Parsed.saz

Liam Reimers

unread,
Feb 12, 2015, 7:11:50 PM2/12/15
to revie...@googlegroups.com
I'm having this exact issue as well. Is there any additional information I can post to help troubleshoot?

>>> RBTools 0.7.1
>>> Python 2.6.9 (unknown, Sep  9 2014, 15:05:12) 

David Trowbridge

unread,
Feb 12, 2015, 7:16:23 PM2/12/15
to revie...@googlegroups.com
Would it be possible for you to test with the just-released 2.0.13? We've improved several aspects of parsing git diffs.

-David

--
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/
---
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.

Liam Reimers

unread,
Feb 13, 2015, 9:58:46 AM2/13/15
to revie...@googlegroups.com
using git, I am on a local branch that has diverged from master (and origin/master) by one commit.

I upgraded to 2.0.13, and I get the same error when trying to post a review. I honestly feel this is a problem in the tool:

06:40 $ rbt post -g yes --bugs-closed 19788098  -d
>>> RBTools 0.7.1
>>> Python 2.6.9 (unknown, Sep  9 2014, 15:05:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
>>> Running on Darwin-14.1.0-x86_64-i386-64bit
>>> Home = /Users/user
>>> Current directory = /Users/user/Code/repo
>>> Checking for a Subversion repository...
>>> Running: svn info --non-interactive
>>> Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: E155007: '/Users/user/Code/repo' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.PR19788098.merge
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.PR19788098.merge']
---
>>> Running: git config --get branch.PR19788098.remote
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.PR19788098.remote']
---
>>> Running: git config --get remote.origin.url
>>> repository info: Path: git@server:path/repo, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard/api/
>>> Cache directory '/Users/user/Library/Caches/rbtools' does not exist; creating.
>>> API cache '/Users/user/Library/Caches/rbtools/apicache.db' does not exist; creating.
>>> Running: git rev-parse refs/heads/PR19788098
>>> Running: git merge-base 3eea08c87f4ee336ec0d25108bc0224e7bbf5213 origin/master
>>> Running: git rev-parse 62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8
>>> Running: git status --porcelain --untracked-files=no
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff 62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8..3eea08c87f4ee336ec0d25108bc0224e7bbf5213
>>> Making HTTP GET request to http://reviewboard/api/validation/diffs/
>>> Added cache entry for HTTP GET request to http://reviewboard/api/validation/diffs/
>>> Making HTTP POST request to http://reviewboard/api/validation/diffs/
>>> Got API Error 224 (HTTP code 400): The specified diff file could not be parsed.
>>> Error data: {u'stat': u'fail', u'reason': u"fatal: Not a git repository: 'None'\n", u'err': {u'msg': u'The specified diff file could not be parsed.', u'code': 224}}
Traceback (most recent call last):
  File "/usr/local/bin/rbt", line 8, in <module>
    load_entry_point('RBTools==0.7.1.dev', 'console_scripts', 'rbt')()
  File "/Library/Python/2.6/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/Library/Python/2.6/site-packages/rbtools/commands/__init__.py", line 538, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/Library/Python/2.6/site-packages/rbtools/commands/post.py", line 670, in main
    (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

The specified diff file could not be parsed. (HTTP 400, API Error 224)


However:

06:53 $ rbt post -g yes --bugs-closed 19788098 -d HEAD~
>>> RBTools 0.7.1
>>> Python 2.6.9 (unknown, Sep  9 2014, 15:05:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
>>> Running on Darwin-14.1.0-x86_64-i386-64bit
>>> Home = /Users/user
>>> Current directory = /Users/user/Code/repo
>>> Checking for a Subversion repository...
>>> Running: svn info --non-interactive
>>> Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: E155007: '/Users/user/Code/repo' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.PR19788098.merge
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.PR19788098.merge']
---
>>> Running: git config --get branch.PR19788098.remote
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.PR19788098.remote']
---
>>> Running: git config --get remote.origin.url
>>> repository info: Path: git@server:path/repo.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard/api/
>>> Running: git rev-parse HEAD~
>>> Running: git rev-parse 62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8^
>>> Running: git merge-base f7915b2b91f8f7d6cfa85e5046330e379754fbf4 origin/master
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff f7915b2b91f8f7d6cfa85e5046330e379754fbf4..62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8
>>> Making HTTP GET request to http://reviewboard/api/validation/diffs/
>>> Cached response for HTTP GET http://reviewboard/api/validation/diffs/ expired and was modified
>>> Making HTTP POST request to http://reviewboard/api/validation/diffs/
>>> Running: git log --reverse --pretty=format:%s%n%n%b ^f7915b2b91f8f7d6cfa85e5046330e379754fbf4 62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8
>>> Making HTTP POST request to http://reviewboard/api/review-requests/
>>> Added cache entry for HTTP GET request to http://reviewboard/api/review-requests/2/diffs/?only-fields=
>>> Making HTTP POST request to http://reviewboard/api/review-requests/2/diffs/
>>> Added cache entry for HTTP GET request to http://reviewboard/api/review-requests/2/draft/?only-fields=commit_id
Review request #2 posted.


This, of course, posts a diff for the n-1 commit in the branch.

If I do:

rbt post -g yes --bugs-closed 19788098 -d HEAD

I get the identical output as the first attempt, with no revision specified.

Liam Reimers

unread,
Feb 13, 2015, 9:59:21 AM2/13/15
to revie...@googlegroups.com
Is there a way to see what diff is being posted by the tool?

Liam Reimers

unread,
Feb 13, 2015, 10:05:56 AM2/13/15
to revie...@googlegroups.com
I should also note that HEAD is a modification of an existing file, and HEAD~1 was adding a new file. Sort of reminds me of: https://groups.google.com/forum/#!topic/reviewboard/U-pVdasCWxw

However, I don't get the error in that thread.

Christian Hammond

unread,
Feb 13, 2015, 2:59:30 PM2/13/15
to revie...@googlegroups.com, Liam Reimers
Does the problem go away if the local branch is rebased back onto master again?

There is a known issue with the tool when the branch isn't up-to-date with regard to its tracking branch. We're working on a set of improvements to this logic that will hopefully resolve this.
Christian

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

Liam Reimers

unread,
Feb 13, 2015, 4:22:55 PM2/13/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com

Does the problem go away if the local branch is rebased back onto master again?

No, it does not. I checkout out master, merged the branch (single change), and ran:

rbt post -g yes --bugs-closed 19788098 -d

It had the same output, ending with:

>>> Error data: {u'stat': u'fail', u'reason': u"fatal: Not a git repository: 'None'\n", u'err': {u'msg': u'The specified diff file could not be parsed.', u'code': 224}}
Traceback (most recent call last):
  File "/usr/local/bin/rbt", line 8, in <module>
    load_entry_point('RBTools==0.7.1.dev', 'console_scripts', 'rbt')()
  File "/Library/Python/2.6/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/Library/Python/2.6/site-packages/rbtools/commands/__init__.py", line 538, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/Library/Python/2.6/site-packages/rbtools/commands/post.py", line 670, in main

Christian Hammond

unread,
Feb 13, 2015, 4:28:31 PM2/13/15
to revie...@googlegroups.com, Liam Reimers, liam.r...@gmail.com
Ah, I just saw part of your error: "Not a git repository: 'None.'"

How is your repository configured in Review Board?

Christian

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

-----Original Message-----
From: Liam Reimers <liam.r...@gmail.com>
Reply: Liam Reimers <liam.r...@gmail.com>>
Date: February 13, 2015 at 1:22:57 PM
To: revie...@googlegroups.com <revie...@googlegroups.com>>
Cc: liam.r...@gmail.com <liam.r...@gmail.com>>, chri...@beanbaginc.com <chri...@beanbaginc.com>>
Subject:  Re: The specified diff file could not be parsed.

>
>
> > Does the problem go away if the local branch is rebased back onto master
> > again?
> >
>
> No, it does not. I checkout out master, merged the branch (single change),
> and ran:
>
> rbt post -g yes --bugs-closed 19788098 -d
>
> It had the same output, ending with:
>
> >>> Error data: {u'stat': u'fail', u'reason': u"fatal: Not a git
> repository: 'None'\n", u'err': {u'msg': u'The specified diff file could not
> be parsed.', u'code': 224}}
> Traceback (most recent call last):
> File "/usr/local/bin/rbt", line 8, in

Liam Reimers

unread,
Feb 13, 2015, 6:40:51 PM2/13/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com

Ah, I just saw part of your error: "Not a git repository: 'None.'"

How is your repository configured in Review Board?

Name - Repository
Hosting - None (custom) 
Type - Git
Path - git@server:path/repo.git

However, note that the client can post a review request using one invocation (with HEAD~) and not the other, so it would seem that the repo is configured correctly?

Christian Hammond

unread,
Feb 14, 2015, 3:26:28 AM2/14/15
to revie...@googlegroups.com, Liam Reimers, liam.r...@gmail.com
Unfortunately, that configuration can't work, unless there's also a raw file URL field that's filled out. Git's protocol has no ability to fetch the kind of information we need remotely, including individual files.

For Git, it's a requirement to either host the repository on the Review Board server (or through something like an NFS mount), or to use a service like GitWeb. GitWeb is the recommended route right now (though we're working on a service to help make all this easier).

If the other changes were successfully posting, my guess is that they were introducing new files, which doesn't require communication with the repository. Otherwise, there's no way that the file verification could have worked with a remote Git path.

Christian

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

-----Original Message-----
From: Liam Reimers <liam.r...@gmail.com>
Reply: Liam Reimers <liam.r...@gmail.com>>
Date: February 13, 2015 at 3:40:54 PM
To: revie...@googlegroups.com <revie...@googlegroups.com>>
Cc: liam.r...@gmail.com <liam.r...@gmail.com>>, chri...@beanbaginc.com <chri...@beanbaginc.com>>
Subject:  Re: The specified diff file could not be parsed.

>
>

Jonathan Anderson

unread,
Feb 16, 2015, 12:45:27 PM2/16/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com
It sounds like this is a documentation issue then. I don't believe that, in the process of setting up our reviewboard, there was an indication that the repository needed to be hosted locally. In fact, the repository settings in the UI suggested otherwise.

I'll give this a try and update back here.

Jonathan Anderson

unread,
Feb 16, 2015, 1:31:14 PM2/16/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com
It's occurring to me that right now, I have a bare repository and intend to keep it that way if I can. If I were to have the reviewboard instance accessing git directly through the file system, would it need a working directory in order to function?

Is there a way I could set up a git repo on the reviewboard server, tracking our remote, and simply have it fetch when it needs to verify any files?

Jonathan Anderson

unread,
Feb 16, 2015, 1:53:02 PM2/16/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com
Now that I know what was wrong with my configuration, I was able to find the appropriate documentation. Not sure whether I should have seen this going through the first time and just missed it.
Message has been deleted

Liam Reimers

unread,
Feb 18, 2015, 11:12:51 AM2/18/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com
After fiddling with this some more, I ended up discarding the repo config and creating a new config as a Gitlab repo. This seems to have worked, however, when I try to post a review:

08:03 $ rbt post -g yes --bugs-closed 19788098 -d
>>> RBTools 0.7.1
>>> Python 2.6.9 (unknown, Sep  9 2014, 15:05:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
>>> Running on Darwin-14.1.0-x86_64-i386-64bit
>>> Home = /Users/user
>>> Current directory = /Users/user/Code/repo
>>> Checking for a Subversion repository...
>>> Running: svn info --non-interactive
>>> Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: E155007: '/Users/user/Code/repo' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.PR19788098.merge
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.PR19788098.merge']
---
>>> Running: git config --get branch.PR19788098.remote
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.PR19788098.remote']
---
>>> Running: git config --get remote.origin.url
>>> repository info: Path: https://gitlab/group/repo.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard/api/
>>> Running: git rev-parse refs/heads/PR19788098
>>> Running: git merge-base 3eea08c87f4ee336ec0d25108bc0224e7bbf5213 origin/master
>>> Running: git rev-parse 62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8
>>> Running: git status --porcelain --untracked-files=no
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff 62ca39aa4ab94b9f0b5f55e75ce8138b63c8b1d8..3eea08c87f4ee336ec0d25108bc0224e7bbf5213
>>> Making HTTP GET request to http://reviewboard/api/validation/diffs/
>>> Cached response for HTTP GET http://reviewboard/api/validation/diffs/ expired and was modified
>>> Making HTTP POST request to http://reviewboard/api/validation/diffs/
>>> Got HTTP error: 502: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/api/validation/diffs/">POST&nbsp;/api/validation/diffs/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
<hr>
<address>Apache/2.2.15 (Oracle) Server at reviewboard Port 80</address>
</body></html>

Traceback (most recent call last):
  File "/usr/local/bin/rbt", line 8, in <module>
    load_entry_point('RBTools==0.7.1.dev', 'console_scripts', 'rbt')()
  File "/Library/Python/2.6/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/Library/Python/2.6/site-packages/rbtools/commands/__init__.py", line 538, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/Library/Python/2.6/site-packages/rbtools/commands/post.py", line 670, in main
    (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

HTTP 502

Christian Hammond

unread,
Feb 18, 2015, 2:34:45 PM2/18/15
to Liam Reimers, revie...@googlegroups.com
Hi Liam,

This sounds like you're proxy server is being used for requests to your internal Review Board, which the proxy server is failing to access properly.

I'm on the road so I can't give you exact details, but there's a command line option and configuration flag for telling RBTools to skip using your proxy server. --no-proxy, I want to say.

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

Jonathan Anderson

unread,
Feb 18, 2015, 2:44:56 PM2/18/15
to revie...@googlegroups.com, liam.r...@gmail.com, chri...@beanbaginc.com
Mounting the git repository using NFS, and accessing it directly using the Path field in setup and clearing out the Mirror Path, my issue appears to be resolved. Thanks!

edo...@163.com

unread,
Jun 20, 2016, 6:02:08 AM6/20/16
to reviewboard
Hi all,

I'm also facing this problem... I'm using latest Reviewboard 2.5.5 . Any solution?

===
>>> Making HTTP POST request to http://192.168.0.170:8010/api/validation/diffs/ >>> Got API Error 224 (HTTP code 400): fatal: Not a git repository: 'None'  >>> Error data: {u'stat': u'fail', u'err': {u'msg': u"fatal: Not a git repository: 'None'\n", u'code': 224}} Traceback (most recent call last):   File "/usr/local/bin/rbt", line 9, in <module>     load_entry_point('RBTools==0.7.6.dev0', 'console_scripts', 'rbt')()   File "/Library/Python/2.6/site-packages/rbtools/commands/main.py", line 133, in main     command.run_from_argv([RB_MAIN, command_name] + args)   File "/Library/Python/2.6/site-packages/rbtools/commands/__init__.py", line 629, in run_from_argv     exit_code = self.main(*args) or 0   File "/Library/Python/2.6/site-packages/rbtools/commands/post.py", line 756, in main     (msg_prefix, e)) rbtools.commands.CommandError: Error validating diff  fatal: Not a git repository: 'None'  (HTTP 400, API Error 224)

Thanks,
Huan




在 2015年2月10日星期二 UTC+8上午9:49:44,Jonathan Anderson写道:
Reply all
Reply to author
Forward
0 new messages