Database driver problem

20 messages Options
Embed this post
Permalink
grassyjohn

Database driver problem

Reply Threaded More More options
Print post
Permalink
I've tried importing the spearfish_contours files via File-->Import Vector Map-->Multiple Formats Using OGR and get this message

Invalid argument: can't _spawnl
Unable to start driver <sqlite>

Unable open database <D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db> by driver <sqlite>

I've tried using dbf and ogr database drivers but the result is the same.

I'm using GRASS 6.4 on Windows XP.  Has anyone come across the problem?
Maris Nartiss

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
Unfortunatly GRASS has no Windows developers. Developers use Linux or
Mac and not windows and thus fixing Windows specific bugs is hard.

I have attached patch to ticket where such problem is described.
http://trac.osgeo.org/grass/ticket/629
Please, apply patch to GRASS 6.4/5, recompile and run with DEBUG=1.
Post Your results to ticket.

Thanks,
Maris.


2009/9/27, grassyjohn <[hidden email]>:

>
> I've tried importing the spearfish_contours files via File-->Import Vector
> Map-->Multiple Formats Using OGR and get this message
>
> Invalid argument: can't _spawnl
> Unable to start driver <sqlite>
>
> Unable open database
> <D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db> by driver
> <sqlite>
>
> I've tried using dbf and ogr database drivers but the result is the same.
>
> I'm using GRASS 6.4 on Windows XP.  Has anyone come across the problem?
> --
> View this message in context:
> http://n2.nabble.com/Database-driver-problem-tp3720138p3720138.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
grassyjohn

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
Thanks for the tip but I've no idea of how to "re-compile" .  Can this be done from within the software or do I need to use something like Dev C++?

I have a box running on Vector Linux so I may just install on there instead.

Maris Nartiss wrote:
Unfortunatly GRASS has no Windows developers. Developers use Linux or
Mac and not windows and thus fixing Windows specific bugs is hard.

I have attached patch to ticket where such problem is described.
http://trac.osgeo.org/grass/ticket/629
Please, apply patch to GRASS 6.4/5, recompile and run with DEBUG=1.
Post Your results to ticket.

Thanks,
Maris.


2009/9/27, grassyjohn <jf_walsh@hotmail.com>:
>
> I've tried importing the spearfish_contours files via File-->Import Vector
> Map-->Multiple Formats Using OGR and get this message
>
> Invalid argument: can't _spawnl
> Unable to start driver <sqlite>
>
> Unable open database
> <D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db> by driver
> <sqlite>
>
> I've tried using dbf and ogr database drivers but the result is the same.
>
> I'm using GRASS 6.4 on Windows XP.  Has anyone come across the problem?
> --
> View this message in context:
> http://n2.nabble.com/Database-driver-problem-tp3720138p3720138.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
hamish-2

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
grassyjohn wrote:

> Thanks for the tip but I've no idea of how to "re-compile"
> .  Can this be
> done from within the software or do I need to use something
> like Dev C++?

if you use the latest native windows installer the patch should already
be applied. (WinGRASS-6.4.0SVN-r39271-1-Setup.exe   21 Sept 2009)

if you are using that version and it still breaks, we'd like to hear
about it.

> I have a box running on Vector Linux so I may just install
> on there instead.

that'll work too.


Hamish




_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
hamish-2

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by Maris Nartiss
Maris wrote:
> I have attached patch to ticket where such problem is
> described.
> http://trac.osgeo.org/grass/ticket/629
> Please, apply patch to GRASS 6.4/5, recompile and run with
> DEBUG=1.
> Post Your results to ticket.

sorry I just noticed that was a brand new patch in the tracker today,
it won't be in last week's binary.


Hamish




_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Maris Nartiss

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
Also previous patch should not be commited to anywhere. I just want to
know (get info) what's going on when db spawn call fails. If somebody
can recompile with that tickets patch and then post results to trac,
we may get an idea what's failing. I suspect forward vs backward
slashes issue. Still without exact info it's hard to tell. Also unless
somebody is going to test various patches/ticket fixes on windows,
windows version will suck hard (die, die!).

Maris (revorking bits in ogsf).


2009/9/28, Hamish <[hidden email]>:

> Maris wrote:
>> I have attached patch to ticket where such problem is
>> described.
>> http://trac.osgeo.org/grass/ticket/629
>> Please, apply patch to GRASS 6.4/5, recompile and run with
>> DEBUG=1.
>> Post Your results to ticket.
>
> sorry I just noticed that was a brand new patch in the tracker today,
> it won't be in last week's binary.
>
>
> Hamish
>
>
>
>
>
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
grassyjohn

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by hamish-2
Hamish wrote:

if you use the latest native windows installer the patch should already
be applied. (WinGRASS-6.4.0SVN-r39271-1-Setup.exe   21 Sept 2009)

if you are using that version and it still breaks, we'd like to hear
about it.

I did use the latest installer on XP.  If I am importing ESRI files and the corresponding dbf file, does it matter where I put them as long as I select the correct paths to the files in the dialogs?



_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Markus Neteler

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by grassyjohn
On Sun, Sep 27, 2009 at 11:45 AM, grassyjohn <[hidden email]> wrote:

>
> I've tried importing the spearfish_contours files via File-->Import Vector
> Map-->Multiple Formats Using OGR and get this message
>
> Invalid argument: can't _spawnl
> Unable to start driver <sqlite>
>
> Unable open database
> <D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db> by driver
> <sqlite>
>
> I've tried using dbf and ogr database drivers but the result is the same.
>
> I'm using GRASS 6.4 on Windows XP.  Has anyone come across the problem?

I could try here on XP, same issue. with g.gisenv and DEBUG=3 I see


g.remove vect=vegetazione_Monte_madonna_UTM32@Monte_Madonna
Removing vector <vegetazione_Monte_madonna_UTM32@Monte_Madonna>
D3/3: Delete vector 'vegetazione_Monte_madonna_UTM32'
D1/3: dbln file: C:\grassdata/UTM32N/Monte_Madonna/vector/ve
getazione_Monte_madonna_UTM32/dbln
D1/3: Vect_open_old(): name =
vegetazione_Monte_madonna_UTM32 mapset= Monte_Madonna update
= 0
D1/3: Vect_set_thresh(): thresh = 0.000000
D3/3: dig_init_plus()
D1/3: dig_spidx_init()
D3/3: dig_cidx_init()
D1/3: open format file:
'Monte_Madonna/vector/vegetazione_Monte_madonna_UTM32/frmt'
D1/3: Vector format: 0 (native)
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Vect__read_head(): vector =
vegetazione_Monte_madonna_UTM32@Monte_Madonna
D1/3: Vect_set_thresh(): thresh = 0.000000
D1/3: Level request = 1
D1/3: Vect_open_old(): vector opened on level 1
D1/3: Vect_read_dblinks(): map =
vegetazione_Monte_madonna_UTM32, mapset = Monte_Madonna
D3/3: Searching for FID column in OGR DB
D1/3: dbln file: C:\grassdata/UTM32N/Monte_Madonna/vector/ve
getazione_Monte_madonna_UTM32/dbln
D1/3: dbln: 1 vegetazione_Monte_madonna_UTM32 cat
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D3/3: Field number <1>, name <(null)>
D3/3: Vect_check_dblink: field 1
D1/3: field = 1 name = (null), table =
vegetazione_Monte_madonna_UTM32, key = cat, database =
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver = dbf
D1/3: Dblinks read
D1/3: Vect_get_dblink(): link = 0
D3/3: Vect_subst_var(): in =
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, map =
vegetazione_Monte_madonna_UTM32, mapset = Monte_Madonna
D3/3:   -> C:\grassdata/UTM32N/Monte_Madonna/dbf/
D3/3: Delete drv:db:table 'dbf:C:\grassdata/UTM32N/Monte_Mad
onna/dbf/:vegetazione_Monte_madonna_UTM32'
D3/3: db_start_driver_open_database():
  drvname = dbf, dbname =
C:\grassdata/UTM32N/Monte_Madonna/dbf/
D2/3: opendir C:/GRASS-6-SVN\driver\db\
Invalid argument: can't _spawnl
Unable to start driver <dbf>
Unable open database <C:\grassdata/UTM32N/Monte_Madonna/dbf/> by driver <dbf>
Unable to find table <vegetazione_Monte_madonna_UTM32> linked to
vector map <vegetazione_Monte_madonna_UTM32>
D1/3: Vect_close(): name = vegetazione_Monte_madonna_UTM32,
mapset = Monte_Madonna, format = 0, level = 1
D1/3: close history file
couldn't be removed
<vegetazione_Monte_madonna_UTM32> nothing removed
(Thu Oct 01 11:30:53 2009) Command finished (0 sec)

Could the problem be that \ and / slashes are used?

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Glynn Clements

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink

Markus Neteler wrote:

> > I've tried importing the spearfish_contours files via File-->Import Vector
> > Map-->Multiple Formats Using OGR and get this message
> >
> > Invalid argument: can't _spawnl
> > Unable to start driver <sqlite>

> Could the problem be that \ and / slashes are used?

Quite possibly. Try this:

--- lib/db/dbmi_base/dbmscap.c (revision 39364)
+++ lib/db/dbmi_base/dbmscap.c (working copy)
@@ -175,6 +175,7 @@
  dirpath = G_malloc(strlen("\"\\driver\\db\\\"")
    + strlen(G_gisbase()) + strlen(ent->d_name) + 1);
  sprintf(dirpath, "\"%s\\driver\\db\\%s\"", G_gisbase(), ent->d_name);
+ G_convert_dirseps_to_host(dirpath);
 #else
  G_asprintf(&dirpath, "\"%s/driver/db/%s\"", G_gisbase(), ent->d_name);
 #endif

--
Glynn Clements <[hidden email]>
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
hamish-2

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
Hi all,   [lunchtime; office PC hijacked for testing]

> > > I've tried importing the spearfish_contours files via File-->Import
> > > Vector Map-->Multiple Formats Using OGR and get this message
> > >
> > > Invalid argument: can't _spawnl
> > > Unable to start driver <sqlite>
> Markus Neteler wrote:
> > Could the problem be that \ and / slashes are used?
Glynn:
> Quite possibly. Try this:
...
> +    G_convert_dirseps_to_host(dirpath);

I just tested this with the latest native installer and can reproduce
it in both the wx and tcl GUIs.  (WinGRASS-6.4.0SVN-r39271-1-Setup.exe)

but.... I first ran v.buffer on roads@PERM and made a map in the local
mapset. I could query the roads_buff@user1 map ok, just not the roads@PERM
one in the non-current mapset, there I get a similar error but for dbf not
sqlite. For the local map I see the correct data output.

$GISDBASE is in C:\Documents and Settings\me\My Documents\GIS Database\
spearfish60\  or something like that with lots of spaces.

should this be using G_spawn() not _spawnl() now that we have a few
G_spawn() options to choose from?



Hamish

ps- the tcltk gui complains that it can't find the fontcap file, and
Font Selection from the config menu ends with a non-fatal tcltk error.




_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Glynn Clements

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink

Hamish wrote:

> should this be using G_spawn() not _spawnl() now that we have a few
> G_spawn() options to choose from?

No. G_spawn() uses the _P_WAIT flag, while the DBMI requires
_P_NOWAIT.

G_spawn_ex() supports background processes, but it doesn't support
redirecting descriptors on Windows. The only way to fix that is to
re-write it to use CreateProcess() rather than spawnvpe(); Python's
subprocess module would probably be a useful source of clues.

--
Glynn Clements <[hidden email]>
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Erik lash

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
Hi,

I'm a noob learning GRASS for a class. I've encountered a similar problem on WinXP with the current install and I can't figure out what I'm doing wrong.

(Mon Oct 05 03:03:44 2009)                                                      
v.info -c streets_wake                                                          
Displaying column types/names for database connection of layer 1:
Invalid argument: can't _spawnl
ERROR: Unable to open driver <dbf>
(Mon Oct 05 03:03:44 2009) Command finished (0 sec)

What I know is that it occurs in both TCLTK and WxPython. It is specifically related to the -c flag as other flags work fine. It isn't path or space dependent - I tried with spaces and without on different drives and folder locations. The dbf is not corrupted nor is it locked for some reason - I can connect to it with ArcGIS and can open and edit it in excel. It isn't an unregistered dll - I manually re-registered all the dlls in the GRASS install folder. It isn't a user setting that I know of in the registry - I manually deleted all orphan registry references to grass I could locate after I uninstalled in an attempt to clear the problem earlier tonight.

I'm new to grass, not that familiar with the commands, and not sure where to go next with this.

Thanks for any help you can give me.
Markus Neteler

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by Glynn Clements
On Thu, Oct 1, 2009 at 7:31 PM, Glynn Clements <[hidden email]> wrote:

>
> Markus Neteler wrote:
>
>> > I've tried importing the spearfish_contours files via File-->Import Vector
>> > Map-->Multiple Formats Using OGR and get this message
>> >
>> > Invalid argument: can't _spawnl
>> > Unable to start driver <sqlite>
>
>> Could the problem be that \ and / slashes are used?
>
> Quite possibly. Try this:
>
> --- lib/db/dbmi_base/dbmscap.c  (revision 39364)
> +++ lib/db/dbmi_base/dbmscap.c  (working copy)
> @@ -175,6 +175,7 @@
>        dirpath = G_malloc(strlen("\"\\driver\\db\\\"")
>                           + strlen(G_gisbase()) + strlen(ent->d_name) + 1);
>        sprintf(dirpath, "\"%s\\driver\\db\\%s\"", G_gisbase(), ent->d_name);
> +       G_convert_dirseps_to_host(dirpath);
>  #else
>        G_asprintf(&dirpath, "\"%s/driver/db/%s\"", G_gisbase(), ent->d_name);
>  #endif

Is this a harmless change? then I would submit it... otherwise it
will take years to figure this out unless someone actually compiles
and *tests* on Windows...
Submitting it would get it at least into the next test compilation.

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Erik lash

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
I installed a previous version R38537-1 and attempted the exact same connection as before under the exact same conditions. The connection was successful and returned the correct values with the previous install where as it returns errors under the current install.

Something has changed between 38537-1 and 39271-1 in a manner that breaks the ability of the software to connect to dbfs.

-Erik
Glynn Clements

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by Markus Neteler

Markus Neteler wrote:

> >> Could the problem be that \ and / slashes are used?
> >
> > Quite possibly. Try this:
> >
> > --- lib/db/dbmi_base/dbmscap.c  (revision 39364)
> > +++ lib/db/dbmi_base/dbmscap.c  (working copy)
> > @@ -175,6 +175,7 @@
> >        dirpath = G_malloc(strlen("\"\\driver\\db\\\"")
> >                           + strlen(G_gisbase()) + strlen(ent->d_name) + 1);
> >        sprintf(dirpath, "\"%s\\driver\\db\\%s\"", G_gisbase(), ent->d_name);
> > +       G_convert_dirseps_to_host(dirpath);
> >  #else
> >        G_asprintf(&dirpath, "\"%s/driver/db/%s\"", G_gisbase(), ent->d_name);
> >  #endif
>
> Is this a harmless change? then I would submit it... otherwise it
> will take years to figure this out unless someone actually compiles
> and *tests* on Windows...
> Submitting it would get it at least into the next test compilation.

I suggest committing it. As it stands, dirpath will contain a mix of
forward slashes and backslashes, which is the worst possible case
(there are two ways that it could break).

In the longer term, we should really try to get rid of forward slashes
on Windows altogether, rather than fixing the individual cases where
they don't work.

--
Glynn Clements <[hidden email]>
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
achim

thresh in v.select?

Reply Threaded More More options
Print post
Permalink
Hi all,

I report again a rounding problem, wondering why no one else seems to
have such problems.

Maybe someone con give me an good advice?

This time problem (see picture):
I have areas and lines and I want to remove the lines inside the areas-
I did:
-boundaries to lines ("arealines")
-patch lines and arealines
-break where they cross
-v.select -r -g operator=within
that should do, but due to ?roundings?, v.select does not do it
correct...(see picture) I would need a thresh in v.select, I guess,
hoping you might have an idea how to deal with it.

v.clean with snap does not work, because how can I tell the nodes at
line ends to snap to area boundaries.

Thank a lot in advance,
Achim




_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user

select_thresh.png (31K) Download Attachment
Markus Neteler

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by Glynn Clements
On Tue, Oct 6, 2009 at 1:37 AM, Glynn Clements <[hidden email]> wrote:
> Markus Neteler wrote:
...
>> Is this a harmless change? then I would submit it... otherwise it
>> will take years to figure this out unless someone actually compiles
>> and *tests* on Windows...
>> Submitting it would get it at least into the next test compilation.
>
> I suggest committing it.

Done. So we'll just sit and wait for a volunteer to compile a new version
of winGRASS 6.4.0svn (http://trac.osgeo.org/grass/wiki/CompileOnWindows)...

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
fab4ap

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
Wondering if this is done....yet.
Markus Neteler wrote:
On Tue, Oct 6, 2009 at 1:37 AM, Glynn Clements <glynn@gclements.plus.com> wrote:
> Markus Neteler wrote:
...
>> Is this a harmless change? then I would submit it... otherwise it
>> will take years to figure this out unless someone actually compiles
>> and *tests* on Windows...
>> Submitting it would get it at least into the next test compilation.
>
> I suggest committing it.

Done. So we'll just sit and wait for a volunteer to compile a new version
of winGRASS 6.4.0svn (http://trac.osgeo.org/grass/wiki/CompileOnWindows)...

Markus
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
glassgarden

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by hamish-2
Hello,

I'm having the same problem connecting shapefiles to grass gis.  I've been trying this with stand alone grass and the plugin for qgis.  I've reinstalled, tried earlier versions, tried changing the slash directions and spacing in path names in windows explorer and in the plugin window.   I don't know if there is anything else I can do about this in my sysem, unless I wait for the next version.  Thanks if you have any advice.


jboyd wrote:
hamish-2 wrote:
grassyjohn wrote:

> Thanks for the tip but I've no idea of how to "re-compile"
> .  Can this be
> done from within the software or do I need to use something
> like Dev C++?

if you use the latest native windows installer the patch should already
be applied. (WinGRASS-6.4.0SVN-r39271-1-Setup.exe   21 Sept 2009)

if you are using that version and it still breaks, we'd like to hear
about it.
Hi, first post to this list. I am using WinGRASS-6.4.0SVN-r39271-1-Setup.exe   21 Sept 2009 and I have the same database problem
Markus Neteler

Re: Database driver problem

Reply Threaded More More options
Print post
Permalink
In reply to this post by grassyjohn
On Sun, Sep 27, 2009 at 10:45 AM, grassyjohn <[hidden email]> wrote:

>
> I've tried importing the spearfish_contours files via File-->Import Vector
> Map-->Multiple Formats Using OGR and get this message
>
> Invalid argument: can't _spawnl
> Unable to start driver <sqlite>
>
> Unable open database
> <D:/GIS_DataBase/Spearfish60/user1/dbf/spearfish_contours.db> by driver
> <sqlite>
>
> I've tried using dbf and ogr database drivers but the result is the same.

A new version has been prepared which apparently cures this problem:

http://grass.osgeo.org/grass64/binary/mswindows/native/

Please try and report further issues.

Markus
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user