[GRASS-dev] possible error in WIKI could cause data corruption

Markus Neteler neteler at osgeo.org
Sat Sep 5 11:26:57 PDT 2015


On Sat, Sep 5, 2015 at 7:51 PM, Michael Barton <Michael.Barton at asu.edu> wrote:
> I don’t know if this is bad advice in the GRASS WIKI or a bug in a GRASS
> database module. I have some vector files that were somehow imported into a
> dbf DBMS last year. I wanted to switch them all to sqlite. The GRASS WIKI
> advises…
>
> Convert automatically all GRASS 6 vector maps to GRASS 7 (including
> attribute transfer from DBF to SQLite)


https://grasswiki.osgeo.org/wiki/Convert_all_GRASS_6_vector_maps_to_GRASS_7

...

> The vectors already had GRASS 7 topology, but I ran v.rebuild.all just to be
> sure. No problem.
>
> db.connect -d ran with no problem
>
> But v.db.reconnect.all -cd did not create tables in the sqlite database

But the sqlite file is there?

> and corrupted the existing connection of the first table it hit. Fortunately, I
> made a backup of the mapset before I started this.

Perhaps a problem on Mac?
This is strange - I have converted so many mapsets like that ..., even
with lots of vector maps inside.
The wiki page is there for a long time, I didn't see such reports so far.

> GRASS 7.1.svn (Spain_fieldwork_medlands_ERTS89_Z30):~ > v.db.reconnect.all
> -cd
>
> --------------------------------------------------------------------------------
> Reconnecting vector map <catastro at surveyboundaries> (1 of 9)...
> --------------------------------------------------------------------------------
> Copying table <catastro> to target database...
> Traceback (most recent call last):
>   File
> "/Applications/GRASS/GRASS-7.1.app/Contents/MacOS/scripts/db.droptable",
> line 99, in <module>
>     main()
>   File
> "/Applications/GRASS/GRASS-7.1.app/Contents/MacOS/scripts/db.droptable",
> line 77, in main
>     used = grass.db.db_table_in_vector(table)
>   File
> "/Applications/GRASS/GRASS-7.1.app/Contents/MacOS/etc/python/grass/script/db.py",
> line 184, in db_table_in_vector
>     from vector import vector_db
> ImportError: No module named vector

Maybe something got broken in GRASS 7.1?

I would definitely use 7.0 for such operations.

Markus

> ERROR: Unable to drop table <catastro>
> GRASS 7.1.svn (Spain_fieldwork_medlands_ERTS89_Z30):~ >
>
> Michael
> ____________________
> C. Michael Barton
> Director, Center for Social Dynamics & Complexity
> Professor of Anthropology, School of Human Evolution & Social Change
> Head, Graduate Faculty in Complex Adaptive Systems Science
> Arizona State University
>
> voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
> fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu


More information about the grass-dev mailing list