Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

#5593 closed defect (fixed)

db upgrades broken

Reported by: Dave Abrahams <dave@…> Owned by: Christian Boos
Priority: highest Milestone: 0.11
Component: admin/console Version: devel
Severity: blocker Keywords:
Cc: Branch:
Release Notes:
API Changes:

Description

I was upgrading from to r5468 to r5748 and got this:

Command failed: iteration over non-sequence

with no backtrace! Had to somehow divine that trac-admin is run through trac/admin/console.py (the body of trac-admin gives no clue) and comment out the exception handler to debug this. The following patch fixes it:

  • trac/upgrades/db21.py

     
    33    """Upgrade the reports to better handle the new workflow capabilities"""                                                                                                                       
    44    db = env.get_db_cnx()                                                                                                                                                                           
    55    owner = db.concat('owner', "' *'")                                                                                                                                                             
    6     reports = list(cursor.execute('SELECT id, query, description FROM report'))                                                                                                                     
     6    reports = list(cursor.execute('SELECT id, query, description FROM report')                                                                                                                     
     7                   or ())                                                                                                                                                                           
    78    for report, query, description in reports:                                                                                                                                                     
    89        # All states other than 'closed' are "active".                                                                                                                                             
    910        query = query.replace("IN ('new', 'assigned', 'reopened')",                                                                                                                                 

Attachments (0)

Change History (2)

comment:1 by Christian Boos, 12 years ago

Status: newassigned

#5575 was closed as duplicate. I've closed it in favor of this one, as there was a patch here.

But upon further examination, the patch is not correct, as the return value of cursor.execute is not specified (see PEP:0249), and used to be None (see PEP:0248).

So I'll use fetchall instead.

comment:2 by Christian Boos, 12 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r5756.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Christian Boos to the specified user.

Add Comment


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