Mailing List Archive

How to solve "unable to open a temporary database file forstoring temporary tables"
Still can't solve the problem... however, now I can confirm this is not
sqlite problem. I just login in as "apache" (the user that run httpd" to
run some python script to connect to "/var/www/trac/db/trac.db" (The db
file):

>>> import sqlite
>>> cx = sqlite.connect("/var/www/trac/db/trac.db")
>>> cu = cx.cursor()
>>> cu.execute("select * from SQLITE_MASTER")
>>> print cu.fetchall()


All work fine! However, the CGI still give me the following error:

malformed database schema - unable to open a temporary database file for
storing temporary tables
Traceback (most recent call last):
File
"/home/misc/rpm/tmp/trac-0.7.1-1mdk-buildroot//usr/lib/python2.3/site-packages/trac/core.py",
line 475, in cgi_start
File
"/home/misc/rpm/tmp/trac-0.7.1-1mdk-buildroot//usr/lib/python2.3/site-packages/trac/core.py",
line 453, in real_cgi_start
File
"/home/misc/rpm/tmp/trac-0.7.1-1mdk-buildroot//usr/lib/python2.3/site-packages/trac/core.py",
line 169, in open_environment
File
"/home/misc/rpm/tmp/trac-0.7.1-1mdk-buildroot//usr/lib/python2.3/site-packages/trac/Environment.py",
line 160, in get_version
File
"/home/misc/rpm/tmp/trac-0.7.1-1mdk-buildroot//usr/lib/python2.3/site-packages/trac/Environment.py",
line 88, in get_db_cnx
File
"/home/misc/rpm/tmp/python-sqlite-0.5.1-1mdk-buildroot//usr/lib/python2.3/site-packages/sqlite/__init__.py",
line 61, in connect
File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 445, in
__init__
self.db = _sqlite.connect(database, mode)
DatabaseError: malformed database schema - unable to open a temporary
database file for storing temporary tables

--
''~``
( o o )
+------------------.oooO--(_)--Oooo.------------------+
We are limited, not by our abilities, but by our vision.

| |
| http://www.carfield.com.hk |
| .oooO |
| ( ) Oooo. |
+---------------------\ (----( )--------------------+
\_) ) /
(_/
How to solve "unable to open a temporary database file forstoring temporary tables" [ In reply to ]
On Thu, 30 Sep 2004, Doug Currie wrote:

>
> Thursday, September 30, 2004, 12:51:26 PM, Carfield Yim wrote:
>
> > Still can't solve the problem... however, now I can confirm this is not
> > sqlite problem. I just login in as "apache" (the user that run httpd" to
> > run some python script to connect to "/var/www/trac/db/trac.db" (The db
> > file):
>
> >>>> import sqlite
> >>>> cx = sqlite.connect("/var/www/trac/db/trac.db")
> >>>> cu = cx.cursor()
> >>>> cu.execute("select * from SQLITE_MASTER")
> >>>> print cu.fetchall()
>
> This sequence doesn't create a potential write transaction, so it
> doesn't need to create a rollback journal. Whereas this error:
>
> > unable to open a temporary database file for storing temporary
> > tables
>
> indicates that SQLite is trying to create a journal file or a file to
> hold temporary tables.
>
> Perhaps you have the database stored in a directory that is not write
> accessible, or is full.
>
> Try executing an sql UPDATE or a SELECT inside a BEGIN and COMMIT.
>
> e
>
>
Try and also don't have problem about this... However, I finally found
the cause, it is because /var/www/cgi-bin/ is own by "root", not
"apache"

This just try and error... anyone know why /var/www/cgi-bin/ need to
writable by httpd server? Is that python will treat this as temp
directory?