SQLite3 Exception

M

Miles Smith

SSBoYXZlIGEgc2ltcGxlIElSQyBCb3QgdGhhdCdzIHJ1bm5pbmcgd2l0aCBBY3RpdmVSZWNvcmQg
YW5kIGEgc21hbGwgU1FMaXRlMyBEQi4NCg0KV2hlbiBJIHJ1biBhcyByb290LCB0aGUgZGIgY2Fu
IGJlIGFjY2Vzc2VkIGZpbmUsIGhvd2V2ZXIsIHdoZW4gSSBydW4gaXQgYXMgYSBub3JtYWwgdXNl
ciwgSSBnZXQgYSBTUUxpdGUzOjpTUUxFeGNlcHRpb246IHVuYWJsZSB0byBvcGVuIGRhdGFiYXNl
IGZpbGU6IGVycm9yLg0KDQpOb3cgSSd2ZSBhbHJlYWR5IGNobW9kZWQgdGhlIERCIHRvIDA3Nzcg
YW5kIHNldCB0aGUgb3duZXIgdG8gdGhlIHVzZXIgaW4gcXVlc3Rpb24sIGhvd2V2ZXIgdGhlIGlz
c3VlIHN0aWxsIHJlbWFpbnMuDQoNCkFueSBpZGVhcz8NCg==
 
P

Phrogz

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?
 
D

David Masover

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.
 
J

Jeremy Hinegardner

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?


Don't do that. Ever.

EVER.


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


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,158
Messages
2,570,882
Members
47,414
Latest member
djangoframe

Latest Threads

Top