Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2220 closed defect (fixed)

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

Reported by: strangest@… Owned by: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

The installation worked perfectly. But clicking on the discussion link throws this error.

Below is the generated traceback on the ticket in our system.

AttributeError: 'NoneType' object has no attribute 'process_discussion'
Reported by: gloriajw Owned by: somebody
Type: defect Priority: major
Milestone: Component: component1
Version: Keywords:
Cc:
Description ¶
How to Reproduce ¶

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

(please provide additional details here)
System Information ¶

Trac 0.11dev-r6122
Python 2.5.1 (r251:54863, Nov 3 2007, 22:35:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)]
setuptools 0.6c7
SQLite 3.3.17
pysqlite 2.3.2
Genshi 0.5dev
Subversion 1.4.5 (r25188)
Python Traceback ¶

Traceback (most recent call last):

File "/usr/local/python/2.5.1/lib/python2.5/site-packages/Trac-0.11dev_r6122-py2.5.egg/trac/web/main.py", line 381, in dispatch_request

dispatcher.dispatch(req)

File "/usr/local/python/2.5.1/lib/python2.5/site-packages/Trac-0.11dev_r6122-py2.5.egg/trac/web/main.py", line 191, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-i686/egg/tracdiscussion/core.py", line 78, in process_request

return api.process_discussion(context) + (None,)

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

Attachments (0)

Change History (8)

comment:1 Changed 7 years ago by Blackhex

  • Resolution set to invalid
  • Status changed from new to closed
  • Trac Release changed from 0.10 to 0.11

Seems like you forgot/didn't know to enable API component in trac.ini when upgrading from 0.10 branch. See
http://trac-hacks.org/wiki/DiscussionPlugin#Installation especially comment in trac.ini snipplet.

comment:2 Changed 7 years ago by strangest@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

I wish it were that easy. I installed directly from the 0.11 release.
I installed the trac.ini settings directly from the DiscussionPlugin page you reference above.
I gave myself discussion privileges, as stated, and I even see the discussion button.

comment:3 Changed 7 years ago by Blackhex

So If you are possitive that this line is in your trac.ini:

[components]
tracdiscussion.api.DiscussionApi = enabled

I would like to see cut from your debug log, especially part when plugin's components are loaded and part generated by /discussion request since I'm not able to reproduce this error when this component is enabled. For information how to enable debug logging see BugReporting.

comment:4 Changed 7 years ago by strangest@…

Here's the log entry after clicking on the discussion button:

Nov 26 16:52:05 localhost Trac[loader] WARNING: Skipping "trac.mimeview.txtl = trac.mimeview.txtl [textile]": ("textile>=2.0" not found)
Nov 26 16:52:05 localhost Trac[loader] WARNING: Skipping "trac.mimeview.rst = trac.mimeview.rst [rest]": ("docutils>=0.3" not found)
Nov 26 16:52:05 localhost Trac[loader] WARNING: Skipping "trac.mimeview.pygments = trac.mimeview.pygments [pygments]": ("Pygments>=0.6" not found)
Nov 26 16:52:05 localhost Trac[loader] WARNING: Skipping "trac.mimeview.silvercity = trac.mimeview.silvercity [silvercity]": ("SilverCity>=0.9.4" not found)
Nov 26 16:52:05 localhost Trac[main] ERROR: 'NoneType' object has no attribute 'process_discussion'#012Traceback (most recent call last):#012 File "/usr/local/python/2.5.1/lib/python2.5/site-packages/Trac-0.11dev_r6122-py2.5.egg/trac/web/main.py", line 381, in dispatch_request#012 dispatcher.dispatch(req)#012 File "/usr/local/python/2.5.1/lib/python2.5/site-packages/Trac-0.11dev_r6122-py2.5.egg/trac/web/main.py", line 191, in dispatch#012 resp = chosen_handler.process_request(req)#012 File "build/bdist.linux-i686/egg/tracdiscussion/core.py", line 78, in process_request#012 return api.process_discussion(context) + (None,)#012AttributeError: 'NoneType' object has no attribute 'process_discussion'

Here's the log entry after clicking on anything else functional:

Nov 26 16:54:43 localhost Trac[loader] WARNING: Skipping "trac.mimeview.txtl = trac.mimeview.txtl [textile]": ("textile>=2.0" not found)
Nov 26 16:54:43 localhost Trac[loader] WARNING: Skipping "trac.mimeview.rst = trac.mimeview.rst [rest]": ("docutils>=0.3" not found)
Nov 26 16:54:43 localhost Trac[loader] WARNING: Skipping "trac.mimeview.pygments = trac.mimeview.pygments [pygments]": ("Pygments>=0.6" not found)
Nov 26 16:54:43 localhost Trac[loader] WARNING: Skipping "trac.mimeview.silvercity = trac.mimeview.silvercity [silvercity]": ("SilverCity>=0.9.4" not found)
Nov 26 16:54:47 localhost Trac[loader] WARNING: Skipping "trac.mimeview.txtl = trac.mimeview.txtl [textile]": ("textile>=2.0" not found)
Nov 26 16:54:47 localhost Trac[loader] WARNING: Skipping "trac.mimeview.rst = trac.mimeview.rst [rest]": ("docutils>=0.3" not found)
Nov 26 16:54:47 localhost Trac[loader] WARNING: Skipping "trac.mimeview.pygments = trac.mimeview.pygments [pygments]": ("Pygments>=0.6" not found)
Nov 26 16:54:47 localhost Trac[loader] WARNING: Skipping "trac.mimeview.silvercity = trac.mimeview.silvercity [silvercity]": ("SilverCity>=0.9.4" not found)

Looks like we have some unrelated template problem. Hopefully it's unrelated.

comment:5 Changed 7 years ago by Blackhex

Thanks, but this don't tell nothing more than Python traceback. I need log with DEBUG level enabled. Read BugReporting to know how to enable it. And please put it inside {{{ }}} to preserve indentation or attach it as a file.

comment:6 Changed 7 years ago by anonymous

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

FOUND IT!

I pasted the comment in my trac.ini along with the line, as documented:

tracdiscussion.api.DiscussionApi = enabled # For 0.11 branch. API object is component since then.

since it looked harmless. But it broke the installation. Removing the comment caused it to work.

comment:7 Changed 7 years ago by Blackhex

Great. It's weird that Trac skips entire line if there is # comment. I'll update DiscussionPlugin page to prevent this kind of misconfiguration in future.

comment:8 Changed 7 years ago by strangest@…

Thanks for your quick help.

Add Comment

Modify Ticket

Action
as closed .
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.