Modify

Opened 10 months ago

Closed 10 months ago

Last modified 8 months ago

#11592 closed defect (fixed)

Cannot create forums with Trac 1.0.1.

Reported by: vrowley@… Owned by: rjollos
Priority: normal Component: DiscussionPlugin
Severity: normal Keywords: ProgrammingError, closed, cursor
Cc: Trac Release: 1.0

Description

Hi,

I'm trying to use the plug-in in Trac 1.0.1.

I use changeset:9787 of http://trac-hacks.org/svn/discussionplugin/0.11.

I'm unable to create forums.

I get the following Trac error in the timeline.

Event provider DiscussionTimeline failed for filters "Discussion changes": ProgrammingError: Cannot operate on a closed cursor.

The log file includes:

2014-02-20 16:46:15,809 Trac[web_ui] ERROR: Timeline event provider failed: 
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/timeline/web_ui.py", line 194, in process_request
    filters) or []:
  File "build/bdist.linux-x86_64/egg/tracdiscussion/timeline.py", line 54, in get_timeline_events
    for forum in api.get_changed_forums(context, start, stop):
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 1809, in get_changed_forums
    context.cursor.execute(sql, values)
  File "build/bdist.linux-x86_64/egg/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "build/bdist.linux-x86_64/egg/trac/db/sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "build/bdist.linux-x86_64/egg/trac/db/sqlite_backend.py", line 56, in execute
    args or [])
  File "build/bdist.linux-x86_64/egg/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
ProgrammingError: Cannot operate on a closed cursor.
2014-02-20 16:46:15,810 Trac[main] WARNING: [10.14.1.106] HTTPInternalError: 500 Trac Error (<p class="message">Event provider <tt>DiscussionTimeline</tt> failed for filters "Discussion changes": <b>ProgrammingError: Cannot operate on a closed cursor.</b></p><p>You may want to see the <a href="/lynx/timeline?wiki=on&amp;changeset=on&amp;ticket=on&amp;milestone=on">other kinds of events</a> from the Timeline or notify your Trac administrator about the error (detailed information was written to the log).</p>)

Any idea of what is going on?

By the way, I also tried with changeset:13444 and had the same issues.

Regards,

Vincent

Attachments (0)

Change History (36)

comment:1 Changed 10 months ago by rjollos

  • Owner changed from Blackhex to rjollos
  • Status changed from new to accepted

The db object goes out of scope in api.get_changed_forums. Fix is on the way.

comment:2 Changed 10 months ago by anonymous

Hi,

Thanks for your comment. By the way, the error goes away if I disable

DiscussionTimeline	(tracdiscussion.timeline.*)

This still does not enable me to create forums so perhaps there are two issues here.

Thanks,

Vincent

comment:3 Changed 10 months ago by rjollos

Activity at log:discussionplugin/0.11 shows that r9787 is far out of date. I'll work on resolving the timeline issue, but please upgrade to the latest before we go hunting for the issue about creating forums, since it may already be fixed.

comment:4 Changed 10 months ago by rjollos

In 13706:

0.9dev: Fix for Cannot operate on a closed cursor because db object is out-of-scope when using the cursor to retrieve timeline events. Refs #11592.

comment:5 follow-up: Changed 10 months ago by rjollos

Would you kindly let me know if both your issues are resolved after upgrading to 0.9dev-r13706?

comment:6 in reply to: ↑ 5 Changed 10 months ago by anonymous

Replying to rjollos:

Would you kindly let me know if both your issues are resolved after upgrading to 0.9dev-r13706?

Hi,

Thank you for the great support.

The timeline issue is indeed resolved.

I'm still unable to create forums though.

I originally tried with changeset:13444 and could not create forums. I then tried changeset:9787 since DiscussionPlugin#PluginVersions seemed to indicate that changeset:9787 could be the most stable version.

What should be the next step?

Regards,

Vincent

Last edited 10 months ago by rjollos (previous) (diff)

comment:7 follow-up: Changed 10 months ago by rjollos

Thanks, I've removed that comment. I would advise running r13706, as it contains all the bug fixes.

I'll need more information on what happens when you try to create a forum. Any errors or tracebacks? Anything in TracLogging?

comment:8 in reply to: ↑ 7 Changed 10 months ago by anonymous

Replying to rjollos:

Thanks, I've removed that comment. I would advise running r13706, as it contains all the bug fixes.

I'll need more information on what happens when you try to create a forum. Any errors or tracebacks? Anything in TracLogging?

I do not get any errors.

I get the following in the log file.

2014-02-20 20:40:30,563 Trac[api] DEBUG: actions: ['forum-post-add']
2014-02-20 20:40:30,563 Trac[api] DEBUG: req.args: {'group': u'0', 'description': u'Test3', '__FORM_TOKEN': u'680347326cae59478a88f13b', 'submit': u'Submit', 'unregistered_subscribers': u'', 'moderators': u'vrowley', 'subscribers': u'vrowley', 'subject': u'Test2', 'discussion_action': u'post-add', 'name': u'Test1'}
2014-02-20 20:40:30,563 Trac[api] DEBUG: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (Test3,vrowley,0,vrowley,vrowley,1392946830,Test2,Test1)
2014-02-20 20:40:30,569 Trac[api] DEBUG: SELECT id, forum_group, name, subject, time, author, moderators, subscribers, description FROM forum WHERE time = 1392946830
2014-02-20 20:40:30,569 Trac[api] DEBUG: forum_change_listeners: [<tracdiscussion.notification.DiscussionEmailNotification object at 0x2a9b91a450>]
2014-02-20 20:40:30,570 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 20:40:30,589 Trac[notification] DEBUG: to_recipients: [] cc_recipients: [u'vrowley']
2014-02-20 20:40:30,590 Trac[notification] INFO: Sending notification through SMTP at imail.gennum.com:25 to [u'vrowley@semtech.com']
2014-02-20 20:40:33,709 Trac[api] DEBUG: template: forum-post-add.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': {'name': u'Test1', 'author': u'vrowley', 'description': u'Test3', 'tags': [], 'forum_group': 0, 'moderators': [u'vrowley'], 'link': u'http://dmsrv.gennum.com:8008/lynx/discussion/forum/1', 'subscribers': [u'vrowley'], 'time': 1392946830, 'id': 1, 'subject': u'Test2'}, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 1, 40, 33, 708976, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-post-add', 'env': <trac.env.Environment object at 0x2a9b80e390>, 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None}
2014-02-20 20:40:33,709 Trac[core] DEBUG: Redirecting to /lynx/discussion
2014-02-20 20:40:34,153 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion/redirect'">
2014-02-20 20:40:34,157 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 20:40:34,687 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion'">
2014-02-20 20:40:34,688 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 20:40:34,690 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 20:40:34,701 Trac[api] DEBUG: realm: discussion-core, action: None, format: None preview: False, submit: False
2014-02-20 20:40:34,701 Trac[api] DEBUG: actions: ['forum-list']
2014-02-20 20:40:34,701 Trac[api] DEBUG: req.args: {}
2014-02-20 20:40:34,701 Trac[api] DEBUG: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 20:40:34,703 Trac[api] DEBUG: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 20:40:34,705 Trac[api] DEBUG: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 20:40:34,707 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 20:40:34,710 Trac[api] DEBUG: template: forum-list.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 1, 40, 34, 707611, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e390>, 'desc': False}
2014-02-20 20:40:38,555 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/timeline'">
2014-02-20 20:40:38,556 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 20:40:38,558 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 20:40:38,580 Trac[timeline] DEBUG: start: 2014-01-20 23:59:59.999999-05:00, stop: 2014-02-20 23:59:59.999999-05:00, filters: ['milestone', 'ticket', 'changeset', 'wiki', 'discussion']
2014-02-20 20:40:38,580 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 20:40:38,582 Trac[api] DEBUG: SELECT f.id, f.name, f.author, f.time, f.subject, f.description FROM forum f WHERE f.time BETWEEN 1390280399 AND 1392958799 ORDER BY time ASC 
2014-02-20 20:40:38,584 Trac[api] DEBUG: SELECT t.id, t.forum, f.name, t.time, t.author, t.subject, t.status FROM topic t LEFT JOIN (SELECT id, name FROM forum) f ON t.forum = f.id WHERE t.time BETWEEN 1390280399 AND 1392958799 ORDER BY time ASC
2014-02-20 20:40:38,586 Trac[api] DEBUG: SELECT m.id, m.forum, f.name, m.topic, t.subject, m.time, m.author FROM message m LEFT JOIN (SELECT id, name FROM forum) f ON m.forum = f.id LEFT JOIN (SELECT id, subject FROM topic) t ON m.topic = t.id WHERE time BETWEEN 1390280399 AND 1392958799 ORDER BY time ASC
Last edited 10 months ago by rjollos (previous) (diff)

comment:9 follow-up: Changed 10 months ago by rjollos

What database backend are you using?

comment:10 in reply to: ↑ 9 Changed 10 months ago by anonymous

Replying to rjollos:

What database backend are you using?

How do I retrieve this information?

comment:11 Changed 10 months ago by rjollos

You [trac] database string is a good indicator. Does it begin with postgres:, mysql: or sqlite:?

comment:12 Changed 10 months ago by anonymous

We have the following:

[trac]
database = sqlite:db/trac.db
Last edited 10 months ago by rjollos (previous) (diff)

comment:13 Changed 10 months ago by rjollos

Please set [trac] debug_sql = true and post the recording from the log when creating a forum (see TracIni#trac-section).

comment:14 Changed 10 months ago by anonymous

Here is the info:

2014-02-20 21:11:23,995 Trac[api] DEBUG: req.args: {'group': u'0', 'description': u'', '__FORM_TOKEN': u'680347326cae59478a88f13b', 'submit': u'Submit', 'unregistered_subscribers': u'', 'moderators': u'vrowley', 'subscribers': u'vrowley', 'subject': u'', 'discussion_action': u'post-add', 'name': u'Test1'}
2014-02-20 21:11:23,995 Trac[api] DEBUG: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (,vrowley,0,vrowley,vrowley,1392948683,,Test1)
2014-02-20 21:11:23,995 Trac[util] DEBUG: SQL: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
2014-02-20 21:11:23,995 Trac[util] DEBUG: args: (u'', u'vrowley', 0, u'vrowley', u'vrowley', 1392948683, u'', u'Test1')
2014-02-20 21:11:23,999 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 21:11:23,999 Trac[api] DEBUG: SELECT id, forum_group, name, subject, time, author, moderators, subscribers, description FROM forum WHERE time = 1392948683
2014-02-20 21:11:23,999 Trac[util] DEBUG: SQL: SELECT id, forum_group, name, subject, time, author, moderators, subscribers, description FROM forum WHERE time = %s
2014-02-20 21:11:23,999 Trac[util] DEBUG: args: (1392948683,)
2014-02-20 21:11:23,999 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:23,999 Trac[api] DEBUG: forum_change_listeners: [<tracdiscussion.notification.DiscussionEmailNotification object at 0x2a9bd8f610>]
2014-02-20 21:11:24,111 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 21:11:24,112 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 21:11:24,135 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 21:11:24,160 Trac[notification] DEBUG: to_recipients: [] cc_recipients: [u'vrowley']
2014-02-20 21:11:24,163 Trac[notification] INFO: Sending notification through SMTP at imail.gennum.com:25 to [u'vrowley@semtech.com']
2014-02-20 21:11:27,295 Trac[api] DEBUG: template: forum-post-add.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': {'name': u'Test1', 'author': u'vrowley', 'description': u'', 'tags': [], 'forum_group': 0, 'moderators': [u'vrowley'], 'link': u'http://dmsrv.gennum.com:8008/lynx/discussion/forum/1', 'subscribers': [u'vrowley'], 'time': 1392948683, 'id': 1, 'subject': u''}, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 2, 11, 27, 295419, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-post-add', 'env': <trac.env.Environment object at 0x2a9b9b9150>, 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None}
2014-02-20 21:11:27,296 Trac[core] DEBUG: Redirecting to /lynx/discussion
2014-02-20 21:11:27,454 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion/redirect'">
2014-02-20 21:11:27,455 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 21:11:27,455 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 21:11:27,458 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:27,458 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 21:11:27,458 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 21:11:27,458 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 21:11:27,461 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:27,461 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 21:11:27,461 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 21:11:27,463 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 21:11:27,577 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion'">
2014-02-20 21:11:27,578 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 21:11:27,578 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 21:11:27,578 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 21:11:27,581 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:27,581 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 21:11:27,581 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 21:11:27,581 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 21:11:27,584 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:27,584 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 21:11:27,584 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 21:11:27,586 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 21:11:27,587 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 21:11:27,587 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 21:11:27,590 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:27,590 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 21:11:27,592 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 21:11:27,592 Trac[api] DEBUG: realm: discussion-core, action: None, format: None preview: False, submit: False
2014-02-20 21:11:27,592 Trac[api] DEBUG: actions: ['forum-list']
2014-02-20 21:11:27,592 Trac[api] DEBUG: req.args: {}
2014-02-20 21:11:27,592 Trac[api] DEBUG: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 21:11:27,592 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 21:11:27,596 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 21:11:27,596 Trac[api] DEBUG: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 21:11:27,597 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 21:11:27,598 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 21:11:27,599 Trac[api] DEBUG: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 21:11:27,599 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 21:11:27,601 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 21:11:27,601 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 21:11:27,604 Trac[api] DEBUG: template: forum-list.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 2, 11, 27, 601147, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b9b9150>, 'desc': False}
Last edited 10 months ago by rjollos (previous) (diff)

comment:15 Changed 10 months ago by rjollos

Thanks, I will reply shortly.

comment:16 Changed 10 months ago by rjollos

So after you create a forum from /discussion, you are redirected back to /discussion and you just see?:

Forum List

There are no forums created.

comment:17 follow-up: Changed 10 months ago by rjollos

In 13708:

0.9dev: Keep db object in scope when using a cursor. Refs #11592.

Also fixed an unresolved import and removed logging of SQL because it is implicitly logged (see the [trac] debug_sql configuration item).

comment:18 Changed 10 months ago by rjollos

Okay, I think the issue is the same - the db object is going out of scope. I implemented the changes quickly, and they are extensive, so more testing will be needed. Would you kindly test it out and report back?

comment:19 Changed 10 months ago by anonymous

Hi,

comment:16 accurately captures the issue that I'm experiencing.

Just tried changeset:13708 and I still cannot create forums.

Here is what I find in the log file.

2014-02-20 23:39:53,125 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:39:53,126 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:39:53,126 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:39:53,128 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:39:53,128 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:39:53,131 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:39:53,131 Trac[api] DEBUG: realm: discussion-core, action: None, format: None preview: False, submit: False
2014-02-20 23:39:53,131 Trac[api] DEBUG: actions: ['forum-list']
2014-02-20 23:39:53,131 Trac[api] DEBUG: req.args: {}
2014-02-20 23:39:53,132 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 23:39:53,134 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:39:53,134 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 23:39:53,137 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:39:53,137 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 23:39:53,139 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:39:53,139 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:39:53,143 Trac[api] DEBUG: template: forum-list.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 39, 53, 139811, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'desc': False}

comment:20 Changed 10 months ago by rjollos

That's frustrating. Can you create a forum from the admin page?: /admin/discussion/forum.

comment:21 Changed 10 months ago by anonymous

It does not work either.

2014-02-20 23:52:57,547 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/admin'">
2014-02-20 23:52:57,548 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:52:57,548 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:52:57,548 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:52:57,551 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:52:57,551 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:52:57,551 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:52:57,552 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:52:57,554 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:52:57,554 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:52:57,554 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:52:57,556 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:52:57,556 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:52:57,556 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:52:57,560 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:52:57,560 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-20 23:52:57,563 Trac[util] DEBUG: prefetch: 4 rows
2014-02-20 23:52:57,564 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:53:00,313 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/admin/discussion/forum'">
2014-02-20 23:53:00,314 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:53:00,314 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:00,314 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:00,317 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:00,318 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:53:00,318 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:53:00,318 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:00,320 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:00,320 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:53:00,320 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:00,322 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:53:00,322 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:00,322 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:00,324 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:00,324 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:53:00,326 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:53:00,326 Trac[util] DEBUG: SQL: SELECT id, name, description FROM forum_group WHERE id = %s
2014-02-20 23:53:00,327 Trac[util] DEBUG: args: (-1,)
2014-02-20 23:53:00,328 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:00,329 Trac[api] DEBUG: realm: discussion-admin, action: None, format: None preview: False, submit: False
2014-02-20 23:53:00,329 Trac[api] DEBUG: actions: ['admin-forum-list']
2014-02-20 23:53:00,329 Trac[api] DEBUG: req.args: {'cat_id': u'discussion', 'group': '-1', 'panel_id': u'forum', 'path_info': None}
2014-02-20 23:53:00,329 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 23:53:00,332 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:00,332 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 23:53:00,334 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:00,334 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 23:53:00,336 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:00,336 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:53:00,339 Trac[api] DEBUG: template: admin-forum-list.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 53, 0, 336644, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'admin-forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-admin', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'desc': False}
2014-02-20 23:53:17,162 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/admin/discussion/forum'">
2014-02-20 23:53:17,163 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:53:17,163 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:17,163 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:17,166 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,166 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:53:17,166 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:53:17,166 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:17,168 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,168 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:53:17,168 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:17,171 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:53:17,171 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:17,171 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:17,173 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,173 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-20 23:53:17,175 Trac[util] DEBUG: prefetch: 4 rows
2014-02-20 23:53:17,176 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:53:17,178 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:53:17,178 Trac[util] DEBUG: SQL: SELECT id, name, description FROM forum_group WHERE id = %s
2014-02-20 23:53:17,178 Trac[util] DEBUG: args: (0,)
2014-02-20 23:53:17,180 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:17,180 Trac[api] DEBUG: realm: discussion-admin, action: post-add, format: None preview: False, submit: True
2014-02-20 23:53:17,180 Trac[api] DEBUG: actions: ['forum-post-add']
2014-02-20 23:53:17,181 Trac[api] DEBUG: req.args: {'panel_id': u'forum', 'group': u'', 'description': u'', 'cat_id': u'discussion', '__FORM_TOKEN': u'680347326cae59478a88f13b', 'submit': u'Add', 'unregistered_subscribers': u'', 'moderators': u'vrowley', 'path_info': None, 'subscribers': u'vrowley', 'subject': u'', 'discussion_action': u'post-add', 'name': u'Test'}
2014-02-20 23:53:17,181 Trac[api] DEBUG: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (,vrowley,0,vrowley,vrowley,1392958397,,Test)
2014-02-20 23:53:17,181 Trac[util] DEBUG: SQL: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
2014-02-20 23:53:17,181 Trac[util] DEBUG: args: (u'', u'vrowley', 0, u'vrowley', u'vrowley', 1392958397, u'', u'Test')
2014-02-20 23:53:17,184 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:17,184 Trac[util] DEBUG: SQL: SELECT id, forum_group, name, subject, time, author, moderators, subscribers, description FROM forum WHERE time = %s
2014-02-20 23:53:17,184 Trac[util] DEBUG: args: (1392958397,)
2014-02-20 23:53:17,184 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,184 Trac[api] DEBUG: forum_change_listeners: [<tracdiscussion.notification.DiscussionEmailNotification object at 0x2a9b8e3a10>]
2014-02-20 23:53:17,185 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:53:17,185 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:53:17,185 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:53:17,190 Trac[notification] DEBUG: to_recipients: [] cc_recipients: [u'vrowley']
2014-02-20 23:53:17,192 Trac[notification] INFO: Sending notification through SMTP at imail.gennum.com:25 to [u'vrowley@semtech.com']
2014-02-20 23:53:17,344 Trac[api] DEBUG: template: forum-post-add.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': {'name': u'Test', 'author': u'vrowley', 'description': u'', 'tags': [], 'forum_group': 0, 'moderators': [u'vrowley'], 'link': u'http://dmsrv.gennum.com:8008/lynx/discussion/forum/1', 'subscribers': [u'vrowley'], 'time': 1392958397, 'id': 1, 'subject': u''}, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 53, 17, 343802, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-post-add', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'authname': u'vrowley', 'realm': 'discussion-admin', 'message': None}
2014-02-20 23:53:17,344 Trac[admin] DEBUG: Redirecting to /lynx/admin/discussion/forum
2014-02-20 23:53:17,452 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion/redirect'">
2014-02-20 23:53:17,453 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:17,453 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:17,456 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,456 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:53:17,456 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:53:17,456 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:17,458 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,459 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:53:17,459 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:17,463 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:53:17,616 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/admin/discussion/forum'">
2014-02-20 23:53:17,617 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:53:17,617 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:17,617 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:17,623 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,623 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:53:17,623 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:53:17,623 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:17,625 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,626 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:53:17,626 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:17,628 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:53:17,628 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:17,628 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:17,630 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,631 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:53:17,633 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:53:17,633 Trac[util] DEBUG: SQL: SELECT id, name, description FROM forum_group WHERE id = %s
2014-02-20 23:53:17,633 Trac[util] DEBUG: args: (-1,)
2014-02-20 23:53:17,635 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:17,635 Trac[api] DEBUG: realm: discussion-admin, action: None, format: None preview: False, submit: False
2014-02-20 23:53:17,635 Trac[api] DEBUG: actions: ['admin-forum-list']
2014-02-20 23:53:17,635 Trac[api] DEBUG: req.args: {'cat_id': u'discussion', 'group': '-1', 'panel_id': u'forum', 'path_info': None}
2014-02-20 23:53:17,635 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 23:53:17,637 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:17,637 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 23:53:17,639 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:17,639 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 23:53:17,641 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:17,642 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:53:17,644 Trac[api] DEBUG: template: admin-forum-list.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 53, 17, 641976, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'admin-forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-admin', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'desc': False}
2014-02-20 23:53:24,247 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion'">
2014-02-20 23:53:24,247 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:53:24,248 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:24,248 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:24,269 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:24,269 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:53:24,269 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:53:24,269 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:24,271 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:24,271 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:53:24,271 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:53:24,273 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:53:24,274 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:53:24,274 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:53:24,276 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:24,276 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:53:24,278 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:53:24,278 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-20 23:53:24,280 Trac[util] DEBUG: prefetch: 4 rows
2014-02-20 23:53:24,280 Trac[api] DEBUG: realm: discussion-core, action: None, format: None preview: False, submit: False
2014-02-20 23:53:24,280 Trac[api] DEBUG: actions: ['forum-list']
2014-02-20 23:53:24,281 Trac[api] DEBUG: req.args: {}
2014-02-20 23:53:24,281 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 23:53:24,283 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:53:24,283 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 23:53:24,284 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:24,285 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 23:53:24,286 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:53:24,287 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:53:24,289 Trac[api] DEBUG: template: forum-list.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 53, 24, 287066, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'desc': False}

comment:22 Changed 10 months ago by anonymous

And here is the full trace from the discussion page.

2014-02-20 23:55:35,343 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/discussion'">
2014-02-20 23:55:35,344 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:55:35,345 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:35,345 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:35,347 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:35,347 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:55:35,348 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:55:35,348 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:35,351 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:35,351 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:55:35,351 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:35,353 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:55:35,353 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:35,353 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:35,355 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:35,355 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:55:35,357 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:55:35,358 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-20 23:55:35,360 Trac[util] DEBUG: prefetch: 4 rows
2014-02-20 23:55:35,360 Trac[api] DEBUG: realm: discussion-core, action: add, format: None preview: False, submit: False
2014-02-20 23:55:35,360 Trac[api] DEBUG: actions: ['forum-add']
2014-02-20 23:55:35,360 Trac[api] DEBUG: req.args: {'__FORM_TOKEN': u'680347326cae59478a88f13b', 'discussion_action': u'add', 'newforum': u'New forum'}
2014-02-20 23:55:35,360 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 23:55:35,362 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:35,362 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 23:55:35,364 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:55:35,364 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:55:35,367 Trac[api] DEBUG: template: forum-add.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 55, 35, 364933, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-add', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'env': <trac.env.Environment object at 0x2a9b80e3d0>}
2014-02-20 23:55:45,991 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/discussion'">
2014-02-20 23:55:45,992 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:55:45,993 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:45,993 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:45,995 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:45,996 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:55:45,996 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:55:45,996 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:45,998 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:45,998 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:55:45,998 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:46,000 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:55:46,001 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:46,001 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:46,003 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:46,003 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:55:46,005 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:55:46,006 Trac[util] DEBUG: SQL: SELECT id, name, description FROM forum_group WHERE id = %s
2014-02-20 23:55:46,006 Trac[util] DEBUG: args: (0,)
2014-02-20 23:55:46,008 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:55:46,008 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-20 23:55:46,010 Trac[util] DEBUG: prefetch: 4 rows
2014-02-20 23:55:46,011 Trac[api] DEBUG: realm: discussion-core, action: post-add, format: None preview: False, submit: True
2014-02-20 23:55:46,011 Trac[api] DEBUG: actions: ['forum-post-add']
2014-02-20 23:55:46,011 Trac[api] DEBUG: req.args: {'group': u'0', 'description': u'', 'unregistered_subscribers': u'', 'submit': u'Submit', '__FORM_TOKEN': u'680347326cae59478a88f13b', 'subject': u'', 'discussion_action': u'post-add', 'name': u'Test'}
2014-02-20 23:55:46,011 Trac[api] DEBUG: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (,vrowley,0,,,1392958546,,Test)
2014-02-20 23:55:46,011 Trac[util] DEBUG: SQL: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
2014-02-20 23:55:46,012 Trac[util] DEBUG: args: (u'', u'vrowley', 0, '', '', 1392958546, u'', u'Test')
2014-02-20 23:55:46,015 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:55:46,015 Trac[util] DEBUG: SQL: SELECT id, forum_group, name, subject, time, author, moderators, subscribers, description FROM forum WHERE time = %s
2014-02-20 23:55:46,015 Trac[util] DEBUG: args: (1392958546,)
2014-02-20 23:55:46,015 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:46,015 Trac[api] DEBUG: forum_change_listeners: [<tracdiscussion.notification.DiscussionEmailNotification object at 0x2a9b8e3a10>]
2014-02-20 23:55:46,016 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:55:46,016 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:55:46,017 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:55:46,024 Trac[notification] DEBUG: to_recipients: [] cc_recipients: []
2014-02-20 23:55:46,025 Trac[notification] INFO: no recipient for a ticket notification
2014-02-20 23:55:46,026 Trac[api] DEBUG: template: forum-post-add.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': {'name': u'Test', 'author': u'vrowley', 'description': u'', 'tags': [], 'forum_group': 0, 'moderators': [], 'link': u'http://dmsrv.gennum.com:8008/lynx/discussion/forum/1', 'subscribers': [], 'time': 1392958546, 'id': 1, 'subject': u''}, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 55, 46, 25703, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-post-add', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None}
2014-02-20 23:55:46,026 Trac[core] DEBUG: Redirecting to /lynx/discussion
2014-02-20 23:55:46,869 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion/redirect'">
2014-02-20 23:55:46,870 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:46,870 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:46,873 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:46,873 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:55:46,873 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:55:46,873 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:46,876 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:46,876 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:55:46,876 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:46,877 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:55:47,123 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion'">
2014-02-20 23:55:47,123 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-20 23:55:47,124 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:47,124 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:47,126 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:47,126 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-20 23:55:47,126 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-20 23:55:47,126 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:47,132 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:47,132 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-20 23:55:47,132 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-20 23:55:47,134 Trac[util] DEBUG: prefetch: 8 rows
2014-02-20 23:55:47,134 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-20 23:55:47,134 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-20 23:55:47,136 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:47,136 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-20 23:55:47,138 Trac[util] DEBUG: prefetch: 11 rows
2014-02-20 23:55:47,139 Trac[api] DEBUG: realm: discussion-core, action: None, format: None preview: False, submit: False
2014-02-20 23:55:47,139 Trac[api] DEBUG: actions: ['forum-list']
2014-02-20 23:55:47,139 Trac[api] DEBUG: req.args: {}
2014-02-20 23:55:47,139 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-20 23:55:47,141 Trac[util] DEBUG: prefetch: 1 rows
2014-02-20 23:55:47,141 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-20 23:55:47,143 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:55:47,143 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-20 23:55:47,145 Trac[util] DEBUG: prefetch: 0 rows
2014-02-20 23:55:47,145 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-20 23:55:47,148 Trac[api] DEBUG: template: forum-list.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 4, 55, 47, 145669, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-list', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'forums': [], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'desc': False}

comment:23 Changed 10 months ago by rjollos

I wonder if the commit is being called to late, or not at all. Could you try this patch?

  • discussionplugin/0.11/tracdiscussion/api.py

    diff --git a/discussionplugin/0.11/tracdiscussion/api.py b/discussionplugin/0.11/tracdiscussion/api.py
    index 9824cf2..64c096b 100644
    a b class DiscussionApi(Component): 
    20822082        self.log.debug(sql % values)
    20832083        cursor = context.db.cursor()
    20842084        cursor.execute(sql, values)
     2085        context.db.commit()
    20852086
    20862087    def add_group(self, context, group):
    20872088        self._add_item(context, 'forum_group', group)

comment:24 Changed 10 months ago by anonymous

Bingo!

With:

ca02login8[~/trac_plugins/discussionplugin/0.11]> svn diff 
Index: tracdiscussion/api.py
===================================================================
--- tracdiscussion/api.py       (revision 13708)
+++ tracdiscussion/api.py       (working copy)
@@ -2082,6 +2082,7 @@
         self.log.debug(sql % values)
         cursor = context.db.cursor()
         cursor.execute(sql, values)
+        context.db.commit()
 
     def add_group(self, context, group):
         self._add_item(context, 'forum_group', group)

It worked.

2014-02-21 00:11:28,114 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/discussion'">
2014-02-21 00:11:28,115 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-21 00:11:28,115 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:28,115 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:28,119 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:28,119 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-21 00:11:28,119 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-21 00:11:28,119 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:28,121 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:28,122 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-21 00:11:28,122 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:28,124 Trac[util] DEBUG: prefetch: 8 rows
2014-02-21 00:11:28,124 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:28,124 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:28,126 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:28,127 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-21 00:11:28,129 Trac[util] DEBUG: prefetch: 11 rows
2014-02-21 00:11:28,130 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-21 00:11:28,132 Trac[util] DEBUG: prefetch: 4 rows
2014-02-21 00:11:28,132 Trac[api] DEBUG: realm: discussion-core, action: add, format: None preview: False, submit: False
2014-02-21 00:11:28,132 Trac[api] DEBUG: actions: ['forum-add']
2014-02-21 00:11:28,132 Trac[api] DEBUG: req.args: {'__FORM_TOKEN': u'680347326cae59478a88f13b', 'discussion_action': u'add', 'newforum': u'New forum'}
2014-02-21 00:11:28,133 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-21 00:11:28,135 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:28,135 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-21 00:11:28,137 Trac[util] DEBUG: prefetch: 0 rows
2014-02-21 00:11:28,137 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-21 00:11:28,141 Trac[api] DEBUG: template: forum-add.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 5, 11, 28, 137549, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-add', 'groups': [{'description': 'No Group', 'forums': 0, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'env': <trac.env.Environment object at 0x2a9b80e3d0>}
2014-02-21 00:11:38,995 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/discussion'">
2014-02-21 00:11:38,995 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-21 00:11:38,996 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:38,996 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:38,999 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:38,999 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-21 00:11:38,999 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-21 00:11:38,999 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:39,002 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:39,002 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-21 00:11:39,002 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:39,004 Trac[util] DEBUG: prefetch: 8 rows
2014-02-21 00:11:39,005 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:39,005 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:39,007 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:39,007 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-21 00:11:39,010 Trac[util] DEBUG: prefetch: 11 rows
2014-02-21 00:11:39,011 Trac[util] DEBUG: SQL: SELECT id, name, description FROM forum_group WHERE id = %s
2014-02-21 00:11:39,011 Trac[util] DEBUG: args: (0,)
2014-02-21 00:11:39,015 Trac[util] DEBUG: prefetch: 0 rows
2014-02-21 00:11:39,016 Trac[util] DEBUG: SQL: SELECT id, generation FROM cache
2014-02-21 00:11:39,018 Trac[util] DEBUG: prefetch: 4 rows
2014-02-21 00:11:39,019 Trac[api] DEBUG: realm: discussion-core, action: post-add, format: None preview: False, submit: True
2014-02-21 00:11:39,019 Trac[api] DEBUG: actions: ['forum-post-add']
2014-02-21 00:11:39,019 Trac[api] DEBUG: req.args: {'group': u'0', 'description': u'', '__FORM_TOKEN': u'680347326cae59478a88f13b', 'submit': u'Submit', 'unregistered_subscribers': u'', 'moderators': u'vrowley', 'subscribers': u'vrowley', 'subject': u'', 'discussion_action': u'post-add', 'name': u'Test'}
2014-02-21 00:11:39,019 Trac[api] DEBUG: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (,vrowley,0,vrowley,vrowley,1392959499,,Test)
2014-02-21 00:11:39,019 Trac[util] DEBUG: SQL: INSERT INTO forum (description, author, forum_group, moderators, subscribers, time, subject, name) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
2014-02-21 00:11:39,020 Trac[util] DEBUG: args: (u'', u'vrowley', 0, u'vrowley', u'vrowley', 1392959499, u'', u'Test')
2014-02-21 00:11:39,023 Trac[util] DEBUG: prefetch: 0 rows
2014-02-21 00:11:39,034 Trac[util] DEBUG: SQL: SELECT id, forum_group, name, subject, time, author, moderators, subscribers, description FROM forum WHERE time = %s
2014-02-21 00:11:39,034 Trac[util] DEBUG: args: (1392959499,)
2014-02-21 00:11:39,051 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:39,051 Trac[api] DEBUG: forum_change_listeners: [<tracdiscussion.notification.DiscussionEmailNotification object at 0x2a9b9441d0>]
2014-02-21 00:11:39,051 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-21 00:11:39,057 Trac[util] DEBUG: prefetch: 11 rows
2014-02-21 00:11:39,058 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-21 00:11:39,062 Trac[notification] DEBUG: to_recipients: [] cc_recipients: [u'vrowley']
2014-02-21 00:11:39,072 Trac[notification] INFO: Sending notification through SMTP at imail.gennum.com:25 to [u'vrowley@semtech.com']
2014-02-21 00:11:42,219 Trac[api] DEBUG: template: forum-post-add.html data: {'moderator': True, 'group': {'description': 'No Group', 'id': 0, 'name': 'None'}, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': {'name': u'Test', 'author': u'vrowley', 'description': u'', 'tags': [], 'forum_group': 0, 'moderators': [u'vrowley'], 'link': u'http://dmsrv.gennum.com:8008/lynx/discussion/forum/1', 'subscribers': [u'vrowley'], 'time': 1392959499, 'id': 1, 'subject': u''}, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 5, 11, 42, 218691, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-post-add', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None}
2014-02-21 00:11:42,219 Trac[core] DEBUG: Redirecting to /lynx/discussion
2014-02-21 00:11:42,344 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion/redirect'">
2014-02-21 00:11:42,344 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:42,345 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:42,347 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,347 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-21 00:11:42,347 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-21 00:11:42,347 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:42,349 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,349 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-21 00:11:42,349 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:42,351 Trac[util] DEBUG: prefetch: 8 rows
2014-02-21 00:11:42,513 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/discussion'">
2014-02-21 00:11:42,513 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
2014-02-21 00:11:42,514 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:42,514 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:42,517 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,517 Trac[session] DEBUG: Retrieving session for ID u'vrowley'
2014-02-21 00:11:42,517 Trac[util] DEBUG: SQL: 
                    SELECT last_visit FROM session
                    WHERE sid=%s AND authenticated=%s
                    
2014-02-21 00:11:42,517 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:42,519 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,519 Trac[util] DEBUG: SQL: 
                    SELECT name, value FROM session_attribute
                    WHERE sid=%s and authenticated=%s
                    
2014-02-21 00:11:42,519 Trac[util] DEBUG: args: (u'vrowley', 1)
2014-02-21 00:11:42,522 Trac[util] DEBUG: prefetch: 8 rows
2014-02-21 00:11:42,522 Trac[util] DEBUG: SQL: SELECT name FROM auth_cookie WHERE cookie=%s
2014-02-21 00:11:42,522 Trac[util] DEBUG: args: ('8bff02214133da23e4aee641d78a27b6',)
2014-02-21 00:11:42,524 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,524 Trac[util] DEBUG: SQL: 
                SELECT DISTINCT s.sid, n.value, e.value
                FROM session AS s
                 LEFT JOIN session_attribute AS n ON (n.sid=s.sid
                  and n.authenticated=1 AND n.name = 'name')
                 LEFT JOIN session_attribute AS e ON (e.sid=s.sid
                  AND e.authenticated=1 AND e.name = 'email')
                WHERE s.authenticated=1 ORDER BY s.sid
                
2014-02-21 00:11:42,526 Trac[util] DEBUG: prefetch: 11 rows
2014-02-21 00:11:42,527 Trac[api] DEBUG: realm: discussion-core, action: None, format: None preview: False, submit: False
2014-02-21 00:11:42,527 Trac[api] DEBUG: actions: ['forum-list']
2014-02-21 00:11:42,527 Trac[api] DEBUG: req.args: {}
2014-02-21 00:11:42,527 Trac[util] DEBUG: SQL: SELECT COUNT(f.id) FROM forum f WHERE f.forum_group = 0
2014-02-21 00:11:42,529 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,529 Trac[util] DEBUG: SQL: SELECT g.id, g.name, g.description, f.forums FROM forum_group g LEFT JOIN (SELECT COUNT(id) AS forums, forum_group FROM forum GROUP BY forum_group) f ON g.id = f.forum_group ORDER BY g.id ASC
2014-02-21 00:11:42,532 Trac[util] DEBUG: prefetch: 0 rows
2014-02-21 00:11:42,532 Trac[util] DEBUG: SQL: SELECT f.id, f.name, f.author, f.time, f.moderators, f.subscribers, f.forum_group, f.subject, f.description, ta.topics, ta.replies, ta.lasttopic, ta.lastreply FROM forum f LEFT JOIN (SELECT COUNT(t.id) AS topics, MAX(t.time) AS lasttopic, SUM(ma.replies) AS replies, MAX(ma.lastreply) AS lastreply, t.forum AS forum FROM topic t LEFT JOIN (SELECT COUNT(m.id) AS replies, MAX(m.time) AS lastreply, m.topic AS topic FROM message m GROUP BY m.topic) ma ON t.id = ma.topic GROUP BY forum) ta ON f.id = ta.forum ORDER BY lasttopic ASC
2014-02-21 00:11:42,534 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,534 Trac[util] DEBUG: SQL: SELECT COUNT(id) FROM topic t WHERE t.forum = 1 AND t.time > 0
2014-02-21 00:11:42,536 Trac[util] DEBUG: prefetch: 1 rows
2014-02-21 00:11:42,536 Trac[util] DEBUG: SQL: SELECT id FROM topic t WHERE t.forum = 1
2014-02-21 00:11:42,539 Trac[util] DEBUG: prefetch: 0 rows
2014-02-21 00:11:42,539 Trac[api] DEBUG: <Resource ''>
2014-02-21 00:11:42,539 Trac[chrome] DEBUG: Prepare chrome data for request
2014-02-21 00:11:42,542 Trac[api] DEBUG: template: forum-list.html data: {'moderator': True, 'group': None, 'users': [u'csamoila', u'dlewis', u'jhowey', u'jodea', u'mkomorow', u'oporat', u'pbeard', u'sgershte', u'skopec', u'smunoz', u'vrowley'], 'forum': None, 'authemail': u'vrowley@semtech.com', 'has_tags': None, 'time': datetime.datetime(2014, 2, 21, 5, 11, 42, 539325, tzinfo=<FixedOffset "UTC" 0:00:00>), 'topic': None, 'mode': 'forum-list', 'groups': [{'description': 'No Group', 'forums': 1, 'id': 0, 'name': 'None'}], 'authname': u'vrowley', 'realm': 'discussion-core', 'message': None, 'forums': [{'new_topics': 0, 'name': u'Test', 'author': u'vrowley', 'description': u'', 'replies': 0, 'forum_group': 0, 'unregistered_subscribers': [], 'topics': None, 'moderators': [u'vrowley'], 'lastreply': None, 'subscribers': [u'vrowley'], 'time': 1392959499, 'new_replies': 0, 'lasttopic': None, 'id': 1, 'subject': u''}], 'order': u'lasttopic', 'env': <trac.env.Environment object at 0x2a9b80e3d0>, 'desc': False}

comment:25 Changed 10 months ago by rjollos

Excellent! It looks like there are several places that we might see a similar problem. I'll have a more thorough change committed within the hour.

comment:26 Changed 10 months ago by anonymous

I do not know if that is related but editing the subject or the description of a forum after having created it does not work...

comment:27 Changed 10 months ago by rjollos

In 13709:

0.9dev: Do a db.commit after each transaction, because having a single db.commit doesn't seem to be effective either due to scoping issues, or because the statement isn't encountered in certain scenarios. Refs #11592.

comment:28 Changed 10 months ago by rjollos

Hopefully will be fixed after [13709], but please let me know if you spot anything.

comment:29 Changed 10 months ago by rjollos

Also, please go ahead and close the ticket whenever you are satisfied that the issues have been resolved. Thanks!

comment:30 Changed 10 months ago by anonymous

  • Resolution set to fixed
  • Status changed from accepted to closed

Hi,

I have tried changeset:13709 and I can now create forums as well as edit their subjects or descriptions after the fact.

Closing the case.

Thank you for the outstanding support.

Regards,

Vincent

comment:31 Changed 10 months ago by rjollos

  • Keywords ProgrammingError closed cursor added

comment:32 follow-ups: Changed 10 months ago by rjollos

Thank you for all the testing and following through on the issue. It's particularly hard to fix a defect that I can't reproduce, so this wouldn't have been fixed without your help. The cannot operate on closed cursor errors are mysterious in that they are often not seen by all users. I have no idea what factors determine whether or not they will be seen. The issue has come up rather frequently in various contexts.

comment:33 in reply to: ↑ 32 Changed 10 months ago by anonymous

Replying to rjollos:

The cannot operate on closed cursor errors are mysterious in that they are often not seen by all users. I have no idea what factors determine whether or not they will be seen. The issue has come up rather frequently in various contexts.

Does this help? https://groups.google.com/forum/#!msg/trac-dev/trRtzv5waoQ/Uz1T1sBhTR8J

  • when a connection is put back in the cache, or rather, as soon as the connection wrapper you got from get_db_cnx() gets garbage collected, the connection is rolled back
  • rollback used to fail when there with active cursors, for old pysqlite version (<= 2.3.3), so for each connection we maintain a list of active cursors, and before the actual rollback we explicitly close the cursors
  • anyway, newer pysqlite versions would do that by themselves (pysqlite:#197)

works [only when] there are other references kept on that "db" higher in the stack (if a db is active, get_db_cnx() from within the same thread is guaranteed to return it

comment:34 Changed 10 months ago by rjollos

The changes made so far were based on the principle of keeping the db object active and in scope.

We are both running a 1.0.x version of Trac though; I'm using Python 2.7. There must be some difference in our environments that is leading to the issue appearing in yours, but not mine.

comment:35 in reply to: ↑ 32 Changed 8 months ago by hasienda

Replying to rjollos:

The issue has come up rather frequently in various contexts.

Indeed. I've been adding another preventive measure in [13887].

comment:36 in reply to: ↑ 17 Changed 8 months ago by hasienda

Replying to rjollos:

Also fixed an unresolved import and removed logging of SQL because it is implicitly logged (see the [trac] debug_sql configuration item). }}}

Almost. Keep in mind, that this option was added after Trac 0.11, but in general I still agree to the notion of reducing debug logging for clarity.

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.