seem to need write permission on db's parent directory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

seem to need write permission on db's parent directory

raf-6
hi,

using sqlite-3.2.7 via the perl module, DBD-SQLite-1.11,
from a cgi script via apache on linux on a local filesystem,
i received this error:

  DBD::SQLite::st execute failed: unable to open database file(1) at dbdimp.c line 398

the database, /var/db/mydb/mydb.db, had already been
successfully opened and this error happened when the
first insert into the database was attempted. i don't
know why it seems to want to open a database called "1".

the database was publically writable (for use via apache)
but its parent directory wasn't. making its parent
directory world writable as well made the insert work
and made the error message stop appearing.

i don't know whether sqlite or DBD::SQLite is the
cause here but i thought i should mention it on
this list because i started looking at this list's
archives for a solution and couldn't find one.

cheers,
raf

Reply | Threaded
Open this post in threaded view
|

Re: seem to need write permission on db's parent directory

Igor Tandetnik
raf wrote:

> using sqlite-3.2.7 via the perl module, DBD-SQLite-1.11,
> from a cgi script via apache on linux on a local filesystem,
> i received this error:
>
>  DBD::SQLite::st execute failed: unable to open database file(1) at
> dbdimp.c line 398
>
> the database was publically writable (for use via apache)
> but its parent directory wasn't. making its parent
> directory world writable as well made the insert work
> and made the error message stop appearing.

SQLite needs to be able to create a journal file in the same directory
as the DB, before any modifications can take place. The journal is used
to support transaction rollback.

Igor Tandetnik

Reply | Threaded
Open this post in threaded view
|

Re: Re: seem to need write permission on db's parent directory

raf-6
Igor Tandetnik wrote:

> raf wrote:
> >using sqlite-3.2.7 via the perl module, DBD-SQLite-1.11,
> >from a cgi script via apache on linux on a local filesystem,
> >i received this error:
> >
> > DBD::SQLite::st execute failed: unable to open database file(1) at
> >dbdimp.c line 398
> >
> >the database was publically writable (for use via apache)
> >but its parent directory wasn't. making its parent
> >directory world writable as well made the insert work
> >and made the error message stop appearing.
>
> SQLite needs to be able to create a journal file in the same directory
> as the DB, before any modifications can take place. The journal is used
> to support transaction rollback.
>
> Igor Tandetnik

thanks for the explanation.

cheers,
raf