Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#6702 closed defect (fixed)

TypeError: iteration over non-sequence

Reported by: trac@… Owned by: Jonas Borgström
Priority: high Milestone: 0.11
Component: ticket system Version: 0.11b1
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /ticket/6, Trac issued an internal error.

After implementing the vulnerability_tickets.py plugin from source:trunk/sample-plugins/permissions I get the following error message when trying to submit a ticket.

Request parameters:

{'id': u'6'}

System Information

Trac 0.11b1
Python 2.4.4 (#1, Apr 5 2007, 20:09:06)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
setuptools 0.6c3
SQLite 2.8.17
pysqlite 1.0.1
Genshi 0.4.4
Pygments 0.9
Subversion 1.4.2 (r22196)

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/web/main.py", line 398, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/web/main.py", line 195, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/ticket/web_ui.py", line 159, in process_request
    return self._process_ticket_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/ticket/web_ui.py", line 412, in _process_ticket_request
    req.perm('ticket', id, version).require('TICKET_VIEW')
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/perm.py", line 538, in require
    if not self._has_permission(action, resource):
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/perm.py", line 530, in _has_permission
    decision = PermissionSystem(self.env). \
  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/perm.py", line 424, in check_permission
    perm)
  File "/home/trac/projects/test/plugins/vulnerability_tickets.py", line 45, in check_permission
    (resource.id,)):
TypeError: iteration over non-sequence

Attachments (0)

Change History (10)

comment:1 by trac@…, 16 years ago

Component: generalticket system

I just found out that the ticket is actually committed but the error occurs when trying to view the ticket or even the report view of the ticket.

I think this probably belongs to the ticket system

comment:2 by Christian Boos, 16 years ago

Keywords: permission added
Milestone: 0.11
Priority: normalhigh

comment:3 by Christian Boos, 16 years ago

Keywords: needinfo added
Priority: highnormal
SQLite: 2.8.17
pysqlite: 1.0.1

Wow. Trac 0.11 works with that! Very surprising.

Please upgrade to something more recent and try again…

in reply to:  3 comment:4 by anonymous, 16 years ago

Resolution: invalid
Status: newclosed

Replying to cboos:

SQLite: 2.8.17
pysqlite: 1.0.1

Wow. Trac 0.11 works with that! Very surprising.

Please upgrade to something more recent and try again…

ups yes that was the reason…

It works now with PySqlite is version 2 (2.3.2), compiled and linked to use version SQLite 3.3.8. (on Debian Etch). Thank you for the quick reaction :)

comment:5 by Emmanuel Blot, 16 years ago

Keywords: documentation added; permission needinfo removed
Resolution: invalid
Severity: normalminor
Status: closedreopened

The documentation needs to be updated for 0.11: TracInstall#ForSQLite

It should be explicitly stated that SQLite 3.x is required.

Re-opening the ticket as a documentation reminder.

in reply to:  5 comment:6 by Emmanuel Blot, 16 years ago

Replying to eblot:

Re-opening the ticket as a documentation reminder.

Maybe something as:

=== For SQLite ===

 * [http://www.sqlite.org/ SQLite], version 3.3.4 and above preferred.
 * If not using Python-2.5: [http://pysqlite.org/ PySQLite], version 2.x (for SQLite 3.x), version 2.3.2 preferred. For details see PySqlite

''Note: PySQLite 2.x (SQLite 3.x) is required for Trac [milestone:0.11]. Do not use PySQLite 1.x (SQLite 2.x)''

BTW if PySQLite 1.x is known to cause issues, it might be useful to add this version dependency in the Trac backend code and maybe in the extras_require section of setup.py ?

comment:7 by Noah Kantrowitz, 16 years ago

If the problem is with this one plugin, why not fix it?

comment:8 by Christian Boos, 16 years ago

I think there are many places in the code where we expect to be able to iterate on an empty result set. But I agree that in this case, it's a bit weird that no results are given back (as the ticket exists). So it might be another bug at the SQLite / PySqlite 1 level.

Anyway, pysqlite 1.0.x is way old, and pysqlite2 is mature since years, so I don't think it's worth supporting 1.0.x for 0.11 anymore.

comment:9 by Christian Boos, 16 years ago

Priority: normalhigh

Interestingly I just had this issue myself, but with MySQL.

comment:10 by Christian Boos, 16 years ago

Keywords: documentation removed
Resolution: fixed
Status: reopenedclosed

Argh… should have been obvious. Fixed in r6669.

So related to comment:4, it may well be that pysqlite1 still works with 0.11 (the reporter would have reported other errors if not).

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.