4030: Cannot update a review due to " API Error 204 (HTTP code 409): The commit ID specified has already been used."
- Fixed
- RBTools
apostlethwaite | |
What version are you running?
2.5.1.1
What steps will reproduce the problem?
- Be using a Perforce repository, post a review using rbt post changeID
- Update one of the files in the changelist
- Use rbt post changeID
What is the expected output? What do you see instead?
Expected the review to be updated. Instead I see:
rbt post 288474
Generating diff for pending changeset 288474
CRITICAL:If I enable debug, I see a lot of text, including:
rbt post --debug 288474
RBTools 0.7.5 alpha 0 (dev)
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
Running on Windows-8-6.2.9200Checking for a Perforce repository...
Running: p4 info
Running: diff --versionMaking HTTP POST request to http://reviewboard/api/review-requests/
Got API Error 204 (HTTP code 409): The commit ID specified has already been used.
Error data: {u'stat': u'fail', u'review_request': {u'status': u'discarded', u'last_updated': u'2015-11-24T09:50:23Z', u'links': {u'diffs': {u'href': u'http://reviewboard/api/review-requests/2035/diffs/', u'method': u'GET'}, u'repository': {u'href': u'http://reviewboard/api/repositories/1/', u'method': u'GET', u'title': u'perforce.domain.com'}, u'changes': {u'href': u'http://reviewboard/api/review-requests/2035/changes/', u'method': u'GET'}, u'self': {u'href': u'http://reviewboard/api/review-requests/2035/', u'method': u'GET'}, u'update': {u'href': u'http://reviewboard/api/review-requests/2035/', u'method': u'PUT'}, u'last_update': {u'href': u'http://reviewboard/api/review-requests/2035/last-update/', u'method': u'GET'}, u'reviews': {u'href': u'http://reviewboard/api/review-requests/2035/reviews/', u'method': u'GET'}, u'draft': {u'href': u'http://reviewboard/api/review-requests/2035/draft/', u'method': u'GET'}, u'file_attachments': {u'href': u'http://reviewboard/api/review-requests/2035/file-attachments/', u'method': u'GET'}, u'submitter': {u'href': u'http://reviewboard/api/users/alexp/', u'method': u'GET', u'title': u'alexp'}, u'delete': {u'href': u'http://reviewboard/api/review-requests/2035/', u'method': u'DELETE'}, u'screenshots': {u'href': u'http://reviewboard/api/review-requests/2035/screenshots/', u'method': u'GET'}, u'diff_context': {u'href': u'http://reviewboard/api/review-requests/2035/diff-context/', u'method': u'GET'}}, u'depends_on': [], u'description_text_type': u'plain', u'issue_resolved_count': 0, u'ship_it_count': 0, u'close_description_text_type': u'plain', u'id': 2035, u'description': u'Adding feature query support.', u'target_people': [], u'changenum': 288474, u'bugs_closed': [u'112512'], u'testing_done_text_type': u'plain', u'testing_done': u'', u'close_description': u'', u'time_added': u'2015-11-24T09:45:03Z', u'extra_data': {u'calculated_trophies': True}, u'public': False, u'commit_id': u'288474', u'blocks': [], u'branch': u'', u'text_type': None, u'issue_open_count': 0, u'approved': False, u'url': u'/r/2035/', u'absolute_url': u'http://reviewboard/r/2035/', u'target_groups': [{u'href': u'http://reviewboard/api/groups/MyTeam/', u'method': u'GET', u'title': u'MyTeam'}], u'summary': u'Adding feature query support.', u'issue_dropped_count': 0, u'approval_failure': u'The review request has not been marked "Ship It!"'}, u'err': {u'msg': u'The commit ID specified has already been used.', u'code': 204}}
Making HTTP GET request to http://reviewboard/api/review-requests/2035/?only-links=diffs%2Cdraft&only-fields=absolute_url%2Cbugs_closed%2Cid%2Cstatus
Cached response for HTTP GET http://reviewboard/api/review-requests/2035/?only-links=diffs%2Cdraft&only-fields=absolute_url%2Cbugs_closed%2Cid%2Cstatus expired and was modified
Traceback (most recent call last):
File "C:\Program Files (x86)\RBTools\bin..\Python27\Scripts\rbt-script.py", line 8, in <module>
load_entry_point('RBTools==0.7.5alpha0', 'console_scripts', 'rbt')()
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-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.5alpha0-py2.7.egg\rbtools\commands__init__.py", line 622, in run_from_argv
exit_code = self.main(*args) or 0
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\commands\post.py", line 800, in main
base_dir=base_dir)
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\commands\post.py", line 433, in post_request
review_request = review_request.update(
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\api\resource.py", line 301, in getattr
raise AttributeError
AttributeErrorWhat operating system are you using?
Windows 10
Attach the debug out from the command.
See above.
Please provide any additional information below.
It seems that if I change my update command to be
rbt post --diff-only changeID
it succeeds in posting a new diff, however any edits to the description seem to be lost.
I have the same issue. When doing a post where the review request already existed in Review Board 2.0.21 you did not need to specify --update or -r but after upgrading to RB 2.5.3 now when we try to post we get this error (perforce):
rbt post 736476
Generating diff for pending changeset 736476
CRITICAL:--
If you do a debug you see this error: Got API Error 204 (HTTP code 409): The commit ID specified has already been used.
And a stack trace for AttributeError--
rbt post -u 736476
Review request #25300 posted.
--
So the above works fine with the -u (--update) but this is not how it worked with RB 2.0.x. Is this issue going to be fixed?If we specify a -u and this is the first time then we get this:
rbt post -u 736476
Generating diff for pending changeset 736476
ERROR: Could not determine the existing review request to update.This causes issues with our automated scripts that run on every pre-commit because we don't know if it is a first time review or a update to an exitsing review.
-Marvin