Edgewall Software

Ticket #7354 (closed defect: fixed)

Opened 6 months ago

Last modified 5 months ago

Unable to Edit or Delete an invalid tickets report

Reported by: dbcole@… Owned by: jonas
Priority: normal Milestone: 0.11.1
Component: report system Version:
Severity: normal Keywords:
Cc:

Description (last modified by cboos) (diff)

While editing the SQL (which I don't really know much about at all) for a new report that I was trying to create, I managed to create an error that I cannot seem to get out of:

After editing the report's SQL, I clicked on "SAVE REPORT".

I imediately got "Oops... Trac detected an internal error:".

I then tried going back into "View Tickets" with the intention of undoing my mistake, but now I am unable to get into the edit view for that ticket.

The View Tickets list does not seem to have a way for me to go directly to edit. So I have to select the report, which immediately fails again.

The Python Traceback follows:

Traceback (most recent call last):
  File "C:\programs\python2.4\lib\site-packages\trac\web\main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "C:\programs\python2.4\lib\site-packages\trac\web\main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\programs\python2.4\lib\site-packages\trac\ticket\report.py", line 88, in process_request
    resp = self._render_view(req, db, id)
  File "C:\programs\python2.4\lib\site-packages\trac\ticket\report.py", line 346, in _render_view
    value['date'] = format_date(cell)
  File "C:\programs\python2.4\lib\site-packages\trac\util\datefmt.py", line 68, in format_date
    return format_datetime(t, format, gmt)
  File "C:\programs\python2.4\lib\site-packages\trac\util\datefmt.py", line 58, in format_datetime
    t = time.localtime(float(t))
ValueError: invalid literal for float(): dbcole

Attachments

Change History

  Changed 5 months ago by Piotr Kuczynski <piotr.kuczynski@…>

  • keywords needinfo added
  • component changed from general to report system

  Changed 5 months ago by osimons

  • status changed from new to closed
  • resolution set to worksforme

Testing on 0.11, but I can't recreate your problem. For all errors I provoke, it provides an error message instead of a report table, but the 'Edit' button is always available.

I'm closing as 'worksforme' as without further information it does not look like an current issue:

  • What Trac version do you use?
  • Try to append ?action=edit on the url, and provide the SQL you tried to run.

Reopen ticket if you have new information.

  Changed 5 months ago by cboos

  • status changed from closed to reopened
  • resolution worksforme deleted
  • description modified (diff)
  • milestone set to 0.11.2

It happens at least here on t.e.o:

Traceback (most recent call last):
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/api.py", line 339, in send_error
    'text/html')
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/chrome.py", line 708, in render_template
    if not req.session or not int(req.session.get('accesskeys', 0)):
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/api.py", line 168, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/main.py", line 257, in _get_session
    return Session(self.env, req)
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/session.py", line 142, in __init__
    self.get_session(req.authname, authenticated=True)
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/session.py", line 156, in get_session
    super(Session, self).get_session(sid, authenticated)
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/web/session.py", line 56, in get_session
    (sid, int(authenticated)))
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/local/virtualenv/lib/python2.4/site-packages/Trac-0.11dev_r7225-py2.4.egg/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: current transaction is aborted, commands ignored until end of transaction block

Try editing any of the reports, insert an error and save it. You'll get the above "raw" backtrace (i.e. as text). It must somehow be PostgreSQL specific, maybe the connection is not properly reset after the initial error and all subsequent use will fail (here while retrieving session info during rendering of the error page).

follow-up: ↓ 5   Changed 5 months ago by anonymous

Thank you for looking at this. My version of TRAC is "0.10.4".

Using your suggested "?action=edit", I have finally been able to view the broken report's SQL. Here it is. Unfortunately, at this point I forget the specific change that I had made that resulted in the error report. I think it was "reporter AS modified", but I'm not sure.

SELECT p.value AS __color__,
   id AS ticket,
   priority,
   summary,
   component,
   status,
   version,
   milestone,
   t.type AS type, 
   (CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS owner,
   time AS created,
   changetime AS revised,
   description AS _description,
   reporter AS modified
  FROM ticket t
  LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
  WHERE status IN ('new', 'assigned', 'reopened') 
  ORDER BY p.value, milestone, t.type, time

Your "?action=edit" suggestion led me to wonder if "?action=delete" would also work. It does. I have now (finally) been able to delete this report. Thank You.

Suggestion: On the "available reports" page, add the ability to edit or delete any report without first having to view it.

As far as I'm concerned, this ticket can be closed out.

Thank You, Dave Cole

in reply to: ↑ 4   Changed 5 months ago by cboos

  • keywords needinfo removed

Replying to anonymous:

... at this point I forget the specific change that I had made that resulted in the error report. I think it was "reporter AS modified", but I'm not sure.

That was it, modified is a special name, see TracReports#Automaticallyformattedcolumns.

  Changed 5 months ago by jonas

  • status changed from reopened to closed
  • resolution set to fixed
  • milestone changed from 0.11.2 to 0.11.1

Fixed in r7288 (0.11-stable and r7289 (trunk).

Add/Change #7354 (Unable to Edit or Delete an invalid tickets report)

Author



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