3398: Error displaying this diff

hit****@gmai***** (Google Code) (Is this you? Claim this profile.)
Oct. 30, 2014
What version are you running? 2,0,1


What's the URL of the page containing the problem? r/218/diff/#


What steps will reproduce the problem?
1. Manually upload a diff
2. Go to diff section in review request
3. See There was an error displaying this diff.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/views.py", line 236, in get
    renderer = self.create_renderer(context, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/reviews/views.py", line 1102, in create_renderer
    *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/views.py", line 326, in create_renderer
    self.diff_file = self._get_requested_diff_file()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/views.py", line 367, in _get_requested_diff_file
    request=self.request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 373, in populate_diff_chunks
    chunks = generator.get_chunks()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 148, in get_chunks
    large_data=True)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/cache/backend.py", line 109, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 147, in <lambda>
    lambda: list(self._get_chunks_uncached()),
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 155, in _get_chunks_uncached
    new = get_patched_file(old, self.filediff, self.request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 201, in get_patched_file
    return patch(diff, buffer, filediff.dest_file, request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 139, in patch
    'output': stderr,
Exception: The patch to 'python/biicode/client/test/integration/publish/simple_publish_test.py' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.eEHskq' for debugging purposes.
`patch` returned: 

What is the expected output? What do you see instead? The diff I uploaded, as it is


What operating system are you using? Ubuntu 12.04 for the server, accessing from Mac or win  What browser? Chrome
chipx86
#1 chipx86
You'll need to talk to your administrator about this. There's nothing we can do without the diff.
#2 hit****@gmai***** (Google Code) (Is this you? Claim this profile.)
I'm my administrator, I don't know whats speciall about that diff and is happening with others as well
chipx86
#3 chipx86
Okay, my apologies. We get these questions a lot on here and they're usually from general users on a server.

First thing to check is the files in the temp directory provided in that error. See if the diff looks correct, and whether the source file looks correct. Check the .rej file to see what failed to patch. You can also copy those files and attempt to patch the source file with the patch in the directory and see what patch says.

These issues are often things like mixed line endings or some strangely generated patch, or sometimes an issue with what's returned from the repository (depending on how it's accessed and what type of repository).
david
#4 david
  • +NeedInfo
#5 nick.******@gmai***** (Google Code) (Is this you? Claim this profile.)
I'm getting the same error. If I copy the patch on the server and apply it locally, everything applies correctly. My .rej file looks almost exactly like the .diff file.

What other options do I have to debug this?
david
#7 david
Are the contents of the file that it's trying to patch what you expect? Sometimes hosting services will return an HTTP 200 but the contents will be a random HTML page with errors, rather than the desired file.
david
#8 david
  • -NeedInfo
    +Incomplete
#9 sachin*******@gmai***** (Google Code) (Is this you? Claim this profile.)
We also face the same issue in our organization. When the patch is downloaded and is applied, it gets applied correctly but reviewboard shows the error message 'There was an error displaying this diff'.