Edgewall Software

Ticket #5593 (closed defect: fixed)

Opened 16 months ago

Last modified 16 months ago

db upgrades broken

Reported by: Dave Abrahams <dave@…> Owned by: cboos
Priority: highest Milestone: 0.11
Component: admin/console Version: devel
Severity: blocker Keywords:
Cc:

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

Change History

Changed 16 months ago by cboos

  • status changed from new to assigned

#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.

Changed 16 months ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r5756.

Add/Change #5593 (db upgrades broken)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.