Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

#10206 closed defect (cantfix)

Tickets with broken fields break Trac

Reported by: wrobel@… Owned by:
Priority: normal Milestone:
Component: ticket system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Tickets with broken fields (eg. unhandled type conversion errors caused by plugins) break trac ticket reports. It would be better if trac skipped such tickets and only provide message about it.

Attachments (0)

Change History (6)

comment:1 by Remy Blank, 13 years ago

With the limited information you gave, I would argue that it's the plugin's responsibility to handle type conversions gracefully. But if you provided a specific example (which plugin you use, what input generates what error), we may see where we could improve Trac to avoid such errors.

comment:2 by anonymous, 13 years ago

I agree that it is the plugin responsibility to check for valid ticket fields, but I have encountered this problem with two different plugins already (when submitting from Eclipse Mylyn). The problem is that such errors break all Trac's functionality like: View tickets, timeline, etc. so I propose that Trac could be a bit more foolproof :)

Oops… Trac detected an internal error:

ValueError?: invalid literal for int() with base 10: 'true'

File "/usr/share/python2.6/site-packages/trac/web/main.py", line 511, in _dispatch_request 
File "/usr/share/python2.6/site-packages/trac/web/main.py", line 237, in dispatch 
File "/usr/share/python2.6/site-packages/trac/ticket/report.py", line 118, in process_request 
File "/usr/share/python2.6/site-packages/trac/ticket/report.py", line 522, in _render_view 
File "/usr/share/python2.6/site-packages/trac/perm.py", line 553, in has_permission 
File "/usr/share/python2.6/site-packages/trac/perm.py", line 567, in _has_permission 
File "/usr/share/python2.6/site-packages/trac/perm.py", line 454, in check_permission 
File "build/bdist.linux-i686/egg/sensitivetickets/sensitivetickets.py", line 55, in check_permission

System information:

User Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 
Trac 0.12.2 
Babel 0.9.5 
CustomFieldAdmin? 0.2.5 
Genshi 0.6 
pysqlite 2.6.0 
Python 2.6.2 (r262:71600, May 3 2009, 15:02:15) [GCC 4.3.3 20090211 (release)] 
RPC 1.1.2-r9913 
setuptools 0.6c11 
SQLite 3.7.2 
jQuery 1.4.2 

Enabled plugins: 

BlackMagicTicketTweaks? 0.12r1 /usr/share/trac/plugins/BlackMagicTicketTweaks-0.12r1-py2.6.egg 
nevernotifyupdaterplugin 0.0.9 /usr/share/python2.6/site-packages/nevernotifyupdaterplugin-0.0.9-py2.6.egg 
sensitivetickets 0.11r1 /usr/share/trac/plugins/sensitivetickets-0.11r1-py2.6.egg 
TicketImport? 0.8 /usr/share/python2.6/site-packages/TicketImport-0.8-py2.6.egg 
TicketSidebarProvider? 0.0 /usr/share/trac/plugins/TicketSidebarProvider-0.0-py2.6.egg 
TracAccountManager? 0.3dev-r9929 /usr/share/python2.6/site-packages/TracAccountManager-0.3dev_r9929-py2.6.egg 
Tracchildtickets 2.4.0-BETA /usr/share/python2.6/site-packages/Tracchildtickets-2.4.0_BETA-py2.6.egg 
TracCondFields? 2.0 /usr/share/trac/plugins/TracCondFields-2.0-py2.6.egg 
TracCustomFieldAdmin? 0.2.5 /usr/share/python2.6/site-packages/TracCustomFieldAdmin-0.2.5-py2.6.egg 
TracDiscussion? 0.8-r9877 /usr/share/trac/plugins/TracDiscussion-0.8_r9877-py2.6.egg 
TracMasterTickets? 3.0.2 /usr/share/trac/plugins/TracMasterTickets-3.0.2-py2.6.egg 
TracXMLRPC 1.1.2-r9913 /usr/share/python2.6/site-packages/TracXMLRPC-1.1.2_r9913-py2.6.egg 
Last edited 13 years ago by Christian Boos (previous) (diff)

comment:3 by Remy Blank, 13 years ago

In this particular case, the error occurs while checking permissions for a ticket. What we could do is swallow (and log) all errors in permission checks, and deny permission in case of error. I'm not sure this is good, though, as such an error would then go unnoticed until someone goes through the logs.

comment:4 by Carsten Klein <carsten.klein@…>, 13 years ago

Actually the problem lies within the plugin itself:

48 	        if resource and resource.realm == 'ticket'  and resource.id is not None:
49 	            try:
50 	                ticket = Ticket(self.env, int(resource.id))
51 	                sensitive = ticket['sensitive']
52 	            except ResourceNotFound:
53 	                sensitive = 1  # Fail safe to prevent a race condition.
54 	
55 	            if sensitive and int(sensitive):
56 	                if 'SENSITIVE_VIEW' not in perm:
57 	                    return False

It does not check whether ticketsensitive is an int or a boolean or any other string.

Please file a bug against the plugin over at tho.

in reply to:  4 comment:5 by Carsten Klein <carsten.klein@…>, 13 years ago

Replying to Carsten Klein <carsten.klein@…>:

I'd say won't fix as it is not a bug in Trac.

comment:6 by Christian Boos, 13 years ago

Resolution: cantfix
Status: newclosed

Right, cantfix (PluginIssue).

Modify Ticket

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