[GRASS-user] grass 6.3 bug

Hi all,
I'm testin grass 6.3 and I have a problem with v.dissolve:

v.dissolve input=t_comuni_2003@PERMANENT output=province layer=1
column=provincia
dbmi: Protocol error

I don't think that it is a database connection error because other
commands run well with the same vector.

Regrads
Leo

Leonardo Lami wrote:

Hi all,
I'm testin grass 6.3 and I have a problem with v.dissolve:

v.dissolve input=t_comuni_2003@PERMANENT output=province layer=1
column=provincia
dbmi: Protocol error

What platform?

What 6.3 CVS checkout date?

What DB backend do you use?

Can you reproduce the problem in sperfish60 location?

If you don't and can't provide your data for testing, run:

$ g.gisenv set="DEBUG=5"

then your v.dissolve command and pass the output over to the list.

You might find this usefull:
http://grass.gdf-hannover.de/wiki/GRASS_Debugging

Maciek

Maciej Sieczka ha scritto:

Leonardo Lami wrote:
  

Hi all,
I'm testin grass 6.3 and I have a problem with v.dissolve:

v.dissolve input=t_comuni_2003@PERMANENT output=province layer=1
column=provincia
dbmi: Protocol error
    
What platform?
  

Linux Debian

What 6.3 CVS checkout date?
  

26/05/07

What DB backend do you use?
  

postgresql 8.1

Can you reproduce the problem in sperfish60 location?
  

v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
dbmi: Protocol error

and the output shell stops
I must make Ctrl-c to go on

now db=dbf

If you don't and can't provide your data for testing, run:

$ g.gisenv set="DEBUG=5"

then your v.dissolve command and pass the output over to the list.
  

[....]
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D3/5: dig_Rd_P_isle()
D3/5: dig_isle_alloc_line():
D2/5: Vect_cidx_open(): name = soils mapset= PERMANENT
D3/5: dig_cidx_init()
D3/5: dig_read_cidx()
D3/5: dig_cidx_init()
D3/5: Cidx header: file version 5.0 , supported from GRASS version 5.0
D3/5: byte order 0
D3/5: header size 9
D1/5: V1_open_old_nat(): name = soils mapset = PERMANENT
D2/5: Coor header: file version 5.1 , supported from GRASS version 5.1
D2/5: byte order 0
D2/5: header size 14
D2/5: with_z 0
D2/5: coor size 634133
D1/5: get coor info:
/home/Documenti/datigrass/spearfish60/PERMANENT/vector/soils/coor
D1/5: Info->size = 634133, Info->mtime = 1113222409
D1/5: coor size in head = 634133, real coor file size= 634133
D2/5: dig_file_load ()
D2/5: requested mode = 2
D2/5: size = 634133
D2/5: file was not loaded to the memory
D1/5: Vect_open_old(): vector opened on level 2
D1/5: Vect_read_dblinks(): map = soils, mapset = PERMANENT
D3/5: Searching for FID column in OGR DB
D1/5: dbln file:
/home/Documenti/datigrass/spearfish60/PERMANENT/vector/soils/dbln
D1/5: dbln: 1 soils cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D3/5: Field number <1>, name <(null)>
D3/5: Vect_check_dblink: field 1
D1/5: field = 1 name = (null), table = soils, key = cat, database =
$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, driver = dbf
D1/5: Dblinks read
D1/5: Vect_Rewind(): name = soils
D2/5: Vect_open_new(): name = soils@PERMANENT_7790
D1/5: Vect_set_thresh(): thresh = 0.000000
D1/5: V1_open_new_nat(): name = soils@PERMANENT_7790
D1/5: Vect_get_thresh(): thresh = 0.000000
D1/5: dig__write_head()
D1/5: write coor size (0) to head
D2/5: coor body offset 14
D3/5: dig_init_plus()
D1/5: dig_spidx_init()
D3/5: dig_cidx_init()
D1/5: Vect_get_thresh(): thresh = 0.000000
D1/5: Vect_set_thresh(): thresh = 0.000000
D3/5: Vect_hist_copy()
D5/5: Vect_hist_write()
D3/5: Vect_hist_command()
D3/5: G_recreate_command()
D5/5: Vect_hist_write()
D5/5: Vect_hist_write()
D5/5: Vect_hist_write()
D5/5: Vect_hist_write()
D5/5: Vect_hist_write()
D1/5: Vect_get_field(): field = 1
D1/5: Vect_get_dblink(): link = 0
D3/5: Vect_subst_var(): in = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, map
= soils, mapset = PERMANENT
D3/5: -> /home/Documenti/datigrass/spearfish60/PERMANENT/dbf/
D3/5: db_start_driver_open_database():
  drvname = dbf, dbname =
/home/Documenti/datigrass/spearfish60/PERMANENT/dbf/
D2/5: opendir /usr/local/grass-6.3.cvs/driver/db/

D2/5: DBF: db__driver_open_database() name =
'/home/Documenti/datigrass/spearfish60/PERMANENT/dbf/'
D2/5: db.name = /home/Documenti/datigrass/spearfish60/PERMANENT/dbf/
D2/5: add_table(): table = archsites name = archsites.dbf
D2/5: add_table(): table = bugsites name = bugsites.dbf
D2/5: add_table(): table = fields name = fields.dbf
D2/5: add_table(): table = roads name = roads.dbf
D2/5: add_table(): table = soils name = soils.dbf
D2/5: add_table(): table = streams name = streams.dbf
D2/5: find_table(): table = soils
D2/5: ? archsites
D2/5: ? bugsites
D2/5: ? fields
D2/5: ? roads
D2/5: ? soils
D2/5: load_table_head(): tab = 4,
/home/Documenti/datigrass/spearfish60/PERMANENT/dbf//soils.dbf
D2/5: ncols = 2
D2/5: DBFFieldType 1
D3/5: add_column(): tab = 4, type = 2, name = cat, width = 11, decimals = 0
D2/5: DBFFieldType 0
D3/5: add_column(): tab = 4, type = 1, name = label, width = 13,
decimals = 0
D1/5: Vect_default_field_info(): map = soils@PERMANENT_7790 field = 1
D2/5: drv = dbf db = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
D3/5: Field number <1>, name <(null)>
D3/5: Vect_check_dblink: field 1
D1/5: Vect_write_dblinks(): map = soils@PERMANENT_7790, mapset = corso
D1/5: dbln file:
/home/Documenti/datigrass/spearfish60/corso/vector/soils@PERMANENT_7790/dbln
D1/5: 1 soils@PERMANENT_7790 cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D1/5: Dblinks written
D3/5: Vect_subst_var(): in = $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/, map
= soils@PERMANENT_7790, mapset = corso
D3/5: -> /home/Documenti/datigrass/spearfish60/corso/dbf/
D3/5: db_start_driver_open_database():
  drvname = dbf, dbname = /home/Documenti/datigrass/spearfish60/corso/dbf/
D2/5: opendir /usr/local/grass-6.3.cvs/driver/db/

D2/5: DBF: db__driver_open_database() name =
'/home/Documenti/datigrass/spearfish60/corso/dbf/'
D2/5: db.name = /home/Documenti/datigrass/spearfish60/corso/dbf/
D3/5: SQL: SELECT cat, label FROM soils ORDER BY label
D3/5: SQL statement parsed successfully: SELECT cat, label FROM soils
ORDER BY label
D2/5: find_table(): table = soils
D2/5: ? archsites
D2/5: ? bugsites
D2/5: ? fields
D2/5: ? roads
D2/5: ? soils
D2/5: load_table_head(): tab = 4,
/home/Documenti/datigrass/spearfish60/PERMANENT/dbf//soils.dbf
D3/5: Doing SQL command <4> on DBF table... (see include/sqlp.h)
D2/5: SELECT
D2/5: sel(): tab = 4
D2/5: load_table(): tab = 4
D2/5: ncols = 2 nrows = 54
D3/5: Order selection by label
D2/5: load_table_head(): tab = 4,
/home/Documenti/datigrass/spearfish60/PERMANENT/dbf//soils.dbf
D3/5: 54 rows selected
D3/5: key type = 15
dbmi: Protocol error
D1/5: Vect_close(): name = soils@PERMANENT_7790, mapset = corso, format
= 0, level = 1
D1/5: close history file
D1/5: V1_close_nat(): name = soils@PERMANENT_7790 mapset= corso
D1/5: get coor info:
/home/Documenti/datigrass/spearfish60/corso/vector/soils@PERMANENT_7790/coor
D1/5: Info->size = 14, Info->mtime = 1180455741
D1/5: dig__write_head()
D1/5: write coor size (14) to head
D2/5: coor body offset 14
D1/5: Vect_get_thresh(): thresh = 0.000000
D1/5: Vect_write_dblinks(): map = soils@PERMANENT_7790, mapset = corso
D1/5: dbln file:
/home/Documenti/datigrass/spearfish60/corso/vector/soils@PERMANENT_7790/dbln
D1/5: 1 soils@PERMANENT_7790 cat $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ dbf
D1/5: Dblinks written
D2/5: save_table 0
D2/5: save_table 1
D2/5: save_table 2
D2/5: save_table 3
D2/5: save_table 4
D2/5: save_table 5

and it stops

You might find this usefull:
http://grass.gdf-hannover.de/wiki/GRASS_Debugging

Maciek

Bug confirmed... Adding "-x" in the first line of v.dissolve shows the error:

v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
...
+ table=soils
+ '[' -z soils ']'
+ v.reclass input=soils@PERMANENT output=soils@PERMANENT_23874 layer=1
column=label
dbmi: Protocol error
ERROR: Cannot open select cursor: SELECT cat, label FROM soils ORDER BY
       label
...

It appears that the DBF driver doesn't support correctly "ORDER BY". Too
bad.

Trying dry run in PERMANENT:
echo "SELECT cat, label FROM soils ORDER BY label" | db.select
...
D3/3: Order selection by label
dbmi: Protocol error

At this point also PG and SQLite and MySQL will fail, since the originating
file is DBF and hence "ORDER BY" fails.

I am a bit surprised at this point since I dissolved maps recently.

Markus

Leonardo Lami wrote:

Maciej Sieczka ha scritto:

Leonardo Lami wrote:

...

Can you reproduce the problem in sperfish60 location?
  

v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
dbmi: Protocol error

and the output shell stops
I must make Ctrl-c to go on
...

--
View this message in context: http://www.nabble.com/grass-6.3-bug-tf3834643.html#a10858069
Sent from the Grass - Users mailing list archive at Nabble.com.

Leonardo Lami wrote:

Maciej Sieczka ha scritto:

What platform?
  

Linux Debian

What 6.3 CVS checkout date?
  

26/05/07

What DB backend do you use?
  

postgresql 8.1

From further reading of Leonardo's post it shows that dbf fails too.

Can you reproduce the problem in sperfish60 location?
  

v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
dbmi: Protocol error

and the output shell stops
I must make Ctrl-c to go on

I confirm with current 6.3 CVS on my linux box, using dbf driver.

Hopefully Hamish can come up with solution.

Maciek

Maciej Sieczka wrote:

Leonardo Lami wrote:

Maciej Sieczka ha scritto:

What platform?
  

Linux Debian

What 6.3 CVS checkout date?
  

26/05/07

What DB backend do you use?
  

postgresql 8.1

From further reading of Leonardo's post it shows that dbf fails too.

Can you reproduce the problem in sperfish60 location?
  

v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
dbmi: Protocol error

and the output shell stops
I must make Ctrl-c to go on

I confirm with current 6.3 CVS on my linux box, using dbf driver.

Hopefully Hamish can come up with solution.

In addition to this, i have noticed another bug in v.dissolve. Although
"layer=-1" is supported, according to manual, it yields a grep error:

--------

$ sh -x /usr/local/grass-6.3.cvs/scripts/v.dissolve
input=soils@PERMANENT output=soils2 column=label layer=-1 --o
+ [ -z /usr/local/grass-6.3.cvs ]
+ [ input=soils@PERMANENT != @ARGS_PARSED@ ]
+ basename /usr/local/grass-6.3.cvs/scripts/v.dissolve
+ CMDLINE=v.dissolve
+ CMDLINE=v.dissolve "input=soils@PERMANENT"
+ CMDLINE=v.dissolve "input=soils@PERMANENT" "output=soils2"
+ CMDLINE=v.dissolve "input=soils@PERMANENT" "output=soils2" "column=label"
+ CMDLINE=v.dissolve "input=soils@PERMANENT" "output=soils2"
"column=label" "layer=-1"
+ CMDLINE=v.dissolve "input=soils@PERMANENT" "output=soils2"
"column=label" "layer=-1" "--o"
+ export CMDLINE
+ exec g.parser /usr/local/grass-6.3.cvs/scripts/v.dissolve
input=soils@PERMANENT output=soils2 column=label layer=-1 --o
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
ERROR: There is no table connected to this map!

--------

The last ERROR is bogus - the table *is* connected to input map.

Maciek

>> v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
>> dbmi: Protocol error

Maciej Sieczka wrote:

> I confirm with current 6.3 CVS on my linux box, using dbf driver.
>
> Hopefully Hamish can come up with solution.

I have little experience with DBs and SQL magic, sorry.
(I didn't add the v.reclass stuff)

In addition to this, i have noticed another bug in v.dissolve. Although
"layer=-1" is supported, according to manual, it yields a grep error:

..

Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
ERROR: There is no table connected to this map!

--------

The last ERROR is bogus - the table *is* connected to input map.

I assume this comes from here:

   table=`v.db.connect $GIS_OPT_INPUT -g | grep -w $GIS_OPT_LAYER | awk '{print $2}'`
   if [ -z "$table" ] ; then
      g.message -e 'There is no table connected to this map!'
      cleanup
      exit 1
   fi

possibles:
1) is "grep -w" portable?
2) Is "grep -w 1" slightly vague? Perhaps: grep "^$GIS_OPT_LAYER "
3) test for [ $? -ne 0 ] instead of [ -z $table" ], or && ?
???

Hamish

I have fixed below DBMI error if input map is specified with @mapset.
Submitted to 6.3-CVS and 6.2-CVS.

cheers
Markus

Markus Neteler wrote:

Bug confirmed... Adding "-x" in the first line of v.dissolve shows the
error:

v.dissolve input=soils@PERMANENT output=soils layer=1 column=label
...

--
View this message in context: http://www.nabble.com/grass-6.3-bug-tf3834643.html#a10912523
Sent from the Grass - Users mailing list archive at Nabble.com.