Edgewall Software

Opened 11 years ago

Last modified 9 years ago

#6753 new defect

bugzilla2trac.py: attachment.isobsolete has to be ignored

Reported by: mbertheau@… Owned by:
Priority: normal Milestone: not applicable
Component: contrib Version: devel
Severity: normal Keywords: bugzilla2trac
Cc: Branch:
Release Notes:
API Changes:


This property is per-attachment in bugzilla, but the script imports it per-ticket. A change of the isobsolete field of two attachments at the same time in bugzilla will lead to a unique constraint violation on the trac side, causing the import to fail.

Adding the field to IGNORED_ACTIVITY_FIELDS solves the problem and allows the import to continue.

Attachments (0)

Change History (9)

comment:1 by anonymous, 11 years ago

-IGNORED_ACTIVITY_FIELDS = ["everconfirmed"]
+IGNORED_ACTIVITY_FIELDS = ["everconfirmed", "attachments.isobsolete"]

comment:2 by anonymous, 11 years ago

Other than that, the script runs correctly on bugzilla 2.32.2. I also had to set sys.setdefaultencoding('utf8').

comment:3 by Emmanuel Blot, 11 years ago


should not block 0.11

comment:4 by anonymous, 11 years ago

Actually the attachments were not imported correctly, see #6792.

comment:5 by Jeroen Ruigrok van der Werven, 11 years ago

Owner: changed from Jonas Borgström to Jeroen Ruigrok van der Werven
Status: newassigned

comment:6 by thomas.klenner@…, 11 years ago

I had a similar problem when importing from Bugzilla 2.18.4 but solved it differently:

My bugzilla DB contained three changes of type "attachments.isobsolete" for the same bug at the same time:

mysql> SELECT * FROM bugs_activity WHERE bug_id = 1567 order by bug_when;
| bug_id | attach_id | who | bug_when            | fieldid | added    | removed  |
|   1567 |       182 |  15 | 2007-05-15 16:48:28 |      27 | 1        | 0        | 
|   1567 |       183 |  15 | 2007-05-15 16:48:28 |      27 | 1        | 0        | 
|   1567 |       184 |  15 | 2007-05-15 16:48:28 |      27 | 1        | 0        | 

In the bugzilla2trac.py script, I noticed some code for the case that

# cc  sometime appear in different activities with same time

I changed the script and added the same handling for field_name = "attachments.isobsolete":

   # cc and attachments.isobsolete sometime appear 
   # in different activities with same time
   if ( (field_name == "cc" or field_name == "attachments.isobsolete") \

After this change, the script successfully imported my bugzilla tickets and attachments.

comment:7 by Jeroen Ruigrok van der Werven, 10 years ago

Owner: Jeroen Ruigrok van der Werven removed
Status: assignednew

comment:8 by Christian Boos, 10 years ago

Keywords: bugzilla2trac added
Milestone: next-minor-0.12.xnot applicable

comment:9 by Christian Boos, 9 years ago

Component: generalcontrib

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.