SQLite3 Exception

I have a simple IRC Bot that’s running with ActiveRecord and a small
SQLite3 DB.

When I run as root, the db can be accessed fine, however, when I run it
as a normal user, I get a SQLite3::SQLException: unable to open database
file: error.

Now I’ve already chmoded the DB to 0777 and set the owner to the user in
question, however the issue still remains.

Any ideas?

On Mar 23, 8:16 pm, Miles S. [email protected] wrote:

I have a simple IRC Bot that’s running with ActiveRecord and a small SQLite3 DB.

When I run as root, the db can be accessed fine, however, when I run it as a normal user, I get a SQLite3::SQLException: unable to open database file: error.

Now I’ve already chmoded the DB to 0777 and set the owner to the user in question, however the issue still remains.

Any ideas?

Permissions on the directory owning the DB?

On Tuesday 23 March 2010 09:16:44 pm Miles S. wrote:

When I run as root, the db can be accessed fine, however, when I run it as
a normal user, I get a SQLite3::SQLException: unable to open database
file: error.

What happens when you try to access the file with the sqlite3 binary? Or
with,
say, the ‘file’ command? Are you sure it’s a Unix permission issue?

Now I’ve already chmoded the DB to 0777

Don’t do that. Ever.

EVER.

and set the owner to the user in
question,

Do that and set the DB to, say, mode 0600. That should be plenty.

however the issue still remains.

Any ideas?

Phrogz had a good idea with checking the directory, or parent
directories.

On Thu, Mar 25, 2010 at 12:50:07PM +0900, David M. wrote:

Don’t do that. Ever.

Any ideas?

Phrogz had a good idea with checking the directory, or parent directories.

It will be the permissions on the directory. SQLite needs to write its
.journal
to the same directory in which the db file is located.

enjoy,

-jeremy

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs