2508: post-review gives "Error uploading diff" error in release 0.4.1

je**@jeffmar******** (Google Code) (Is this you? Claim this profile.)
March 2, 2012
What version are you running?
RBTools 0.4.1
Reviewboard: 1.6.4.1cd /


What's the URL of the page containing the problem?
Command line


What steps will reproduce the problem?
1. using a perforce repository, and a changelist
   did: post-review --server=http://cmweb5.cadence.com/reviews 77800


2.
3.

What is the expected output? What do you see instead?
We expected a diff to be attached to the review request.
The review requested was created in reviewboard, but the 
diff did not get attach..

We got the following output:
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.

I then re-ran it with the --output-diff option. The diff is created,
and we piped it to a diff file.

We then tried to use the --diff-file option, this gave us a Errno 13 
error.

We then tried the --debug option and got the following output:
post-review --debug --server=http://cmweb5.cadence.com/reviews 77800
>>> RBTools 0.4.1
>>> Home = /hm/markham
>>> HTTP GETting api/
>>> HTTP GETting http://cmweb5.cadence.com/reviews/api/info/
>>> Using the new web API
>>> Attempting to create review request on cicp4sj3.Cadence.COM:1667 for 77800
>>> HTTP POSTing to http://cmweb5.cadence.com/reviews/api/review-requests/: {'changenum': '77800', 'repository': 'cicp4sj3.Cadence.COM:1667'}
>>> Got API Error 204 (HTTP code 409): The change number specified has already been used
>>> Error data: {'stat': 'fail', 'review_request': {'status': 'pending', 'last_updated': '2012-03-01 11:23:56', 'description': 'CCR988093: Needed a way to set the subDesign as the "active" and to have design() and top() do the right thing\n', 'links': {'diffs': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/diffs/', 'method': 'GET'}, 'repository': {'href': 'http://cmweb5.cadence.com/reviews/api/repositories/3/', 'method': 'GET', 'title': 'bluecad'}, 'changes': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/changes/', 'method': 'GET'}, 'self': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/', 'method': 'GET'}, 'update': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/', 'method': 'PUT'}, 'last_update': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/last-update/', 'method': 'GET'}, 'reviews': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/reviews/', 'method': 'GET'}, 'draft': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/draft/', 'method': 'GET'}, 'file_attachments': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/file-attachments/', 'method': 'GET'}, 'submitter': {'href': 'http://cmweb5.cadence.com/reviews/api/users/markham/', 'method': 'GET', 'title': 'markham'}, 'screenshots': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/screenshots/', 'method': 'GET'}, 'delete': {'href': 'http://cmweb5.cadence.com/reviews/api/review-requests/1/', 'method': 'DELETE'}}, 'public': False, 'target_groups': [], 'bugs_closed': [], 'changenum': 77800, 'target_people': [], 'testing_done': '', 'branch': '', 'time_added': '2012-03-01 11:23:56', 'summary': 'CCR988093: Needed a way to set the subDesign as the "active" and to have design() and top() do the right thing', 'id': 1}, 'err': {'msg': 'The change number specified has already been used', 'code': 204}}
>>> Review request already exists. Updating it...
>>> HTTP PUTting to http://cmweb5.cadence.com/reviews/api/review-requests/1/: {'changenum': 77800}
>>> Uploading diff, size: 9086
>>> HTTP POSTing to http://cmweb5.cadence.com/reviews/api/review-requests/1/diffs/: {}
>>> Got API Error 105 (HTTP code 400): One or more fields had errors
>>> Error data: {'fields': {'path': ['[Errno 13] Permission denied']}, 'stat': 'fail', 'err': {'msg': 'One or more fields had errors', 'code': 105}}

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.

======

The error_log from /var/log/httpd contains
======

ERROR:root:Error uploading new diff: [Errno 13] Permission denied
[Thu Mar 01 11:24:10 2012] [error] Traceback (most recent call last):
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/webapi/resources.py", line 1503, in create
[Thu Mar 01 11:24:10 2012] [error]     request.FILES.get('parent_diff_path'))
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/reviews/forms.py", line 286, in create
[Thu Mar 01 11:24:10 2012] [error]     history)
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/diffviewer/forms.py", line 62, in create
[Thu Mar 01 11:24:10 2012] [error]     files = list(self._process_files(
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/diffviewer/forms.py", line 144, in _process_files
[Thu Mar 01 11:24:10 2012] [error]     if (revision != PRE_CREATION and
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/core.py", line 72, in file_exists
[Thu Mar 01 11:24:10 2012] [error]     self.get_file(path, revision)
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 306, in get_file
[Thu Mar 01 11:24:10 2012] [error]     return self.client.get_file(path, revision)
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 224, in get_file
[Thu Mar 01 11:24:10 2012] [error]     return self._run_worker(lambda: self._get_file(path, revision))
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 154, in _run_worker
[Thu Mar 01 11:24:10 2012] [error]     result = worker()
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 224, in <lambda>
[Thu Mar 01 11:24:10 2012] [error]     return self._run_worker(lambda: self._get_file(path, revision))
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 201, in _get_file
[Thu Mar 01 11:24:10 2012] [error]     stderr=subprocess.PIPE)
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib64/python2.4/subprocess.py", line 550, in __init__
[Thu Mar 01 11:24:10 2012] [error]     errread, errwrite)
[Thu Mar 01 11:24:10 2012] [error]   File "/usr/lib64/python2.4/subprocess.py", line 996, in _execute_child
[Thu Mar 01 11:24:10 2012] [error]     raise child_exception
[Thu Mar 01 11:24:10 2012] [error] OSError: [Errno 13] Permission denied

======
This indicates some kind of filesystem permission error. I
just can't figure out where it's trying to write to.

I have verified all paths are writable in the install /var/www
area. 

I also tried uninstalling and re-installing ReviewBoard 1.6.4.1

So far, I'm stuck. 

This did work in in the 1.6 version we were previously using.

Any help would be appreciated.

jeff



What operating system are you using? What browser?
Linux, Chrome


Please provide any additional information below.
#1 je**@jeffmar******** (Google Code) (Is this you? Claim this profile.)
I enabled logging on the reviewboard server. Perhaps this will give a little more info:

tail -f logs/reviewboard.log
2012-03-01 13:21:14,558 - DEBUG - DiffParser.parse: Beginning parse of diff, size = 9086
2012-03-01 13:21:14,560 - DEBUG - DiffParser.parse: Finished parsing diff.
2012-03-01 13:21:14,615 - ERROR - Error uploading new diff: [Errno 13] Permission denied
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/webapi/resources.py", line 1503, in create
    request.FILES.get('parent_diff_path'))
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/reviews/forms.py", line 286, in create
    history)
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/diffviewer/forms.py", line 62, in create
    files = list(self._process_files(
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/diffviewer/forms.py", line 144, in _process_files
    if (revision != PRE_CREATION and
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/core.py", line 72, in file_exists
    self.get_file(path, revision)
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 306, in get_file
    return self.client.get_file(path, revision)
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 224, in get_file
    return self._run_worker(lambda: self._get_file(path, revision))
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 154, in _run_worker
    result = worker()
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 224, in <lambda>
    return self._run_worker(lambda: self._get_file(path, revision))
  File "/usr/lib/python2.4/site-packages/ReviewBoard-1.6.4.1-py2.4.egg/reviewboard/scmtools/perforce.py", line 201, in _get_file
    stderr=subprocess.PIPE)
  File "/usr/lib64/python2.4/subprocess.py", line 550, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.4/subprocess.py", line 996, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
chipx86
#2 chipx86
This looks like your p4 binary isn't chmod 755, or is otherwise unable to be executed by the Apache process. That's the first thing I'd check.

It's outside the control of Review Board, though. Definitely a problem in executing that.
david
#3 david
  • +SetupIssue
#4 je**@jeffmar******** (Google Code) (Is this you? Claim this profile.)
You're right .. the p4 binary wasn't in the executable path of the apache user.
Sorry to waste your time....
#5 ymnick

I am facing similar issue (OSError: [Errno 13] Permission denied) with my Bitnami Review Board installation, could you please share what steps you followed to fix this?

Thanks!

#6 ymnick

Never mind, chmod 755 /usr/bin/p4 did the trick!

Thanks!