Edgewall Software

Opened 16 years ago

Closed 11 years ago

Last modified 3 years ago

#7354 closed defect (fixed)

Unable to Edit or Delete an invalid tickets report

Reported by: dbcole@… Owned by: Jonas Borgström
Priority: normal Milestone: 0.11.1
Component: report system Version:
Severity: normal Keywords:
Cc: Ryan J Ollos Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

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

Change History (11)

comment:1 by Piotr Kuczynski <piotr.kuczynski@…>, 16 years ago

Component: generalreport system
Keywords: needinfo added

comment:2 by osimons, 16 years ago

Resolution: worksforme
Status: newclosed

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.

comment:3 by Christian Boos, 16 years ago

Description: modified (diff)
Milestone: 0.11.2
Resolution: worksforme
Status: closedreopened

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

comment:4 by anonymous, 16 years ago

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,
   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 comment:5 by Christian Boos, 16 years ago

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.

comment:6 by Jonas Borgström, 16 years ago

Resolution: fixed
Status: reopenedclosed

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

comment:7 by anonymous, 11 years ago

Priority: normalhigh
Resolution: fixed
Status: closedreopened

I have kind of a similar problem… I made a change in a report and now I am unable to view the report again! Each time I click on the report my browser gets an error saying: connection lost. This happens only on that specific report, so I'm sure it depends on my made changes. Perhaps I made a typo or something…

This is very anoying, because I am unable to delete the report due to the fact that I cannot open it again! There also is no trac-admin command for this issue so I am completely chanceless to get rid of this…

I would be very happy if someone could help me out here! I definitly support the suggestion to add the ability to edit or delete any report without first having it to view, but a trac-admin command for editing reports would be fine either way.

in reply to:  7 comment:8 by Ryan J Ollos, 11 years ago

Priority: highnormal
Resolution: fixed
Status: reopenedclosed

Replying to anonymous:

I have kind of a similar problem… I made a change in a report and now I am unable to view the report again!

What version of Trac are you running? What database backend? Is there a traceback displayed or any info in the logs? Did you try the workaround suggested in comment:4? That may allow you to view the SQL, which we ask you to kindly paste here, as well as allow you to delete the existing report. Please capture the existing SQL before deleting so that we can try to reproduce the issue.

If your issue proves to exist in the latest stable versions of Trac we will create a new ticket to fix the issue rather than reopening this old ticket.

comment:9 by Ryan J Ollos, 11 years ago

Cc: Ryan J Ollos added

comment:10 by anonymous, 10 years ago

Wow, thanks a lot for your quick response! I just saw it. That was my first ticket/comment here and I had no idea you guys reply that fast to an old ticket, so after 5 minutes of thinking I solved my problem with another workaround (delete and reinstall ;-) which seemed to be a good idea, because I installed my Trac environment about 30 minutes before I had the problem. Therefore I only had to reedit 5 reports to have my original setting again. A deeper search to solve the problem didn't seem to be a faster solution, sorry.

But I don't want to miss the chance to ask a few more questions that I do not have to reinstall Trac with the next SQL error… I am using Trac in version 0.11.7 with its default database. Unfortunately I couldn't find a traceback in a fast way. Where should I have been searching?

The workaround in comment:4 do not seem to solve my problem, but I have to say that I do not really understand what to do and why to do that steps. If I cannot open a report why editing another one that is working?

You also suggested to paste my report in here, but I couldn't open/view it again, so how should I have been doing that?

comment:11 by Ryan J Ollos, 10 years ago

Since you can't provide any more information about the anomaly, there is nothing we can do for now. Please ask on the MailingList if you have further questions or if the situation arises again. Trac 0.11.7 is rather old and its suggested that you install 1.0 for new installations.

Modify Ticket

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