Opened 15 years ago

Closed 15 years ago

#979 closed defect (fixed)

WxGUI fails to display vector attribute table if default db connection is missing

Reported by: marisn Owned by: martinl
Priority: critical Milestone: 6.4.0
Component: wxGUI Version: svn-releasebranch64
Keywords: wingrass, database Cc: grass-dev@…
CPU: x86-32 Platform: MSWindows Vista

Description

Displaying attribute data for Spearfish roads (and any other vector map) fails. Most likely another spaces issue. Files are present in C:\Users\Maris\Documents\GIS DataBase\Spearfish60\PERMANENT\dbf As paths are set up by default in installer, rising this as an blocker.

(Mon Mar 01 20:19:05 2010)                                                      
v.info map=roads@PERMANENT                                                      
 +----------------------------------------------------------------------------+
 | Layer:           roads@PERMANENT                                           |
 | Mapset:          PERMANENT                                                 |
 | Location:        Spearfish60                                               |
 | Database:        C:/Users/Maris/Documents/GIS DataBase                     |
 | Title:           Output from Vpatch                                        |
 | Map scale:       1:24000                                                   |
 | Map format:      native                                                    |
 | Name of creator: youngs                                                    |
 | Organization:    US Army Const. Eng. Rsch. Lab                             |
 | Source date:     1961                                                      |
 |----------------------------------------------------------------------------|
 |   Type of Map:  vektors (level: 2)                                         |
 |                                                                            |
 |   Number of points:       0               Number of areas:      0          |
 |   Number of lines:        825             Number of islands:    0          |
 |   Number of boundaries:   0               Number of faces:      0          |
 |   Number of centroids:    0               Number of kernels:    0          |
 |                                                                            |
 |   Map is 3D:              No                                               |
 |   Number of dblinks:      1                                                |
 |                                                                            |
 |         Projection: UTM (zone 13)                                          |
 |               N:  4928063.39801461    S:  4914006.33783702                 |
 |               E:   609527.21021496    W:   589434.85646865                 |
 |                                                                            |
 |   Digitization threshold: 18.288                                           |
 |   Comments:                                                                |
 |     new roads at 1:24000 for Spearfish database                            |
 +----------------------------------------------------------------------------+
(Mon Mar 01 20:19:05 2010) Command finished (0 sec)                             
Traceback (most recent call last):
  File "C:/Program
Files/GRASS-64-SVN/etc/wxpython/wxgui.py", line 1197, in
OnShowAttributeTable

item=layer, log=self.goutput)
  File "C:\Program
Files\GRASS-64-SVN\etc\wxpython\gui_modules\dbm.py", line
558, in __init__

self.__createManageLayerPage()
  File "C:\Program
Files\GRASS-64-SVN\etc\wxpython\gui_modules\dbm.py", line
950, in __createManageLayerPage

parentDialog=self)
  File "C:\Program
Files\GRASS-64-SVN\etc\wxpython\gui_modules\dbm.py", line
2202, in __init__

raise gcmd.DBMError(_('Unable to determine default DB
connection settings. '
gui_modules.gcmd
.
DBMError

WinGRASS-6.4.SVN-r41233-1 on Windows Vista

Change History (13)

comment:1 by marisn, 15 years ago

Indeed this seems to be a space issue in wxgui, as gis.m works just fine. Maybe gis.m code can be used as an example: source:grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl@38296#L273

comment:2 by hamish, 15 years ago

Keywords: wingrass added; windows removed

it is unclear to me how you are triggering the bug. Vector -> Reports and stats -> Basic vector metadata ?? (which works for me)

  • query in map display window works
  • right click on map name in layer manager and start attribute table manager works

I'd be more suspicious that this is due to db.select being used instead of v.db.select.

(db.select only works on maps in the current mapset, while v.db.select accepts @othermapset. see v.db.* scripts for workaround)

Hamish

in reply to:  2 ; comment:3 by marisn, 15 years ago

Replying to hamish:

it is unclear to me how you are triggering the bug.

As I'm using WxGUI for first time, I was not aware of so many options. Start GRASS, Location=Spearfish6 Mapset=user

Vector -> Reports and stats -> Basic vector metadata ?? (which works for me)

It's v.info and not WxGUI. Still it reports wrong database, but prints out correct column names.

  • query in map display window works

It's v.what and not WxGUI. Works fine, as it doesn't fiddle with db settings.

  • right click on map name in layer manager and start attribute table manager works

This is WxGUI specific. Fails in same way as pressing button "Show attribute table"

You are right about this. Attribute data works fine, if I launch wxgui within PERMANENT mapset.

I'd be more suspicious that this is due to db.select being used instead of v.db.select.

(db.select only works on maps in the current mapset, while v.db.select accepts @othermapset. see v.db.* scripts for workaround)

Hamish

in reply to:  3 comment:4 by hamish, 15 years ago

Replying to marisn:

Replying to hamish:

it is unclear to me how you are triggering the bug.

Start GRASS, Location=Spearfish6 Mapset=user

... then what?

It is still very unclear to me: what buttons do you press in the GUI to trigger this?

It's v.info and not WxGUI. Still it reports wrong database, but prints out correct column names.

... are you running v.info from the Cmd> prompt in the wxGUI layer manager? v.info called by itself without extra flags will not print out column names.

confused, Hamish

comment:5 by marisn, 15 years ago

As my verbal skills are too poor, I created video to display all steps. For textual output see my previous comments. http://www.gisnet.lv/ggmlinux/grass_01.avi

This looks like an Heisenbug. When I wanted to post a reply for first time, I was unable to reproduce problem anymore. Then during lab work WxGUI attribute displaying failed on 15 Windows XP and my Vista computer too (all running same GRASS version). (Unfortunately that wasn't the only moment when I felt embarrassment because I choose to show new gui) If anyone has instructions how to run WxGUI with Valgrind on Windows Vista, I would like to hear it to provide info about probable memory corruption.

in reply to:  5 comment:6 by martinl, 15 years ago

Priority: blockercritical

Replying to marisn:

As my verbal skills are too poor, I created video to display all steps. For textual output see my previous comments. http://www.gisnet.lv/ggmlinux/grass_01.avi

This looks like an Heisenbug. When I wanted to post a reply for first time, I was unable to reproduce problem anymore. Then during lab work WxGUI attribute displaying failed on 15 Windows XP and my Vista computer too (all running same GRASS version). (Unfortunately that wasn't the only moment when I felt embarrassment because I choose to show new gui) If anyone has instructions how to run WxGUI with Valgrind on Windows Vista, I would like to hear it to provide info about probable memory corruption.

Seems to be, unable to reproduce with r41310 (GRASS 6.4 MS Window Server 2008). Downgrading the ticket priority. Martin

comment:7 by cmbarton, 15 years ago

Something similar happened to me. I reported it a couple weeks back. Trying running v.db.connect on this to explicitly set a db driver and db connection to a specific dbf file. Something I'm also wondering about is if this works better with sqlite now.

Michael

in reply to:  5 comment:8 by hamish, 15 years ago

Replying to marisn:

http://www.gisnet.lv/ggmlinux/grass_01.avi

pop up window at the start of it:

__Attribute table manager error__

(X) Unable to determine default DB connection settings. Please define DB connection using db.connect module.

that error comes from gui/wxpython/gui_modules/dbm.py after running db.connect -p if driver: or database: has no value.

What does db.connect -p say from the MSys command line? (or from the Cmd> prompt)

does the drosmins mapset have a valid VAR file in it? (we are reading a vector+table from another mapset in this example, so I'm not sure how useful what db.connect tells us is going to be, but...)

do you see the same error if you g.copy the vector into the current mapset first?

following the same actions work for me in Windows XP.

Hamish

ps- your English is really fine, the problem is that there are twenty ways for the common commands to be called as part of different work-flow areas, so knowing which one it is takes a lot of describing. the video was super clear, thanks.

comment:9 by marisn, 15 years ago

Summary: WxGUI fails to display vector attribute tableWxGUI fails to display vector attribute table if default db connection is missing

Hamish, You are right about db.connect issue. I just started to look into code and also decided to test db.connect output:

(Tue Mar 09 16:06:12 2010)                                                      
db.connect -p                                                                   
driver:
database:
schema:
group:
(Tue Mar 09 16:06:12 2010) Command finished (0 sec)   

First step to reproduce issue is "Create new mapset in wxgui startup screen".

When I created new mapset in wxgui startup screen, it's directroy had only "WIND" file and ".tmp" folder. No "VAR" files. Missing "VAR" file in new mapsets is discussed in #7

Still wxgui should NOT fail if default DB connection is missing (or is incorrect etc.), as only selected vector map connection matters.

When I copy vector map from PERMANENT to newMapset with g.copy, there is message, that ~"Default db connection is created" and also afterwards there is an "VAR" file in mapset. Then displaying attribute data for current mapset or PERMANENT works just fine.

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

Cc: grass-dev@… added
Keywords: wxgui removed
Owner: changed from grass-dev@… to martinl
Status: newassigned

Replying to marisn:

Still wxgui should NOT fail if default DB connection is missing (or is incorrect etc.), as only selected vector map connection matters.

Hopefully fixed in r41403. Martin

comment:11 by hamish, 15 years ago

Martin:

Hopefully fixed in r41403.

yes, works for me. (tested in 6.5svn on linux)

but now I get a bunch of warnings in the terminal

(gui:6256): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17

thanks, Hamish

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

Replying to hamish:

Martin:

Hopefully fixed in r41403.

but now I get a bunch of warnings in the terminal

(gui:6256): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17

it has been already reported in bug-tracker. Just low priority. Martin

comment:13 by marisn, 15 years ago

Resolution: fixed
Status: assignedclosed

Seems to be fixed. Works fine in current WinGRASS on Vista.

Note: See TracTickets for help on using tickets.