Opened 11 years ago

Closed 11 years ago

#1796 closed defect (fixed)

wingrass7: some db.*-modules fails with dbf as db-backend

Reported by: hellik Owned by: grass-dev@…
Priority: blocker Milestone: 7.0.0
Component: Database Version: svn-trunk
Keywords: dbf Cc:
CPU: x86-64 Platform: MSWindows 7

Description

fails:

db.databases --verbose                                                          
D2/3: dbDbmscap(): opendir
[C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D2/3: dbDbmscap(): opendir
[C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
"C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\dbf.exe"
D1/3: db_d_init_error(): DBF
dbmi: db_list_databases() not implemented
ERROR: Kann Datenbanken nicht auflisten.
ERROR: Databases can't be listet.
(Mon Nov 12 17:20:18 2012) Command finished (0 sec)

ok:

db.tables --verbose                                                             
ccm2_example_wgs84
ccm2_example_wgs843d_ccm2_example_wgs84
ccm2_example_wgs84_smaller19
riverclipped
testarea
testareaisel
(Mon Nov 12 17:23:17 2012) Command finished (0 sec)

fails:

db.describe --verbose table=ccm2_example_wgs84                                  
D2/3: dbDbmscap(): opendir
[C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D2/3: dbDbmscap(): opendir
[C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
"C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\dbf.exe"
D1/3: db_d_init_error(): DBF
D2/3: DBF: db__driver_open_database() name =
'$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
D3/3: tokens[0] = $GISDBASE
D3/3:    -> C:\grassdata
D3/3: tokens[1] = $LOCATION_NAME
D3/3:    -> srtm41gar
D3/3: tokens[2] = $MAPSET
D3/3:    -> vectexample
D3/3: tokens[3] = dbf
D2/3: db.name = C:\grassdata/srtm41gar/vectexample/dbf/
D2/3: add_table(): table = ccm2_example_wgs84 name =
ccm2_example_wgs84.dbf
D2/3: add_table(): table =
ccm2_example_wgs843d_ccm2_example_wgs84 name =
ccm2_example_wgs843d_ccm2_example_wgs84.dbf
D2/3: add_table(): table = ccm2_example_wgs84_smaller19 name
= ccm2_example_wgs84_smaller19.dbf
D2/3: add_table(): table = riverclipped name =
riverclipped.dbf
D2/3: add_table(): table = testarea name = testarea.dbf
D2/3: add_table(): table = testareaisel name =
testareaisel.dbf
D2/3: find_table(): table = ccm2_example_wgs84
D2/3:   ? ccm2_example_wgs84
D2/3: load_table_head(): tab = 0, C:\grassdata/srtm41gar/vec
texample/dbf/\ccm2_example_wgs84.dbf
D2/3:   ncols = 25
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = cat, width =
11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = WSO1_ID, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = WSO_ID, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = RVR_ID, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = FROMNODE,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = TONODE, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = STRAHLER,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = PFAFSTETTE,
width = 20, decimals = 6
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = NEXTDOWNID,
width = 11, decimals = 0
D2/3:   DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = LONGPATH,
width = 1, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = MAINDRAIN_,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = MAINDRAIN1,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = LENGTH, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = CUM_LEN, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = PIXELS_100,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = CATCHMENT_,
width = 20, decimals = 6
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = CONT_PIXEL,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = DRAIN_KM2,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = ALT_GRADIE,
width = 20, decimals = 6
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = BURNED, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = CONFIDENCE,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = WINDOW, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = OBJECTID,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = SHAPE_Leng,
width = 20, decimals = 6
D2/3:   DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = grenze, width
= 1, decimals = 0

fails:

db.columns --verbose table=ccm2_example_wgs84                                   
D2/3: dbDbmscap(): opendir
[C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D2/3: dbDbmscap(): opendir
[C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c
"C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\dbf.exe"
D1/3: db_d_init_error(): DBF
D2/3: DBF: db__driver_open_database() name =
'$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
D3/3: tokens[0] = $GISDBASE
D3/3:    -> C:\grassdata
D3/3: tokens[1] = $LOCATION_NAME
D3/3:    -> srtm41gar
D3/3: tokens[2] = $MAPSET
D3/3:    -> vectexample
D3/3: tokens[3] = dbf
D2/3: db.name = C:\grassdata/srtm41gar/vectexample/dbf/
D2/3: add_table(): table = ccm2_example_wgs84 name =
ccm2_example_wgs84.dbf
D2/3: add_table(): table =
ccm2_example_wgs843d_ccm2_example_wgs84 name =
ccm2_example_wgs843d_ccm2_example_wgs84.dbf
D2/3: add_table(): table = ccm2_example_wgs84_smaller19 name
= ccm2_example_wgs84_smaller19.dbf
D2/3: add_table(): table = riverclipped name =
riverclipped.dbf
D2/3: add_table(): table = testarea name = testarea.dbf
D2/3: add_table(): table = testareaisel name =
testareaisel.dbf
D2/3: find_table(): table = ccm2_example_wgs84
D2/3:   ? ccm2_example_wgs84
D2/3: load_table_head(): tab = 0, C:\grassdata/srtm41gar/vec
texample/dbf/\ccm2_example_wgs84.dbf
D2/3:   ncols = 25
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = cat, width =
11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = WSO1_ID, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = WSO_ID, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = RVR_ID, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = FROMNODE,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = TONODE, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = STRAHLER,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = PFAFSTETTE,
width = 20, decimals = 6
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = NEXTDOWNID,
width = 11, decimals = 0
D2/3:   DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = LONGPATH,
width = 1, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = MAINDRAIN_,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = MAINDRAIN1,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = LENGTH, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = CUM_LEN, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = PIXELS_100,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = CATCHMENT_,
width = 20, decimals = 6
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = CONT_PIXEL,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = DRAIN_KM2,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = ALT_GRADIE,
width = 20, decimals = 6
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = BURNED, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = CONFIDENCE,
width = 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = WINDOW, width
= 11, decimals = 0
D2/3:   DBFFieldType 1
D3/3: add_column(): tab = 0, type = 2, name = OBJECTID,
width = 11, decimals = 0
D2/3:   DBFFieldType 2
D3/3: add_column(): tab = 0, type = 3, name = SHAPE_Leng,
width = 20, decimals = 6
D2/3:   DBFFieldType 0
D3/3: add_column(): tab = 0, type = 1, name = grenze, width
= 1, decimals = 0

Helmut

System Info                                                                     
GRASS version: 7.0.svn                                                          
GRASS SVN Revision: 53771                                                       
GIS Library Revision: 52468 (2012-07-27)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ.4: 4.8.0                                                                   
GEOS: 3.3.5                                                                     
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)  

Attachments (3)

db.columns.db_issue.txt (1.1 KB ) - added by hellik 11 years ago.
db.describe.db_issue.txt (1.1 KB ) - added by hellik 11 years ago.
g.copy.db_issue.txt (6.3 KB ) - added by hellik 11 years ago.

Download all attachments as: .zip

Change History (20)

in reply to:  description comment:1 by martinl, 11 years ago

Replying to hellik:

db.databases --verbose                                                          
> dbmi: db_list_databases() not implemented
> ERROR: Kann Datenbanken nicht auflisten.
> ERROR: Databases can't be listet.
> (Mon Nov 12 17:20:18 2012) Command finished (0 sec)

db.databases currently works only with SQLite, ODBC, and PG drivers, see the manual page

Currently supported database drivers are SQLite, PostgreSQL, and ODBC. 

PS: please, use LANG=C for bug reports.

by hellik, 11 years ago

Attachment: db.columns.db_issue.txt added

by hellik, 11 years ago

Attachment: db.describe.db_issue.txt added

by hellik, 11 years ago

Attachment: g.copy.db_issue.txt added

comment:2 by hellik, 11 years ago

Keywords: dbf added

in reply to:  description ; comment:3 by hellik, 11 years ago

Summary: wingrass7: some db.*-modules failswingrass7: some db.*-modules fails with dbf as db-backend

Replying to hellik:

now tested with two mapsets

mapset A with sqlite as db-backend mapset B with dbf as db-backend

and a simple vector map with a simple table

v.report.py map=gea option=area                                
cat|gea|area
1|1|217053697069.384

all db.* are working in mapset A with sqlite as db-backend

all db.* are not working in mapset B with dbf as db-backend

g.copy vector from mapset B to mapset A is not working

debug=3-output added as textfiles

Helmut

in reply to:  3 ; comment:4 by hellik, 11 years ago

Replying to hellik:

all db.* are working in mapset A with sqlite as db-backend

not really...

tested today opening attribute table with sqlite as db-backend

GRASS 7.0.svn> D2/3: dbDbmscap(): opendir [C:\OSGeo4W\apps\grass\grass-7.0.svn\d
river\db\]
D2/3: dbDbmscap(): opendir [C:\OSGeo4W\apps\grass\grass-7.0.svn\driver\db\]
D3/3: win_spawn: args = C:\windows\system32\cmd.exe /c "C:\OSGeo4W\apps\grass\gr
ass-7.0.svn\driver\db\sqlite.exe"
D1/3: db_d_init_error(): SQLite
D3/3:
db_driver_open_database()
D3/3: name = 'C:\grassdata\srtm41gar\rstreamanalysis\sqlite\sqlite.db'
D2/3: name2 = 'C:\grassdata\srtm41gar\rstreamanalysis\sqlite\sqlite.db'
D3/3: describe_table()
D3/3: sqltype = 3
D3/3: litetype = 1
D3/3: sqltype = 1
D3/3: litetype = 3
D3/3: sqltype = 3
D3/3: litetype = 1
D3/3: nkcols = 3
D3/3: sqltype = 3
D3/3: litetype = 1
D2/3: col: cat, nkcols 0, litetype : 1, sqltype 3
D3/3: sqltype = 1
D3/3: litetype = 3
D2/3: col: stream_type, nkcols 1, litetype : 3, sqltype 1
D3/3: sqltype = 3
D3/3: litetype = 1
D2/3: col: type_code, nkcols 2, litetype : 1, sqltype 3

?

in reply to:  4 ; comment:5 by hellik, 11 years ago

Replying to hellik:

Replying to hellik:

all db.* are working in mapset A with sqlite as db-backend

not really...

AFAICT working with vector-attributes doesn't work at the moment in wingrass7.

any ideas?

in reply to:  5 ; comment:6 by neteler, 11 years ago

Replying to hellik:

AFAICT working with vector-attributes doesn't work at the moment in wingrass7.

Wow. Can other winGRASS 7 users confirm?

To facilitate testing, I have uploaded North Carolina data as GRASS 7 location:

http://grass.osgeo.org/download/sample-data/ --> North Carolina data set

in reply to:  6 ; comment:7 by hellik, 11 years ago

Replying to neteler:

http://grass.osgeo.org/download/sample-data/ --> North Carolina data set

tested here this dataset with fresh osgeo4w-wingrass7, I get following

GRASS 7.0.svn> DBMI-SQLite driver error:
Unable to open database: \home\neteler\grassdata\nc_spm_latest\nc_spm_08\PERMANE
NT\sqlite\sqlite.db
unable to open database fileÐ>5☻²YÐ#hà☻

GRASS_INFO_ERROR(6716,1): Kann die Datenbank <\home\neteler\grassdata\nc_spm_lat
est\nc_spm_08\PERMANENT\sqlite\sqlite.db> nicht öffnen.
GRASS_INFO_END(6716,1)
DBMI-SQLite driver error:
Unable to open database: \home\neteler\grassdata\nc_spm_latest\nc_spm_08\PERMANE
NT\sqlite\sqlite.db
unable to open database fileÐ>I☻ì²ÿJï¢☻

GRASS_INFO_ERROR(3508,1): Kann die Datenbank <\home\neteler\grassdata\nc_spm_lat
est\nc_spm_08\PERMANENT\sqlite\sqlite.db> nicht öffnen.
GRASS_INFO_END(3508,1)

GRASS 7.0.svn>

some references to the computer used for location setup?

in reply to:  7 ; comment:8 by martinl, 11 years ago

Replying to hellik:

some references to the computer used for location setup?

this is probably related to v.db.reconnect.all -c which has been used when converting data from DBF to SQLite. I will fix the module later in the evening.

Martin

in reply to:  8 ; comment:9 by mmetz, 11 years ago

Replying to martinl:

Replying to hellik:

some references to the computer used for location setup?

this is probably related to v.db.reconnect.all -c which has been used when converting data from DBF to SQLite. I will fix the module later in the evening.

The bug (newly introduced in r53609) is that the variables $GISDBASE, $LOCATION_NAME, $MAPSET have been substituted in the name of the new database. Looking at the dbln file of a vector, it reads e.g.

1/boundary_county|boundary_county|cat|$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db|sqlite

and not

1/boundary_county|boundary_county|cat|\home\neteler\grassdata\nc_spm_lat
est\nc_spm_08\PERMANENT/sqlite/sqlite.db|sqlite

Database modules and vector modules usually take care of variable substitution themselves where appropriate, e.g. v.db.connect, which is called by v.db.reconnect.all.

Should be easy to fix.

Markus M

in reply to:  9 ; comment:10 by martinl, 11 years ago

Replying to mmetz:

The bug (newly introduced in r53609) is that the variables $GISDBASE, $LOCATION_NAME, $MAPSET have been substituted in the name of the new database. Looking at the dbln file of a vector, it reads e.g.

hopefully fixed in r54238.

in reply to:  10 ; comment:11 by martinl, 11 years ago

Replying to martinl:

Replying to mmetz:

The bug (newly introduced in r53609) is that the variables $GISDBASE, $LOCATION_NAME, $MAPSET have been substituted in the name of the new database. Looking at the dbln file of a vector, it reads e.g.

hopefully fixed in r54238.

to fix broken connections, run:

v.db.reconnect.all old_database=/home/neteler/grassdata/nc_spm_latest/nc_spm_08/PERMANENT/sqlite/sqlite.db new_driver=sqlite new_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'

in reply to:  11 ; comment:12 by neteler, 11 years ago

Replying to martinl:

Replying to martinl:

hopefully fixed in r54238.

to fix broken connections, run:

I have updated the GRASS 7 NC sample location on grass.osgeo.org accordingly.

in reply to:  12 ; comment:13 by martinl, 11 years ago

Replying to neteler:

I have updated the GRASS 7 NC sample location on grass.osgeo.org accordingly.

dataset downloaded, tested, seems to be OK. Thanks!

in reply to:  13 ; comment:14 by hellik, 11 years ago

Replying to martinl:

Replying to neteler:

I have updated the GRASS 7 NC sample location on grass.osgeo.org accordingly.

dataset downloaded, tested, seems to be OK. Thanks!

thanks for the updated sample dataset.

but e.g. opening attribute table still freezes GUI, db-actions seems still not to work.

testedt with

System Info                                                                     
GRASS version: 7.0.svn                                                          
GRASS SVN Revision: 54245                                                       
GIS Library Revision: 52468 (2012-07-27)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ.4: 4.8.0                                                                   
GEOS: 3.3.5                                                                     
SQLite: 3.7.10                                                                  
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W) 

comment:15 by hellik, 11 years ago

Priority: criticalblocker

in reply to:  14 ; comment:16 by mmetz, 11 years ago

Replying to hellik:

Replying to martinl:

Replying to neteler:

I have updated the GRASS 7 NC sample location on grass.osgeo.org accordingly.

dataset downloaded, tested, seems to be OK. Thanks!

thanks for the updated sample dataset.

but e.g. opening attribute table still freezes GUI, db-actions seems still not to work.

Can you test again? The bug should be fixed with r55382.

in reply to:  16 comment:17 by hellik, 11 years ago

Resolution: fixed
Status: newclosed

Replying to mmetz:

Can you test again? The bug should be fixed with r55382.

just a quick test with

GRASS version: 7.0.svn                                                          
GRASS SVN Revision: 55413                                                       
Build Date: 2013-02-18                                                          
GIS Library Revision: 52468 (2012-07-27)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ.4: 4.8.0                                                                   
GEOS: 3.3.6dev                                                                  
SQLite: 3.7.10                                                                  
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)  

works here. closing ticket, reopen if needed.

Note: See TracTickets for help on using tickets.