Hello again,

I guess I am now changing topic to something unrelated to the subject line, but 
I ran
into trouble when trying to implement the suggestions offered by Alaa, and I am 
stuck.
Any advice would be much appreciated.

I've been trying to switch from mod_python to mod_wsgi (embedded mode), but the 
web page
displayed when trying to access the Pootle welcome page reads:

Pootle: Install
Error: "unable to open database file" while attempting to access the Pootle 
database,
will try to initialize database.

And I get the following error in the error log:

mod_wsgi (pid=26593): Exception occurred processing WSGI script 
'/home/www/pootle/wsgi.py'

and then a traceback:

[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230] Traceback (most 
recent call last):
[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230]   File 
"/usr/lib/python2.4/site-packages/django/http/__init__.py", line 378, in next
[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230]     chunk = 
self._iterator.next()
[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230]   File 
"/usr/lib/python2.4/site-packages/pootle_misc/dbinit.py", line 134, in 
staggered_install

<snip>

[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230]   File 
"/usr/lib/python2.4/site-packages/django/db/backends/sqlite3/base.py", line 
170, in _cursor
[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230]     self.connection 
= Database.connect(**kwargs)
[Thu Jun 03 08:14:43 2010] [error] [client 202.75.235.230] OperationalError: 
unable to open database file


I have ensured that the directory dbs as well as the database file 
dbs/pootle.db are
readable and writable by the user ("pootle") running the server.

I have moved python.conf, where the mod_python module was loaded, to an 
anonymous
file and there is no mention of mod_python in the error log (LogLevel is set to 
debug),
so there should be no conflicts with mod_python (I have understood that this 
might
happen in some cases).

I have of course stopped and started the server again (many times by now, with 
different
settings).

I have tried both with and without memcached. (Installation of memcached as 
well as running
with mod_python went seamlessly.)

According to the instructions in wsgi.py, I have commented out the part in 
wsgi.py
related to running from checkout.

According to my google search results the most common cause of the 
OperationalError message
above, apart from insufficient file permissions, is a non-absolute path in 
DATABASE_NAME, but
I can't figure out if, and if so where, an incorrect path is set. I tried 
setting DATABASE_NAME
to my absolute path to the database file pootle.db, in localsettings.py, to no 
avail.
(Besides, the default setting worked fine with mod_python, though maybe it's 
unrelated.)

Some questions:

- Do I need to reinstall Pootle in order to accommodate mod_wsgi?

- When installing mod_wsgi, should I have given it some specific options?
  (I have only one version of Python installed, v 2.4, and have not yet
   switched to worker MPM, and I did ./configure without any options.)

- Could it be as simple as an incorrect configuration of directives in 
httpd.conf?
  (Though I have tried several combinations with no improvement.)

- Why does a "Pootle: Install" page appear? I don't want Pootle to reinstall 
and/or
  reinitialize my pootle.db, since I guess all the vital information is stored
  in that single file, with no chance of recovery if lost. (I have made a 
backup.)

Here is my wsgi configuration in httpd.conf:

# mod_wsgi settings

# point at the wsgi loader script
WSGIScriptAlias / /home/www/pootle/wsgi.py

# directly serve static files like css and images, no need to go through 
mod_wsgi and django
Alias /pootle/html /home/www/pootle/html
<Directory /home/www/pootle/html>
Order deny,allow
Allow from all
</Directory>

# Allow downloading translation files directly
Alias /pootle/export /home/www/pootle/po
<Directory /home/www/pootle/po>
Order deny,allow
Allow from all
</Directory>


To be compared with the previous mod_python configuration which worked fine:

# mod_python settings

<Location "/">
   SetHandler python-program
   PythonHandler django.core.handlers.modpython
   SetEnv DJANGO_SETTINGS_MODULE pootle.settings
   PythonOption django.root /pootle
   PythonPath "['/home/www/pootle', '/home/www/pootle/local_apps', 
'/home/www/pootle/external_apps'] + sys.path"
   PythonInterpreter pootle
   PythonDebug On
</Location>

<Location "/pootle/html">
    SetHandler None
</Location>

<Directory /home/www/pootle/html>
Order deny,allow
Allow from all
</Directory>


Btw, I'm using CentOS 5.3, and the version of mod_wsgi is 3.2.

Even if nobody recognizes this exact problem, perhaps somebody can tell me
if it is more likely to be a problem with mod_wsgi, with Pootle, or with Apache?


Best regards,
Cecilia Albertsson


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Translate-pootle mailing list
Translate-pootle@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Reply via email to