Home > BSD, NetBSD > Trac, mod_python and sqlite annoying problems…

Trac, mod_python and sqlite annoying problems…

I have been stuck for days, when trying to update my Trac from 0.11.5 to 0.11.6 because of strange errors…

I love Trac as a free collaborative development platform, and I would definitely advise it to others, but I must admit the update has been already painful a number of times. Maybe my setup is not the simplest I could do, but anyway…

My previous Trac installation was working fine on mod_python after following the documentation, and when I did the update, maybe because of a new version of sqlite3, maybe because of a new version of apache, or maybe because of a new version of mod_python ( more likely ) things started to go wrong…

Symptoms : blank page when trying to look at the list of the projects in my Trac environment, or when trying to view a page of any project. Seems to be that the children of my apache 2.2 webserver were dying every single time. In my /var/log/messages :

[notice] child pid 6986 exit signal Segmentation fault (11)

After a lot of rebuilding and reinstalling I managed finally to get a proper mpinfo instead of a blank page every time I was trying to call mod_python. That was better, but still wasnt enough for trac which failed then on every page with an odd error from sqlite_backend.py :

File "usr/pkg/lib/python2.5/site-packages/trac/db/sqlite_backend.py", line 189, in get_connection
return SQLiteConnection(path, log, params)
File "usr/pkg/lib/python2.5/site-packages/trac/db/sqlite_backend.py", line 255, in __init__
SystemError: NULL result without error in PyObject_Call

After trying for hours ( days ? ) to fix that error by trying different version of everything, trying to get some error logged here and there, I finally gave up and decided, as others I believe did before me, to switch to CGI. From what I heard it seems to be a more stable way to run Trac and we do not need to bother about mod_python problems, even if it is a tiny bit slower. I just changed my apache configuration, and now everything run smoothly 🙂

My apache configuration file httpd.conf now looks like :

#For Trac CGI
ScriptAlias /trac /home/www/main/ssl/trac/trac.cgi
<Location /trac>
#to run with CGI
SetEnv TRAC_ENV_PARENT_DIR "/home/www/main/ssl/trac"
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex trac.cgi

#to run with mod_python
#SetHandler mod_python
#PythonHandler trac.web.modpython_frontend
#PythonOption TracEnvParentDir /home/www/main/ssl/trac
#PythonOption TracUriRoot /trac
#SetEnv PYTHON_EGG_CACHE /home/www/main/.python-eggs

Hopefully this will avoid those with the same problem to waste too much time fighting against mod_python… These things are pretty annoying to debug.
Finally after a long struggle my development environment is up and running again 🙂

Categories: BSD, NetBSD Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: