Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
"attempt to write a readonly database"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
wealthychef  
View profile  
 More options Apr 4 2012, 6:21 pm
From: wealthychef <rc...@llnl.gov>
Date: Wed, 4 Apr 2012 15:21:25 -0700 (PDT)
Local: Wed, Apr 4 2012 6:21 pm
Subject: "attempt to write a readonly database"
Hello, I must be missing something obvious here and am hoping someone
can help me.
I have a database:  "/collab/usr/global/tools/IMG_private/img_sqltrack/
Database.sqlite"
I created it with user rcook.

Executed the following commands:
sqlite3_open(filename.c_str(), &database)
sqlite3_key(database, key.c_str(), 7);
"CREATE TABLE a (a INTEGER, b INTEGER);"
"INSERT INTO a VALUES(1, 2);"
"INSERT INTO a VALUES(5, 4);"

I then set permissions to be 766, and confirmed that user "bashtest"
can read and write to this file:

hera553@bashtest:ls -l /collab/usr/global/tools/IMG_private/
img_sqltrack/Database.sqlite
-rwxrw-rw- 1 rcook tools 2048 Apr  4 15:07 /collab/usr/global/tools/
IMG_private/img_sqltrack/Database.sqlite

As rcook I can write to the database using the key "key" with the
following command:

rcook@rzthriller1 (img_sqltrack): /collab/usr/global/tools/IMG_private/
chaos_4_x86_64/bin/sqlite3 /collab/usr/global/tools/IMG_private/
img_sqltrack/Database.sqlite 'pragma key="key"; INSERT INTO a
VALUES(1, 2);'

But when user bashtest tries to write to the database I get a
"readonly" error:

hera553@bashtest:/collab/usr/global/tools/IMG_private/chaos_4_x86_64/
bin/sqlite3 /collab/usr/global/tools/IMG_private/img_sqltrack/
Database.sqlite 'pragma key="key"; INSERT INTO a VALUES(1, 2);'
Error: attempt to write a readonly database

What is going on here?   Very mysterious.  What barrier is bashtest
running into?  Help!  :-)
Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wealthychef  
View profile  
 More options Apr 4 2012, 6:41 pm
From: wealthychef <rc...@llnl.gov>
Date: Wed, 4 Apr 2012 15:41:55 -0700 (PDT)
Local: Wed, Apr 4 2012 6:41 pm
Subject: Re: "attempt to write a readonly database"
Aha, never mind, I figured it out.  It's a quirk of our Unix
filesystems.  It looks like there's write access but the file system
is mounted read-only from the machine I'm looking at it with
bashtest.
Solved!
Sheesh.
-- R

On Apr 4, 3:21 pm, wealthychef <rc...@llnl.gov> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Lombardo  
View profile  
 More options Apr 4 2012, 6:42 pm
From: Stephen Lombardo <sjlomba...@zetetic.net>
Date: Wed, 4 Apr 2012 18:42:12 -0400
Local: Wed, Apr 4 2012 6:42 pm
Subject: Re: "attempt to write a readonly database"

Hello,

Does bashtest have write access to the enclosing directory holding the
database file? If not, that is most likely the problem. Write access is
required to create the transaction journal file (or WAL file).

Cheers,
Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wealthychef  
View profile  
 More options Apr 4 2012, 6:51 pm
From: wealthychef <rc...@llnl.gov>
Date: Wed, 4 Apr 2012 15:51:21 -0700 (PDT)
Local: Wed, Apr 4 2012 6:51 pm
Subject: Re: "attempt to write a readonly database"
Actually, not to quibble, but you are incorrect, at least for all the
Linux filesystems I use.  What is usually needed is execute
permissions on the directory, and write on the file.
Proof:
rcook@rzthriller1 (img_sqltrack): mkdir test
rcook@rzthriller1 (img_sqltrack): touch test/file
rcook@rzthriller1 (img_sqltrack): chmod 200 test/file
rcook@rzthriller1 (img_sqltrack): ls -l test/file
--w------- 1 rcook tools 0 Apr  4 15:47 test/file
rcook@rzthriller1 (img_sqltrack): chmod 100 test
rcook@rzthriller1 (img_sqltrack): ls -ld test
d--x------ 2 rcook tools 4096 Apr  4 15:47 test
rcook@rzthriller1 (img_sqltrack): echo hello > test/file
generates no errors.  File contains "hello"

On Apr 4, 3:42 pm, Stephen Lombardo <sjlomba...@zetetic.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wealthychef  
View profile  
 More options Apr 4 2012, 7:03 pm
From: wealthychef <rc...@llnl.gov>
Date: Wed, 4 Apr 2012 16:03:37 -0700 (PDT)
Local: Wed, Apr 4 2012 7:03 pm
Subject: Re: "attempt to write a readonly database"
Oh.  You're right!  :-)  I did not understand you, but SQLite
apparently needs to write to the directory containing the database.  I
think this is an unwanted feature in my case but I can probably deal
with it.
Thanks for the tip, that would have been hard to find too.

On Apr 4, 3:51 pm, wealthychef <rc...@llnl.gov> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »