Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1869 closed defect (fixed)

Exception when running report with no results on PySQLite2

Reported by: Emmanuel Blot Owned by: Christopher Lenz
Priority: normal Milestone: 0.9
Component: report system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

If an invalid SQL report is stored in the DB (whether it is invalid by syntax, or not able to be succesfully executed, for some SQL or Trac reason), there is no way to edit (fix up) or even delete this very report:

Trac only shows the Edit/Copy/Delete Report buttons within the report result page, which is not displayed if the SQL request execution fails.

This is a Request for Enhancement, but I think it should also considered as a bug. Therefore, I don't know which severity to assign to this ticket. Feel free to update it.

Attachments (0)

Change History (8)

comment:1 by Christopher Lenz, 19 years ago

Milestone: 0.9
Severity: normalenhancement

This is a bit misleading, since Trac does allow editing/deleting reports that fail to execute. For example, just try a simple query for a non-existing table or column.

Internal errors in Trac however will prevent deletion/modification of reports. Such errors need to be fixed, obviously.

Nevertheless, I agree that it would be nice if reports could be edited/deleted directly from the report index page.

comment:2 by Emmanuel Blot, 19 years ago

I may have missed an important point, though.

For example, the following request fails to execute

SELECT p.value AS __color__,
      t.milestone AS __group__,
      id AS ticket, summary, component, status,
      resolution,version, severity, priority, owner,
      changetime AS modified,
      time AS _time,reporter AS _reporter
      FROM ticket t,enum p
      WHERE p.name=t.priority AND p.type='priority' AND t.status='closed'
      AND component='Camera'
      AND date(modified, 'unixepoch') BETWEEN '2005-07-01' AND '2005-07-31'
      ORDER BY (milestone IS NULL), milestone DESC

if there is no matching ticket. This ends up with an internal error. It may be two distinct issue:

  1. the request returns no data,
  2. Trac has an issue w/ such a case and triggers an internal exception

⇒ there is no way to delete the report

Or did I miss another way to delete (or edit) the report ?

comment:3 by Christopher Lenz, 19 years ago

Can you provide the stack trace for the above error? I just get a normal "No matches found" message.

Try a simple query like:

SELECT * FROM foo;

This should of course fail, and I get the message "Report execution failed: no such table: foo" just below the buttons for editing or deleting the report.

comment:4 by Emmanuel Blot, 19 years ago

Here is the trace:

Python traceback (trunk [2033])

Traceback (most recent call last):
  File "/local/engine/trac/trac/web/modpython_frontend.py", line 204, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "/local/engine/trac/trac/web/main.py", line 433, in dispatch_request
    dispatcher.dispatch(req)
  File "/local/engine/trac/trac/web/main.py", line 293, in dispatch
    resp = chosen_handler.process_request(req)
  File "/local/engine/trac/trac/ticket/report.py", line 127, in process_request
    resp = self._render_view(req, db, id)
  File "/local/engine/trac/trac/ticket/report.py", line 283, in _render_view
    for col in cols:
TypeError: iteration over non-sequence

If I replace component with a component that has closed tickets in the same timeframe, everything runs fine.

comment:5 by Christopher Lenz, 19 years ago

Milestone: 0.9
Owner: changed from daniel to Christopher Lenz
Priority: lownormal
Severity: enhancementnormal
Status: newassigned
Summary: Trac should permit edition/deletion of any SQL custom reportException when running report with no results on PySQLite2

Okay, I'm changing the scope of this ticket to that particular error. This only happens with PySQLite2 AFAICT, and I have a simple fix ready.

comment:6 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

This should be fixed in [2048].

comment:7 by Emmanuel Blot, 19 years ago

Ok, thanks.

Should I open a new request for enhancement to add edit/delete buttons on the report page ?

comment:8 by Christopher Lenz, 19 years ago

Yeah, as an enhancement with no milestone (unless you provide a patch ;-) ).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.