Opened 8 years ago

Last modified 2 years ago

#5535 assigned defect

unrecoverable error when "blocking" value is (or was!) invalid

Reported by: Bernhard Owned by: rjollos
Priority: high Component: MasterTicketsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11


This looks similar to #1326, but appears in SVN 4179 of MasterTicketsPlugin (using Trac 0.11.1): a ticket had the value of '#12' in the "blocking" field. When opening that ticket, trac says

Trac detected an internal error:
ValueError: invalid literal for int() with base 10: '#12'

I then switched off the MasterTicketsPlugin (using the Admin tab), opened the ticket, changed the "blocking" value to '12', and switched the MasterTicketsPlugin on again.

Surprisingly, the same error message appeared again. I can still not open that ticket that had an invalid blocking value before!

I have a ticket database converted from 0.10, where this format always used to work, so this bug now prevents me from activating the MasterTicketsPlugin on 0.11.1.

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by anonymous

  • Priority changed from normal to high

comment:2 Changed 7 years ago by hauke@…

I had the same with TracMasterTickets 2.1.3. I fixed it manual in the trac.db. My "blocking" value was '#616' but should be '616':

# sqlite3 db/trac.db
update ticket_change set oldvalue="616" where oldvalue="#616";
update ticket_change set newvalue="616" where newvalue="#616";

comment:3 Changed 3 years ago by rjollos

  • Owner changed from coderanger to rjollos
  • Status changed from new to assigned

comment:4 Changed 2 years ago by pspacek@…

Quick & nice solution for this problem is mentioned in:

It simply replaces int() call with tonum() call.

I'm copy&pasting it here:

  • mastertickets/
      59	61	            # Add link to depgraph if needed 
      60	62	            if links: 
      61	63	                add_ctxtnav(req, 'Depgraph', req.href.depgraph( 
     	65	            def tonum(n): 
     	66	                if n.startswith('#'): 
     	67	                    n = n[1:] 
     	68	                return int(n) 
    63	70	            for change in data.get('changes', []): 
    64	71	                for field, field_data in change['fields'].iteritems(): 
    65	72	                    if field in self.fields: 
    66	73	                        if field_data['new'].strip(): 
    67	 	                            new = set([--int--(n) for n in field_data['new'].split(',')]) 
     	74	                            new = set([__tonum__ (n) for n in field_data['new'].split(',')]) 
    68	75	                        else: 
    69	76	                            new = set() 
    70	77	                        if field_data['old'].strip(): 
    71	 	                            old = set([--int--(n) for n in field_data['old'].split(',')]) 
     	78	                            old = set([__tonum__(n) for n in field_data['old'].split(',')]) 
    72	79	                        else: 
    73	80	                            old = set() 
    74	81	                        add = new - old 

Add Comment

Modify Ticket

as assigned The owner will remain rjollos.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.