Modify

Opened 17 years ago

Closed 17 years ago

#2976 closed defect (fixed)

AttributeError: 'NoneType' object has no attribute 'process_discussion'

Reported by: Jason Winnebeck Owned by: Radek Bartoň
Priority: normal Component: DiscussionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

This error occurs when trying to use the DiscussionPlugin on a new environment with Trac 0.11rc1 and the 0.11 branch of DiscussionPlugin. The same error also occurs when trying to use the "trunk" branch.

exception and version details for me:

File "/home/jpwasp/trac/0.11/trac-0.11/trac/web/main.py", line 417, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/jpwasp/trac/0.11/trac-0.11/trac/web/main.py", line 197, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-i686/egg/tracdiscussion/core.py", line 77, in process_request

System Information:

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Trac: 	0.11dev-r6941
Python: 	2.4.3 (#2, Oct 6 2006, 07:52:30) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)]
setuptools: 	0.6c7
SQLite: 	3.2.8
pysqlite: 	2.0.5
Genshi: 	0.4.4
Pygments: 	0.9
Subversion: 	1.3.1 (r19032)
jQuery:	1.2.3

Attachments (0)

Change History (4)

comment:1 Changed 17 years ago by Radek Bartoň

Status: newassigned

Do you have DiscussionApi component enabled?

Show me trac.ini and trac.log with debug level DEBUG if you do, please.

comment:2 Changed 17 years ago by Jason Winnebeck

I didn't enable or disable any components. Right now in my trac.ini the components section is blank. Also, at first the discussion section was not present but after it failed I tried copying the default. I installed the plugin by copying the egg into the plugins directory of a 0.11 test environment.

What I noticed is in WebAdmin console all components show as checked except for the DiscussionApi. Output from tracd:

09:15:54 AM Trac[loader] DEBUG: Adding plugin TracDiscussion 0.6 from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
...
09:15:54 AM Trac[loader] DEBUG: Loading tracwysiwyg from /home/jpwasp/trac/0.11/testenv/plugins/TracWysiwyg-0.2_r3414-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.core from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.init from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.search from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.timeline from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.wiki from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.admin from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracDiscussion.notification from /home/jpwasp/trac/0.11/testenv/plugins/TracDiscussion-0.6-py2.4.egg
09:15:54 AM Trac[loader] DEBUG: Loading TracXMLRPC from /home/jpwasp/trac/0.11/testenv/plugins/TracXMLRPC-1.0.0-py2.4.egg
...

If I go into WebAdmin and check the box for the api, then the discussion plugin works with an empty forum, as it writes out explicit "enabled" statements.

What I saw that is different about that component from the others is that it is enabled differently:

tracdiscussion.admin.* = enabled
tracdiscussion.api.discussionapi = enabled
tracdiscussion.core.* = enabled
tracdiscussion.init.* = enabled
tracdiscussion.notification.* = enabled
tracdiscussion.search.* = enabled
tracdiscussion.timeline.* = enabled
tracdiscussion.wiki.* = enabled

Maybe Trac doesn't autodetect the discussionapi because the structure is different?

When I tried to add a forum, I got the following crash:

09:24:07 AM Trac[session] DEBUG: Retrieving session for ID u'jpwasp'
09:24:07 AM Trac[main] ERROR: 'DiscussionApi' object has no attribute 'get_item'
Traceback (most recent call last):
  File "/home/jpwasp/trac/0.11/trac-0.11/trac/web/main.py", line 417, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/jpwasp/trac/0.11/trac-0.11/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/tracdiscussion/core.py", line 77, in process_request
  File "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 85, in process_discussion
  File "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 174, in _get_context
  File "build/bdist.linux-i686/egg/tracdiscussion/api.py", line 889, in get_group
AttributeError: 'DiscussionApi' object has no attribute 'get_item'

I am using the trunk code; I'll try switching to the 0.11 branch and see if it makes a difference.

More environment details: I am running tracd in a python "virtualenv" so that I can run Trac 0.11 on a 0.10 system, where I easy_install'd Genshi and Pygments. TracDiscussionPlugin is not in the main site-packages.

comment:3 Changed 17 years ago by Jason Winnebeck

The 0.11 branch appears to be working fine, so I will stick with that instead of trunk. The wiki DiscussionPlugin advises this anyway.

comment:4 Changed 17 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

Right, I forgot to mention Api component in setup.py. It's now fixed. You can't use trunk branch of a plugin since it contains unfinished code.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.