Edgewall Software

Opened 11 years ago

Last modified 10 years ago

#11113 closed defect

AssertionError: Cannot rename non-existent page — at Version 2

Reported by: 506672917@… Owned by:
Priority: normal Milestone: 1.0.2
Component: wiki system Version: 0.12
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Show simple error message rather than a backtrace when trying to delete or rename a non-existing page.

API Changes:
Internal Changes:

Description

How to Reproduce

While doing a POST operation on /wiki/WikiStart, Trac issued an internal error.

i was renamed the WikiStart page to ProjectHome and put a redirecting link to the new page. when i browse my trac the index page still show me WikiStart,I have to click the redirecting link to my ProjectHome. So I decide delete the WikiStart page,but it is still there.then i try to rename it again, and then it happens.

Request parameters:

{'__FORM_TOKEN': u'356d7841fc0d87d60a16535f',
 'action': u'rename',
 'new_name': u'ProjectHome',
 'page': u'WikiStart',
 'submit': u'\u91cd\u547d\u540d\u9875\u9762'}

User agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

System Information

Trac 0.12
Babel 0.9.5
Genshi 0.6
pysqlite 2.6.0
Python 2.7.3 (default, Mar 14 2013, 15:39:00)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)]
setuptools 0.6
SQLite 3.3.6
jQuery 1.4.2

Enabled Plugins

AutocompleteUsers 0.4.2dev
BreadCrumbsNav 0.2
TicketExtPlugin 0.3.2
Tracchildtickets 2.5.2
TracCustomFieldAdmin 0.2.8
TracDateField 2.0.0dev
TracWysiwyg 0.12.0.4

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/trac/wiki/web_ui.py", line 149, in process_request
    return self._do_rename(req, page)
  File "build/bdist.linux-i686/egg/trac/wiki/web_ui.py", line 304, in _do_rename
    @self.env.with_transaction()
  File "build/bdist.linux-i686/egg/trac/db/api.py", line 77, in transaction_wrapper
    fn(ldb)
  File "build/bdist.linux-i686/egg/trac/wiki/web_ui.py", line 306, in do_rename
    page.rename(new_name)
  File "build/bdist.linux-i686/egg/trac/wiki/model.py", line 165, in rename
    assert self.exists, 'Cannot rename non-existent page'
AssertionError: Cannot rename non-existent page

Change History (2)

in reply to:  description comment:1 by anonymous, 11 years ago

perhaps the WikiStart page was cached by my proxy server so i got the WikiStart Page so i can delete or rename an non-existent page. maybe it is a false bug.

comment:2 by Christian Boos, 11 years ago

Milestone: 1.0.2
Release Notes: modified (diff)

Or you had that page still present in another tab or another browser, yes.

The internal error is not so nice, we could at least raise a TracError for this, as this is quite easy to trigger.

Done so in r11795.

Note: See TracTickets for help on using tickets.