Modify

Opened 4 years ago

Last modified 16 months ago

#8414 new defect

Cannot access Metrics link

Reported by: anonymous Owned by: rjollos
Priority: normal Component: TracMetrixPlugin
Severity: normal Keywords:
Cc: revans 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 3 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 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 4 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 4 years ago by revans

  • Cc revans added

comment:4 Changed 4 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 3 years ago by jeffstewart@…

Same here. We've got 3000+ tickets.

Changed 3 years ago by orio

comment:6 Changed 3 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 2 years ago by rjollos

  • Priority changed from highest to normal
  • Severity changed from blocker to normal
  • Status changed from new to assigned

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 2 years ago by rjollos

(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 16 months ago by rjollos

  • Status changed from assigned to new

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.