#718: Integrity error modifying batch of tickets (0.8-dev)
---------------------------+---------------------------------
Reporter: olemis | Owner: nobody
Type: defect | Status: new
Priority: blocker | Milestone: Release 8
Component: multiproduct | Version:
Resolution: | Keywords: ticket batch modify
---------------------------+---------------------------------
Description changed by olemis:
Old description:
> ==== How to Reproduce ====
>
> While doing a POST operation on `/batchmodify`, Trac issued an internal
> error.
>
> The process consists in selecting tickets in query view, then set
> milestone="Second release" and click ''Change tickets'' button. After
> that the following error is shown.
>
> Request parameters:
> {{{
> {'__FORM_TOKEN': u'xxx',
> 'action_reassign_reassign_owner': u'olemis',
> 'action_resolve_resolve_resolution': u'fixed',
> 'batchmod_submit': u'Change tickets',
> 'batchmod_value_comment': u'Move closed tickets to milestone:"Second
> release"',
> 'batchmod_value_milestone': u'Second release',
> 'query_href':
> u'/query?group=milestone&order=priority&col=id&col=summary&col=type&col=status&col=priority&col=product&col=milestone',
> 'selected_tickets':
> u'53,54,47,48,52,30,41,36,42,43,44,51,43,51,44,42,36,53,41,48,47,54,52,30'}
> }}}
>
> User agent: `Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.289
> Version/12.02`
>
> ==== System Information ====
> || '''`Trac`''' || `1.0.1` [[br]] `` ||
> || '''`Babel`''' || `0.9.6` ||
> || '''`Bloodhound Trac`''' || `1.0.1` ||
> || '''`Genshi`''' || `0.7 (with speedups)` ||
> || '''`Mercurial`''' || `2.6.2` ||
> || '''`mod_wsgi`''' || `3.3 (WSGIProcessGroup bloodhound_net
> WSGIApplicationGroup %{GLOBAL})` ||
> || '''`psycopg2`''' || `2.5` ||
> || '''`Pygments`''' || `1.6` ||
> || '''`Python`''' || `2.7.3 (default, Aug 1 2012, 05:25:23) ` [[br]]
> `[GCC 4.6.3]` ||
> || '''`pytz`''' || `2013b` ||
> || '''`setuptools`''' || `0.6` ||
> || '''`jQuery`''' || `1.7.2` ||
>
> ==== Enabled Plugins ====
> || '''`BloodhoundDashboardPlugin`''' || `0.8.0dev` ||
> || '''`BloodhoundLabs`''' || `0.1.0` ||
> || '''`BloodhoundMultiProduct`''' || `0.8.0dev` ||
> || '''`BloodhoundRelationsPlugin`''' || `0.8.0dev` ||
> || '''`BloodhoundSearchPlugin`''' || `0.8.0dev` ||
> || '''`BloodhoundTheme`''' || `0.8.0dev` ||
> || '''`TracAccountManager`''' || `0.4.3` ||
> || '''`TracMercurial`''' || `1.0.0.3dev` ||
> || '''`TracPermRedirect`''' || `3.0` ||
> || '''`TracThemeEngine`''' || `2.2.0` ||
>
> ==== Python Traceback ====
> {{{
> Traceback (most recent call last):
> File "/path/to/bloodhound/trac/trac/web/main.py", line 477, in
> _dispatch_request
> dispatcher.dispatch(req)
> File "/path/to/bloodhound/trac/trac/web/main.py", line 214, in dispatch
> resp = chosen_handler.process_request(req)
> File "/path/to/bloodhound/trac/trac/ticket/batch.py", line 62, in
> process_request
> new_values, comment, action)
> File "/path/to/bloodhound/trac/trac/ticket/batch.py", line 167, in
> _save_ticket_changes
> t.save_changes(req.authname, comment, when=when)
> File "/path/to/bloodhound/trac/trac/ticket/model.py", line 365, in
> save_changes
> """, (self.id, when_ts, author, cnum, comment))
> File
> "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/dbcursor.py",
> line 120, in execute
> return self.connection.execute(query, params=params)
> File "/path/to/bloodhound/trac/trac/db/util.py", line 121, in execute
> cursor.execute(query, params)
> File
> "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/dbcursor.py",
> line 85, in execute
> return super(BloodhoundIterableCursor,
> self).execute(translate_sql(self.env, sql), args=args)
> File "/path/to/bloodhound/trac/trac/db/util.py", line 65, in execute
> return self.cursor.execute(sql_escape_percent(sql), args)
> IntegrityError: duplicate key value violates unique constraint
> "ticket_change_pk"
> DETAIL: Key (ticket, "time", field, product)=(43, 1385147177768121,
> comment, swayed) already exists.
>
> }}}
New description:
==== How to Reproduce ====
While doing a POST operation on `/batchmodify`, Trac issued an internal
error.
The process consists in selecting tickets in query view, then set
milestone="Second release" and click ''Change tickets'' button. After that
the following error is shown.
Request parameters:
{{{#!py
{'__FORM_TOKEN': u'xxx',
'action_reassign_reassign_owner': u'olemis',
'action_resolve_resolve_resolution': u'fixed',
'batchmod_submit': u'Change tickets',
'batchmod_value_comment': u'Move closed tickets to milestone:"Second
release"',
'batchmod_value_milestone': u'Second release',
'query_href':
u'/query?group=milestone&order=priority&col=id&col=summary&col=type&col=status&col=priority&col=product&col=milestone',
'selected_tickets':
u'53,54,47,48,52,30,41,36,42,43,44,51,43,51,44,42,36,53,41,48,47,54,52,30'}
}}}
User agent: `Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.10.289
Version/12.02`
==== System Information ====
|| '''`Trac`''' || `1.0.1` [[br]] `` ||
|| '''`Babel`''' || `0.9.6` ||
|| '''`Bloodhound Trac`''' || `1.0.1` ||
|| '''`Genshi`''' || `0.7 (with speedups)` ||
|| '''`Mercurial`''' || `2.6.2` ||
|| '''`mod_wsgi`''' || `3.3 (WSGIProcessGroup bloodhound_net
WSGIApplicationGroup %{GLOBAL})` ||
|| '''`psycopg2`''' || `2.5` ||
|| '''`Pygments`''' || `1.6` ||
|| '''`Python`''' || `2.7.3 (default, Aug 1 2012, 05:25:23) ` [[br]]
`[GCC 4.6.3]` ||
|| '''`pytz`''' || `2013b` ||
|| '''`setuptools`''' || `0.6` ||
|| '''`jQuery`''' || `1.7.2` ||
==== Enabled Plugins ====
|| '''`BloodhoundDashboardPlugin`''' || `0.8.0dev` ||
|| '''`BloodhoundLabs`''' || `0.1.0` ||
|| '''`BloodhoundMultiProduct`''' || `0.8.0dev` ||
|| '''`BloodhoundRelationsPlugin`''' || `0.8.0dev` ||
|| '''`BloodhoundSearchPlugin`''' || `0.8.0dev` ||
|| '''`BloodhoundTheme`''' || `0.8.0dev` ||
|| '''`TracAccountManager`''' || `0.4.3` ||
|| '''`TracMercurial`''' || `1.0.0.3dev` ||
|| '''`TracPermRedirect`''' || `3.0` ||
|| '''`TracThemeEngine`''' || `2.2.0` ||
==== Python Traceback ====
{{{#!py
Traceback (most recent call last):
File "/path/to/bloodhound/trac/trac/web/main.py", line 477, in
_dispatch_request
dispatcher.dispatch(req)
File "/path/to/bloodhound/trac/trac/web/main.py", line 214, in dispatch
resp = chosen_handler.process_request(req)
File "/path/to/bloodhound/trac/trac/ticket/batch.py", line 62, in
process_request
new_values, comment, action)
File "/path/to/bloodhound/trac/trac/ticket/batch.py", line 167, in
_save_ticket_changes
t.save_changes(req.authname, comment, when=when)
File "/path/to/bloodhound/trac/trac/ticket/model.py", line 365, in
save_changes
""", (self.id, when_ts, author, cnum, comment))
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/dbcursor.py",
line 120, in execute
return self.connection.execute(query, params=params)
File "/path/to/bloodhound/trac/trac/db/util.py", line 121, in execute
cursor.execute(query, params)
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/dbcursor.py",
line 85, in execute
return super(BloodhoundIterableCursor,
self).execute(translate_sql(self.env, sql), args=args)
File "/path/to/bloodhound/trac/trac/db/util.py", line 65, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
IntegrityError: duplicate key value violates unique constraint
"ticket_change_pk"
DETAIL: Key (ticket, "time", field, product)=(43, 1385147177768121,
comment, swayed) already exists.
}}}
--
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/718#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker