Edgewall Software
Modify

Opened 12 years ago

Last modified 11 years ago

#9157 new defect

backtrace in attachment description

Reported by: Christian Boos Owned by:
Priority: lowest Milestone: next-major-releases
Component: attachment Version: 0.12dev
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Seen this backtrace in the logs:

[pid  1122634064] 2010-03-22 10:02:24,962 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 504, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/trac/attachment.py", line 371, in process_request
    parent_name = get_resource_name(self.env, parent)
  File "build/bdist.linux-x86_64/egg/trac/resource.py", line 332, in get_resource_name
    return get_resource_description(env, resource)
  File "build/bdist.linux-x86_64/egg/trac/resource.py", line 329, in get_resource_description
    return manager.get_resource_description(resource, format, **kwargs)
  File "build/bdist.linux-x86_64/egg/trac/attachment.py", line 527, in get_resource_description
    parent=get_resource_name(self.env, resource.parent))
  File "build/bdist.linux-x86_64/egg/trac/resource.py", line 332, in get_resource_name
    return get_resource_description(env, resource)
  File "build/bdist.linux-x86_64/egg/trac/resource.py", line 322, in get_resource_description
    manager = ResourceSystem(env).get_resource_manager(resource.realm)
AttributeError: 'NoneType' object has no attribute 'realm'

This was for the following request:

66.249.65.117 trac.edgewall.org - [22/Mar/2010:10:02:25 +0100] "GET /attachment/attachment/ticket/6109/?action=new HTTP/1.1" 500 9389 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

Attachments (0)

Change History (6)

comment:1 by Remy Blank, 12 years ago

This looks like a crawler indexed t.e.o in the small time windows where the t.e.o-specific hack wasn't applied (duplicated /attachment).

comment:2 by Christian Boos, 12 years ago

Right, but nevertheless we shouldn't get a traceback on such links (attachment/attachment/ticket/6109/).

Version 0, edited 12 years ago by Christian Boos (next)

comment:3 by Remy Blank, 12 years ago

I'm not sure about that. I have always assumed that we should avoid showing tracebacks for any URLs that are generated by Trac (i.e. by clicking and entering something in a form), but take a more relaxed stance if the user manipulates the URL. The /attachment/attachment/* URL is never generated by Trac (except due to user error), so I don't see that as an issue.

Now, my assumption may be wrong, of course. But then, what about the following:

So my question is: should we avoid tracebacks in all situations, even with URL manipulation?

comment:4 by Thijs Triemstra, 12 years ago

Keywords: needinfo added

in reply to:  3 comment:5 by Christian Boos, 11 years ago

Milestone: next-minor-0.12.xnext-major-0.1X
Priority: normallowest

Replying to rblank:

So my question is: should we avoid tracebacks in all situations, even with URL manipulation?

Right, it's probably not possible to care about every possible misuse of the application.

I'd like to fix that specific issue though, but it's not high priority. The next time I do something in this area of the code ;-)

comment:6 by Christian Boos, 11 years ago

Keywords: needinfo removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.