Opened 2 years ago
Last modified 5 days 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)
Change History (10)
comment:1 Changed 2 years ago by anonymous
comment:2 Changed 2 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 2 years ago by revans
- Cc revans added
comment:4 Changed 2 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 2 years ago by jeffstewart@…
Same here. We've got 3000+ tickets.
Changed 22 months ago by orio
comment:6 Changed 22 months 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 8 months 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 8 months ago by rjollos
- 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 5 days ago by rjollos
- Status changed from assigned to new


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))