I tried posting this to the bug tracker, but the spamfitler got the best of me. So here is the ticket:

----
When trying to use Trac with Cherokee and FastCGI, one must modify the Trac code and explicitly set the socket to listen on.

Modifying the trac source isn't particularly elegant.

From the lighttpd config, it appears that one sets the socket in the lighttpd config and then lighttpd spawns trac and handles the task of telling trac to listen on the socket specified.
{{{
fastcgi.server = ("/trac" =>
                   ("trac" =>
                     ("socket" => "/tmp/trac-fastcgi.sock",
                      "bin-path" => "/path/to/cgi-bin/trac.fcgi",
                      "check-local" => "disable",
                      "bin-environment" =>
                        ("TRAC_ENV" => "/path/to/projenv")
                     )
                   )
                 )
}}}

I have tried to locate where/how trac itself handles this case. As best as I can tell, it is handled in [http://projects.edgewall.com/trac/browser/trunk/trac/web/_fcgi.py#L971 trac.web._fcgi.py line 971]. The {{{_setupSocket}}} function appears to create a socket from a file. However, it creates an {{{AF_INET}}} socket. I don't understand how this works if the server is creating a UNIX socket.

The main point is to not have to hack the trac source in order to get it to run with Cherokee in fastcgi mode.
----

For the trac admins, here is the traceback.  Hope it's helpful:

Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 299, in dispatch_request
    dispatcher.dispatch(req)
File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 189, in dispatch
    resp = chosen_handler.process_request(req)
File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 104, in process_request
    self._do_create(req, db)
File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 163, in _do_create
    self._validate_ticket(req, ticket)
File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 47, in _validate_ticket
    for field, message in manipulator.validate_ticket(req, ticket):
File "build/bdist.linux-i686/egg/tracspamfilter/adapters.py", line 40, in validate_ticket
  File "build/bdist.linux-i686/egg/tracspamfilter/api.py", line 68, in test
File "/usr/lib/python2.3/site-packages/trac/core.py", line 55, in extensions
    return filter(None, [component.compmgr[cls] for cls in extensions])
File "/usr/lib/python2.3/site-packages/trac/core.py", line 186, in __getitem__
    component = cls(self)
File "/usr/lib/python2.3/site-packages/trac/core.py", line 95, in maybe_init
    init(self)
File "build/bdist.linux-i686/egg/tracspamfilter/filters/regex.py", line 33, in __init__ File "build/bdist.linux-i686/egg/tracspamfilter/filters/regex.py", line 57, in _load_patterns
IndexError: list index out of range


-John
_______________________________________________
Cherokee mailing list
[email protected]
http://www.0x50.org/cgi-bin/mailman/listinfo/cherokee

Reply via email to