Empty Diff

173 views
Skip to first unread message

Jeff Mickey

unread,
Oct 9, 2008, 5:46:59 PM10/9/08
to reviewboard
I'm using perforce with ReviewBoard, and when I post a review it can
never generate the diff. This is the error it sends me:
------------------------------------------------
The patch to '//some/place/in/perforce/yes/this/is/fake_sysctl.h'
didn't apply cleanly. The temporary files have been left in '/tmp/
reviewboard.zoa6PK' for debugging purposes. `patch` returned: patching
file /tmp/reviewboard.zoa6PK/tmpCk02zP Hunk #1 FAILED at 10. 1 out of
1 hunk FAILED -- saving rejects to file /tmp/reviewboard.zoa6PK/
tmpCk02zP-new.rej

Traceback (most recent call last):
File "/srv/reviewboard/diffviewer/views.py", line 86, in view_diff
files = get_diff_files(diffset, None, interdiffset, highlighting)
File "/root/reviewboard/diffviewer/diffutils.py", line 651, in
get_diff_files
File "/root/reviewboard/diffviewer/diffutils.py", line 567, in
generate_files
File "/root/reviewboard/djblets/util/misc.py", line 55, in
cache_memoize
File "/root/reviewboard/diffviewer/diffutils.py", line 570, in
<lambda>
File "/root/reviewboard/diffviewer/diffutils.py", line 338, in
get_chunks
File "/root/reviewboard/diffviewer/diffutils.py", line 254, in
get_patched_file
File "/root/reviewboard/diffviewer/diffutils.py", line 122, in patch
Exception: The patch to '//some/place/in/perforce/yes/this/is/
fake_sysctl.h_sysctl.h' didn't apply cleanly. The temporary files have
been left in '/tmp/reviewboard.zoa6PK' for debugging purposes.
`patch` returned: patching file /tmp/reviewboard.zoa6PK/tmpCk02zP
Hunk #1 FAILED at 10.
1 out of 1 hunk FAILED -- saving rejects to file /tmp/
reviewboard.zoa6PK/tmpCk02zP-new.rej
------------------------------

When I look at /tmp/reviewboard.zoa6PK/tmpCk02zP , it's just an empty
file, which leads me to believe that it'

Jeff Mickey

unread,
Oct 9, 2008, 5:50:26 PM10/9/08
to reviewboard
On Oct 9, 5:46 pm, Jeff Mickey <code...@gmail.com> wrote:
> [..]
>
> When I look at  /tmp/reviewboard.zoa6PK/tmpCk02zP , it's just an empty
> file, which leads me to believe that it'

I accidentally hit send, here's the rest:

When I look at /tmp/reviewboard.zoa6PK/tmpCk02zP , it's just an empty
file, which leads me to believe that reviewboard for some reason can't
connect to perforce correctly to get the original file. Also a lot of
those file paths are incorrect, as they correspond to /root instead
of /srv/reviewboard where they live. That may relate to the other
errors I was getting (posted earlier in this group at :
http://groups.google.com/group/reviewboard/browse_thread/thread/ccf52133b95a2e05/e3f824b06f697725)

Thanks for any help.

Jeff Mickey

unread,
Oct 15, 2008, 3:38:50 PM10/15/08
to reviewboard
After a decent amount of monkeying around this afternoon, I've still
gotten nowhere. It appears that the DiffSet and FileDiff objects are
just fine... it's just for some reason when it gets the source file
and puts it in /tmp.. it's empty. So everything from then on breaks
during get_diff_files. This is really frustrating as I can't seem to
get an error, just a bunch of weird behaviour around having a blank
source file. Not to mention I don't see where it's going to the P4
repository to pick this file up again.

Any help appreciated...
// jeff

Christian Hammond

unread,
Oct 16, 2008, 5:23:21 AM10/16/08
to revie...@googlegroups.com
Can you show me the output of post-review --debug? (Be sure to strip out sensitive info).

Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.

Christian Hammond

unread,
Oct 16, 2008, 5:28:20 AM10/16/08
to revie...@googlegroups.com
Also, it'd be helpful to find out what we're actually seeing from the Perforce server as soon as we attempt to fetch it.

If you turn on logging, do you see any "Fetch file ..." log statements? They should show the patch and the revision.


Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.


Jeff Mickey

unread,
Oct 17, 2008, 10:45:47 AM10/17/08
to reviewboard
Here's what happens when I do a post-review -d 837119:

>>> Repository info 'Path: fake-server:1666, Base path: None, Supports changesets: True'
>>> Generating diff for changenum 837119
>>> p4 describe -s 837119
>>> Pending diff
>>> p4 client -o
>>> Client from client spec: jmickey:smokejumper
>>> Client from change description: jmickey:smokejumper
>>> Processing edit of //some/awesome/file_sysctl.c
>>> Writing "//some/awesome/file_sysctl.c#13" to "/tmp/tmpB_wTIQ"
>>> p4 print -q //some/awesome/file_sysctl.c#13
>>> p4 where //some/awesome/file_sysctl.c
>>> diff_cmd = ['diff', '-urNp', '/tmp/tmpB_wTIQ', '/home/me/path/to/some/file_sysctl.c\n']
>>> diff -urNp /tmp/tmpB_wTIQ /home/me/path/to/some/file_sysctl.c

[... repeats for other files ...]

>>> Looking for 'reviewboard.server.com /' cookie in /home/me.post-review-cookies.txt
>>> Loaded valid cookie -- no login required
>>> Attempting to create review request for 837119
>>> HTTP POSTing to http://reviewboard.server.com/api/json/reviewrequests/new/: {'repository_path': 'fake-server:1666', 'changenum': '837119'}
>>> Review request already exists. Updating it...
>>> HTTP POSTing to http://reviewboard.server.com/api/json/reviewrequests/10/update_from_changenum/: {}
>>> Review request created
>>> Uploading diff, size: 37020
>>> HTTP POSTing to http://reviewboard.server.com/api/json/reviewrequests/10/diff/new/: {}
Review request #10 posted.

http://reviewboard.server.com/r/10

I go to that link and I get:

The patch to '//some/awesome/file_sysctl.h' didn't apply cleanly. The
temporary files have been left in '/tmp/reviewboard.r8lZqM' for
debugging purposes. `patch` returned: patching file /tmp/
reviewboard.r8lZqM/tmpk3CBf_ Hunk #1 FAILED at 10. 1 out of 1 hunk
FAILED -- saving rejects to file /tmp/reviewboard.r8lZqM/tmpk3CBf_-
new.rej

Traceback (most recent call last):
File "/srv/reviewboard/diffviewer/views.py", line 86, in view_diff
files = get_diff_files(diffset, None, interdiffset, highlighting)
File "/root/reviewboard/diffviewer/diffutils.py", line 651, in
get_diff_files
File "/root/reviewboard/diffviewer/diffutils.py", line 567, in
generate_files
File "/root/reviewboard/djblets/util/misc.py", line 55, in
cache_memoize
File "/root/reviewboard/diffviewer/diffutils.py", line 570, in
<lambda>
File "/root/reviewboard/diffviewer/diffutils.py", line 338, in
get_chunks
File "/root/reviewboard/diffviewer/diffutils.py", line 254, in
get_patched_file
File "/root/reviewboard/diffviewer/diffutils.py", line 122, in patch
Exception: The patch to '//some/awesome/file_sysctl.h' didn't apply
cleanly. The temporary files have been left in '/tmp/
reviewboard.r8lZqM' for debugging purposes.
`patch` returned: patching file /tmp/reviewboard.r8lZqM/tmpk3CBf_
Hunk #1 FAILED at 10.
1 out of 1 hunk FAILED -- saving rejects to file /tmp/
reviewboard.r8lZqM/tmpk3CBf_-new.rej

And the relevant part of the log relating to that is:

2008-10-16 11:45:19,751 - INFO - Logging to /srv/reviewboard/
logsnstuff/reviewboard.log with a minimum level of DEBUG
2008-10-16 11:45:19,752 - INFO - Log file for Review Board v0.9
2008-10-16 11:45:20,273 - DEBUG - DiffParser.parse: Beginning parse of
diff, size = 37020
2008-10-16 11:45:20,286 - DEBUG - DiffParser.parse: Finished parsing
diff.
2008-10-16 11:46:04,917 - INFO - Logging to /srv/reviewboard/
logsnstuff/reviewboard.log with a minimum level of DEBUG
2008-10-16 11:46:04,917 - INFO - Log file for Review Board v0.9
2008-10-16 11:46:05,004 - DEBUG - Generating diff viewer page for
filediff id 4
2008-10-16 11:46:05,004 - DEBUG - Begin: Generating diff file info for
diffset id 4
2008-10-16 11:46:05,009 - DEBUG - Begin: Patching file //some/awesome/
file_sysctl.h
2008-10-16 11:46:05,026 - DEBUG - End: Patching file //some/awesome/
file_sysctl.h
2008-10-16 11:46:05,027 - DEBUG - Patching file //some/awesome/
file_sysctl.h took 0.17047 seconds

And yes, it stops there, even though there are other files. I suspect
that is because of the first diff breaking. I'm just not sure what to
change on this server to get it working . Thanks for your help!

// jeff

Christian Hammond

unread,
Oct 17, 2008, 3:44:38 PM10/17/08
to revie...@googlegroups.com
Okay, now that is pretty important. I know you normalized the debug output to prevent any leaked info, but are you sure the file paths were all "/" and not a mix of "/" and "\" ?

Can you run with --output-diff and then see if that applies to a new checkout, or if not, what the reject files contain?


Christian

--
Christian Hammond - chi...@chipx86.com
VMware, Inc.


Jeff Mickey

unread,
Oct 20, 2008, 1:45:19 PM10/20/08
to reviewboard
On Oct 17, 3:44 pm, "Christian Hammond" <chip...@chipx86.com> wrote:
> Okay, now that is pretty important. I know you normalized the debug output
> to prevent any leaked info, but are you sure the file paths were all "/" and
> not a mix of "/" and "\" ?

It is only /

> Can you run with --output-diff and then see if that applies to a new
> checkout, or if not, what the reject files contain?

Well, it doesn't without modifying the diff slightly. I mean the
patchfile that it generates has "//depot/stuff/thebranch/the/file.c"
as the paths to the patched files, so when I get rid of the depot and
branch name in the path it applies cleanly. The server still wont
take diffs, and the resulting tmpfiles are empty except the *.diff and
*.rej, which contain the diff, and the rejected part of the diff (the
whole thing).
Reply all
Reply to author
Forward
0 new messages