Modify

Opened 14 years ago

Last modified 10 years ago

#8414 new defect

Cannot access Metrics link

Reported by: anonymous Owned by:
Priority: normal Component: TracMetrixPlugin
Severity: normal Keywords:
Cc: Bob Evans Trac Release: 0.12

Description

I installed TracMetrix on 0.12.1, when i installed it, i click the Metrics link and receive the following error

OperationalError: too many SQL variables

Python Traceback

Most recent call last:
File "build/bdist.linux-i686/egg/trac/web/main.py", line 511, in _dispatch_request
File "build/bdist.linux-i686/egg/trac/web/main.py", line 237, in dispatch
File "build/bdist.linux-i686/egg/tracmetrixplugin/web_ui.py", line 181, in process_request
File "build/bdist.linux-i686/egg/tracmetrixplugin/web_ui.py", line 221, in _render_view
File "build/bdist.linux-i686/egg/tracmetrixplugin/model.py", line 46, in get_ticket_group_stats
File "build/bdist.linux-i686/egg/trac/db/util.py", line 65, in execute
File "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", line 78, in execute
File "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", line 56, in execute
File "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
 

Attachments (1)

model.py.patch (2.9 KB) - added by orio 13 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by anonymous

adding more info to the above statement this is the code fragment that fails in get_ticket_group_stats:

41	            db = self.env.get_db_cnx()
42	            cursor = db.cursor()            
43	            
44	            closed_cnt = cursor.execute("SELECT COUNT(*) FROM ticket "
45	                                        "WHERE status = 'closed' AND id IN (%s)"
46	                                        %  (",".join(['%s']*len(ticket_ids))), tuple(ticket_ids))
47	            closed_cnt = cursor.fetchone()[0]
48	                
49	            active_cnt = cursor.execute("SELECT COUNT(*) FROM ticket "
50	                                        "WHERE status IN ('new', 'reopened') AND id IN (%s)"
51	                                        %  (",".join(['%s']*len(ticket_ids))), tuple(ticket_ids))

comment:2 Changed 14 years ago by anonymous

I guess I can expand SQLLITE_LIMIT_VARIABLE_NUMBER which appears to default to 999, in my case it has returned 3037. I haven't stood up your add-on, but it appears this is not meant for such large scale trac projects

comment:3 Changed 14 years ago by Bob Evans

Cc: Bob Evans added; anonymous removed

comment:4 Changed 14 years ago by anonymous

Any news on this bug, we also get this since we hit more that 1700 tickets or so. --thanks

comment:5 Changed 14 years ago by jeffstewart@…

Same here. We've got 3000+ tickets.

Changed 13 years ago by orio

Attachment: model.py.patch added

comment:6 Changed 13 years ago by orio

I attached a patch for the model.py. It worked for us with 1300+ tickets.

It is clearly not perfect since it "COUNT(*)" with an "ID =" witch is unique.

comment:7 Changed 12 years ago by Ryan J Ollos

Priority: highestnormal
Severity: blockernormal
Status: newassigned

The next checkin should fix the error. There are still some performance issues that need to be addressed. Please report back if it is working well for you now.

comment:8 Changed 12 years ago by Ryan J Ollos

(In [12249]) Refs #8414:

  • Modified SQL queries after studying the TicketQuery macro in the Trac core.
  • Removed some unnecessary imports.
  • Removed Python 2.4 from installation requirements, as this has been observed to cause problems for Trac plugin. Trac 0.11 requires Python 2.4 anyway, so the restriction is effectively in place for this plugin.

comment:9 Changed 12 years ago by Ryan J Ollos

Status: assignednew

comment:10 Changed 10 years ago by Ryan J Ollos

Owner: Ryan J Ollos deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.