[GRASS-user] sqlite-db broken?

Johannes Radinger JRadinger at gmx.at
Tue Jul 17 04:27:40 PDT 2012


Hi,

> Hi,
> 
> On Mon, Jul 16, 2012 at 4:02 PM, Johannes Radinger <JRadinger at gmx.at>
> wrote:
> > Hi,
> >
> > after some search in the internet, it seems
> > the sqlite doesn't work very well with samba-network
> > drives (mounted via cifs). There is somehow
> > an issue with the locking of the db.
> 
> I think I found the reason [0]:
> 
> "When SQLite creates a journal file on Unix, it opens the directory
> that contains that file and calls fsync() on the directory, in an
> effort to push the directory information to disk."
> 
> If another process is modifying files or just keeping files open in
> this directory while sqlite calls fsync(), opening the sqlite database
> will fail.
> 
> Markus M
> 
> [0] http://www.sqlite.org/lockingv3.html

sounds like the reason for that problem. Unfortunately I have to mount my windows-samba network drive with cifs... Anyway I just made a workaround now using a working copy of my GRASS locations on my local drive and backing that up onto my cifs-mounted network drive.

I'll try it also with GRASS 7 and see what I get as output...


Anyway thank you for your help!

/johannes


> 
> >
> > Does anyone have experience with using GRASS/SQLITE
> > on a cifs-mounted GRASS location?
> >
> > What I found is following mount-option:
> >
> > nobrl
> > Do not send byte range lock requests to the server. This is necessary
> for certain applications that break with cifs style mandatory byte range
> locks (and most cifs servers do not yet support requesting advisory byte range
> locks).
> >
> > But I am not really sure if this will work or even destroy something.
> > So I'll let that judge some expert of you!
> >
> > cheers,
> >
> > Johannes
> >
> > -------- Original-Nachricht --------
> >> Datum: Mon, 16 Jul 2012 14:14:48 +0200
> >> Von: "Johannes Radinger" <JRadinger at gmx.at>
> >> An: "Johannes Radinger" <JRadinger at gmx.at>, grass-user at lists.osgeo.org
> >> Betreff: Re: [GRASS-user] sqlite-db broken?
> >
> >> Hi again,
> >>
> >> I did another test now and found out following:
> >>
> >> It seems that the problem with the sqlite database
> >> might be related to the directory of my grass location.
> >> When I try my to save the location on my local drive
> >> everything works, there is just a problem when
> >> my location points to a directory which is actually a mounted
> >> samba network drive (mount cifs).
> >>
> >> Here an output of the directory which is actually a network drive:
> >> radinger at grassgis:~$ ls -la
> >> /home/radinger/U_Radinger/05_GRASS/GRASS_locations/
> >> total 0
> >> drwxrwxrwx 5 radinger radinger 0 Jul 16 12:01 .
> >> drwxrwxrwx 6 radinger radinger 0 Jul 13 14:09 ..
> >> drwxrwxrwx 4 radinger radinger 0 Jul 16 11:43 xxx
> >> drwxrwxrwx 4 radinger radinger 0 Jan 26  2009 gisdemo_ncspm
> >> drwxrwxrwx 4 radinger radinger 0 Jul 12 14:16 spearfish60
> >> drwxrwxrwx 3 radinger radinger 0 Jul 16 10:44 xxx
> >>
> >> and:
> >> radinger at grassgis:~$ ls -la
> >>
> /home/radinger/U_Radinger/05_GRASS/GRASS_locations/gisdemo_ncspm/sqlite/
> >> total 6
> >> drwxrwxrwx 3 radinger radinger   0 Jul 16 13:15 .
> >> drwxrwxrwx 4 radinger radinger   0 Jan 26  2009 ..
> >> -rwxrwxrwx 1 radinger radinger  24 Jul 16 12:08 .bash_history
> >> -rwxrwxrwx 1 radinger radinger 556 Jul 16 12:03 .bashrc
> >> -rwxrwxrwx 0 radinger radinger 512 Jul 16 12:04 cifs2e55
> >> -rwxrwxrwx 1 radinger radinger   0 Jul 16 12:03 sqlite.db
> >> drwxrwxrwx 2 radinger radinger   0 Jul 16 12:02 .tmp
> >> -rwxrwxrwx 1 radinger radinger  74 Nov  3  2008 VAR
> >> drwxrwxrwx 1 radinger radinger   0 Nov  3  2008 vector
> >> -rwxrwxrwx 1 radinger radinger 361 Nov  3  2008 WIND
> >>
> >>
> >> Does anyone know hat causes the problem exactly and what should I
> change?
> >>
> >> The db-connection is set to $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db
> >> (checked in the VAR file as well)
> >> Maybe the GRASS can't tranlate from the relative path to a hardcoded
> one
> >> when the $GISDBASE is already located on a mounted network drive?
> >>
> >> /Johannes
> >>
> >> -------- Original-Nachricht --------
> >> > Datum: Mon, 16 Jul 2012 12:04:40 +0200
> >> > Von: "Johannes Radinger" <JRadinger at gmx.at>
> >> > An: grass-user at lists.osgeo.org
> >> > Betreff: [GRASS-user] sqlite-db broken?
> >>
> >> > Hi,
> >> >
> >> > I used to use db.test (with test=test1) to test my sqlite database
> >> > connection. In the most recent verson of GRASS 6.4.3 (rev 52380) it
> >> seems to be
> >> > broken. I tried it on some of my own databases and a freshly
> downloaded
> >> > sample dataset (small NC dataset, mapset=sqlite). I started it from
> the
> >> gui but
> >> > it just get stucked in the process (no output after several
> >> > minutes)...stopping it leaves the database in an incosistent state.
> >> >
> >> > Thats why I tried just to simply copy a vector file (e.g streams)
> from
> >> > PERMANENT to sqlite. Then I get the error message: Unable to open
> header
> >> file
> >> > of vector <streams at sqlite> Unable to read head file....
> >> >
> >> > Somehow working with sqlite doesn't work properly on my machine
> (Ubuntu
> >> > 12.04) although I the command sqlite3 in the terminal works....
> >> >
> >> > I also tried it with 6.5 SVN (rev. 52380) and a fresh NC dataset
> again:
> >> > db.test just gives: Busy SQLITE db, already waiting for 10 seconds...
> >> >
> >> > What else do I need to test so that someone of you might know the
> >> problem
> >> > of my basic database functions (creating tables eg. when tranforming
> >> from
> >> > raster to vector etc.)? Can anyone reproduce this or is it just a
> >> behavior
> >> > due to my own compilation (configured with sqlite3 support)?
> >> >
> >> > /Johannes
> >> > _______________________________________________
> >> > grass-user mailing list
> >> > grass-user at lists.osgeo.org
> >> > http://lists.osgeo.org/mailman/listinfo/grass-user
> >>
> > _______________________________________________
> > grass-user mailing list
> > grass-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list