Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#9316 closed defect (fixed)

TypeError: iteration over non-sequence when open timeline via a user with non trac-admin permission (a user with trac-admin is ok, no error)

Reported by: solarxie@… Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: general Version: 0.12b1
Severity: normal Keywords: needinfo
Cc: leho@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

如何重现

当进行 GET 操作于 /timeline, Trac产生内部错误.

(请在此附加详细情况)

系统信息

Trac 0.12b1
Babel 0.9.5
Docutils 0.6
FullBlog 0.1.1-r0
Genshi 0.6
mod_python 3.2.8
psycopg2 2.0.13 (dt dec ext pq3)
Pygments 1.3.1
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
pytz 2010h
setuptools 0.6c9
Subversion 1.6.5 (r38866)

已启用插件

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 512, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 233, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/timeline/web_ui.py", line 135, in process_request
    available_filters += event_provider.get_timeline_filters(req)
TypeError: iteration over non-sequence

Attachments (1)

9316-robust-enumeration-r9648.patch (15.1 KB ) - added by Remy Blank 15 years ago.
Make enumerations from interfaces more robust.

Download all attachments as: .zip

Change History (16)

comment:1 by Remy Blank, 15 years ago

Keywords: needinfo added

Mmh, so here's one danger of localizing automatic error reports…

I see you have FullBlogPlugin installed, are there any others? Does the issue still happen with all plugins disabled?

comment:2 by Remy Blank, 15 years ago

I can view the timeline correctly even in the situation you describe, so there must be something else.

in reply to:  2 comment:3 by anonymous, 15 years ago

Replying to rblank:

I can view the timeline correctly even in the situation you describe, so there must be something else.

yes, very surprised.

  1. there is multiple trac projects, only one project has such error, others ok.
  2. this error happens after i upgrade my trac from 0.11 to 0.12b1.
  3. for the project with error, if I login in with permission of TRAC-ADMIN, no error.
  4. here are the projects:

http://lzwsy1.gnway.net:8088/trac/his-mz/timeline http://lzwsy1.gnway.net:8088/trac/his-zy/timeline

comment:4 by Remy Blank, 15 years ago

You didn't answer the question about plugins: do you use any others besides FullBlogPlugin?

in reply to:  4 comment:5 by anonymous, 15 years ago

Replying to rblank:

You didn't answer the question about plugins: do you use any others besides FullBlogPlugin?

there are some other plugins:

[components]
acct_mgr.admin.accountmanageradminpage =disabled
acct_mgr.api.accountmanager = disabled
acct_mgr.htfile.htpasswdstore = disabled
acct_mgr.web_ui.accountmodule = disabled
acct_mgr.web_ui.loginmodule = dissabled
iniadmin.iniadmin.iniadminplugin = disabled
svnauthz.* = disabled
trac.web.auth.loginmodule = disabled
tracdiscussion.admin.discussionwebadmin = disabled
tracdiscussion.api.discussionapi = disabled
tracdiscussion.wiki.discussionwiki = disabled
tracfullblog.* = disabled
tracfullblog.admin.fullblogadminpanel = disabled
tracfullblog.core.fullblogcore = disabled
tracfullblog.db.fullblogsetup = disabled
tracfullblog.macros.bloglistmacro = disabled
tracfullblog.web_ui.fullblogmodule = disabled
tractags.* = disabled
tracusermanager.* = disabled
tracwysiwyg.* = disabled

tested, disabled all plugins, it did still happen.

comment:6 by Remy Blank, 15 years ago

Resolution: fixed
Status: newclosed

Got it: this happens when the user doesn't have CHANGESET_VIEW. It's fixed in [9645].

Thanks for testing and insisting!

comment:7 by Remy Blank, 15 years ago

Owner: set to Remy Blank

comment:8 by Christian Boos, 15 years ago

Glad you found the exact reason, but what about doing in addition:

  • trac/timeline/web_ui.py

     
    132132
    133133        available_filters = []
    134134        for event_provider in self.event_providers:
    135             available_filters += event_provider.get_timeline_filters(req)
     135            available_filters += event_provider.get_timeline_filters(req) or []
    136136
    137137        filters = []
    138138        # check the request or session for enabled filters, or use default

to make that code a bit more robust? (be lenient in what you accept…)

in reply to:  6 comment:9 by anonymous, 15 years ago

Replying to rblank:

Got it: this happens when the user doesn't have CHANGESET_VIEW. It's fixed in [9645].

Thanks for testing and insisting!

if i want to fix the bug, just to update the file of …/trac/versioncontrol/web_ui/changeset.py as [9645], right? after i updated the file of changeset.py, [9136] disappeared, but a new bug appeared when i "browse source", as below:

==== 如何重现 ====

当进行 GET 操作于 `/browser`, Trac产生内部错误.

''(请在此附加详细情况)''


请求参数:
{{{
{'path': '/'}
}}}


==== 系统信息 ====

|| '''`Trac`''' || `0.12b1` ||
|| '''`Babel`''' || `0.9.5` ||
|| '''`Docutils`''' || `0.6` ||
|| '''`FullBlog`''' || `0.1.1-r0` ||
|| '''`Genshi`''' || `0.6` ||
|| '''`mod_python`''' || `3.2.8` ||
|| '''`psycopg2`''' || `2.0.13 (dt dec ext pq3)` ||
|| '''`Pygments`''' || `1.3.1` ||
|| '''`Python`''' || `2.4.3 (#1, Sep  3 2009, 15:37:37) ` [[br]] `[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]` ||
|| '''`pytz`''' || `2010h` ||
|| '''`setuptools`''' || `0.6c9` ||
|| '''`Subversion`''' || `1.6.5 (r38866)` ||

==== 已启用插件 ====


==== Python Traceback ====
{{{
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 512, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 255, in dispatch
    content_type)
  File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 828, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 799, in load_template
    return self.templates.load(filename, cls=cls)
  File "/usr/lib/python2.4/site-packages/Genshi-0.6-py2.4.egg/genshi/template/loader.py", line 246, in load
TemplateNotFound: Template "browser.html" not found

}}}

in reply to:  8 comment:10 by Remy Blank, 15 years ago

Replying to cboos:

to make that code a bit more robust? (be lenient in what you accept…)

Why not? The docstring explicitly mentions that a list must be returned, but I have nothing against making the code more robust.

If you commit the change, you may want to revert my fix.

Last edited 15 years ago by Remy Blank (previous) (diff)

comment:11 by lkraav <leho@…>, 15 years ago

hmmm, this fix could possibly have a helping effect on comment:11:ticket:6644, going to debug now.

in reply to:  8 ; comment:12 by Remy Blank, 15 years ago

Replying to cboos:

Glad you found the exact reason, but what about doing in addition:

Then again, why not make all "enumeration" methods in our interfaces more robust? The following patch does just that.

Thoughts?

by Remy Blank, 15 years ago

Make enumerations from interfaces more robust.

comment:13 by lkraav <leho@…>, 15 years ago

Cc: leho@… added

in reply to:  12 comment:14 by Christian Boos, 15 years ago

Replying to rblank:

Replying to cboos:

Glad you found the exact reason, but what about doing in addition:

Then again, why not make all "enumeration" methods in our interfaces more robust? The following patch does just that.

Thoughts?

Looks like a good thing to do, yes.

comment:15 by Remy Blank, 15 years ago

Patch applied in [9665].

Modify Ticket

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