Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3508 by Post Reivew allows you to update a review request draft to a commit ID that is already present in another review.

*** You must complete this form in its entirety, or your bug report will be
*** rejected.
*** If you have a security issue to report, please send it confidentially
*** Posting security-related issues to this bug
*** tracker causes us to have to do an emergency release.
*** For customer support, please post to
*** If you have a patch, please submit it to
*** This bug tracker is public. Please check that any logs or other
*** that you include has been stripped of confidential information.

What version are you running?

Triggered the exception on at sometime around July 30, 2014 1:30 PM PT .

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

What steps will reproduce the problem?
1. Create a review request (# 6168) for commit 09263fedc72b1dd34b7ce11d7e9238664d3316ed . It need not be published. 2. Create a review request (# 6169) for commit 9419d95630f1d455ceaf8932fdf793faee03543b . 3. Update the second review request with the same SHA as the first `rbt post -r6169 09263fedc72b1dd34b7ce11d7e9238664d3316ed` - This should get rejected because a review request exists already for this ID but it is not currently.
4. Attempt to publish Request #6169 from the web ui or rbt post -p
   - Trigger 500 error for Integrity Error.

What is the expected output? What do you see instead?

Step #3 should not be be possible. Step #4 should give a better error message if you get to this state somehow.

What operating system are you using? What browser?

Chrome, Firefox, rbt post on linux.

Please provide any additional information below.

Stack trace of the Integrity Error from a Reviewboard 2.0.3 server:

Traceback (most recent call last):

File "Django-1.6.5-py2.7.egg/django/core/handlers/", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "Django-1.6.5-py2.7.egg/django/views/decorators/", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

File "Django-1.6.5-py2.7.egg/django/views/decorators/", line 19, in inner_func
    response = func(*args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 494, in __call__
    request, method, view, api_format=api_format, *args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 565, in call_method_view
    return view(request, *args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 753, in put
    return self.update(request, *args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 117, in _call
    return view_func(*args, **kwargs)

File "ReviewBoard-2.0.3-py2.7.egg/reviewboard/webapi/", line 110, in _check
    return view_func(*args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 117, in _call
    return view_func(*args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 138, in _checklogin
    return view_func(*args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 117, in _call
    return view_func(*args, **kwargs)

File "Djblets-0.8.6-py2.7.egg/djblets/webapi/", line 287, in _validate
    return view_func(*args, **new_kwargs)

File "ReviewBoard-2.0.3-py2.7.egg/reviewboard/webapi/resources/", line 394, in update

File "ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/", line 716, in publish
    changes = draft.publish(self, send_notification=False)

File "ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/", line 318, in publish

File "ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/", line 581, in save
    super(ReviewRequest, self).save(**kwargs)

File "ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/", line 258, in save
    super(BaseReviewRequestDetails, self).save(**kwargs)

  File "Django-1.6.5-py2.7.egg/django/db/models/", line 545, in save
    force_update=force_update, update_fields=update_fields)

File "Django-1.6.5-py2.7.egg/django/db/models/", line 573, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "Django-1.6.5-py2.7.egg/django/db/models/", line 635, in _save_table

File "Django-1.6.5-py2.7.egg/django/db/models/", line 679, in _do_update
    return filtered._update(values) > 0

File "Django-1.6.5-py2.7.egg/django/db/models/", line 510, in _update
    return query.get_compiler(self.db).execute_sql(None)

File "Django-1.6.5-py2.7.egg/django/db/models/sql/", line 980, in execute_sql
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)

File "Django-1.6.5-py2.7.egg/django/db/models/sql/", line 786, in execute_sql
    cursor.execute(sql, params)

File "Django-1.6.5-py2.7.egg/django/db/backends/", line 53, in execute
    return self.cursor.execute(sql, params)

  File "Django-1.6.5-py2.7.egg/django/db/", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)

File "Django-1.6.5-py2.7.egg/django/db/backends/", line 53, in execute
    return self.cursor.execute(sql, params)

File "Django-1.6.5-py2.7.egg/django/db/backends/mysql/", line 124, in execute
    return self.cursor.execute(query, args)

File "MySQL_python-1.2.5-py2.7-linux-i686.egg/MySQLdb/", line 205, in execute
    self.errorhandler(self, exc, value)

File "MySQL_python-1.2.5-py2.7-linux-i686.egg/MySQLdb/", line 36, in defaulterrorhandler
    raise errorclass, errorvalue

IntegrityError: (1062, "Duplicate entry '49023f413fc1c59fc04e0e78eadc8f935c1c3bbc-245' for key 'reviews_reviewrequest_b8c24015'")

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to