Opened 13 years ago

Closed 11 years ago

#1270 closed defect (fixed)

wingrass: Error in Attribute Table Manager

Reported by: antonioall Owned by: grass-dev@…
Priority: blocker Milestone: 6.4.3
Component: wxGUI Version: svn-develbranch6
Keywords: wingrass, attribute table manager Cc:
CPU: x86-32 Platform: MSWindows Vista

Description

Hi, If I add columns to the database of a coverage in "Attribute Table Manager" and I modify a value in these columns, Grass shows a message of error (you see attached image) and it doesn't memorize the value.

Thanks

Attachments (4)

TableError.jpg (102.8 KB ) - added by antonioall 13 years ago.
edittable1.jpg (72.5 KB ) - added by hellik 11 years ago.
edittable2.jpg (90.2 KB ) - added by hellik 11 years ago.
edittable3.jpg (87.7 KB ) - added by hellik 11 years ago.

Download all attachments as: .zip

Change History (37)

by antonioall, 13 years ago

Attachment: TableError.jpg added

comment:1 by antonioall, 13 years ago

CPU: x86-64x86-32

comment:2 by hellik, 13 years ago

Keywords: wingrass added

comment:3 by hamish, 12 years ago

Component: DatabasewxGUI
Keywords: attribute table manager added
Milestone: 6.4.16.4.2
Priority: normalcritical
Version: 6.4.1 RCssvn-develbranch6

Hi,

I can reproduce this in 6.5svn nightly build on Windows XP.

steps as described in the orig report, add a new vector column, edit a row, hit submit.

error is now:

Error:
c:\docume~1\hamish\locals~1\temp\tmpuelgf4: Permission denied

exiting & restarting grass doesn't help, nor does rebooting. (there's not zombie dbf.exe afterwards either)

same error if I try to add a new row or delete and old one.

... so it is generally impossible to edit using the attribute table manager in wingrass?! (bumping priority)

suspect the attribute manager is holding the temp file open..

Hamish

comment:4 by hamish, 12 years ago

Summary: Error in Attribute Table Managerwingrass: Error in Attribute Table Manager

in reply to:  3 comment:5 by hellik, 12 years ago

Replying to hamish:

Hi,

I can reproduce this in 6.5svn nightly build on Windows XP.

confirmed

... so it is generally impossible to edit using the attribute table manager in wingrass?! (bumping priority)

but map display -> query raster/vector layer -> click on an activated vector layer feature -> a little windows for updating attributes pops up

there you can edit successfully the attribute for the selected feature.

Helmut

comment:6 by hamish, 12 years ago

suggest to apply this patch to 6.4svn until a solution is found:

Index: gui/wxpython/gui_modules/dbm.py
===================================================================
--- gui/wxpython/gui_modules/dbm.py     (revision 50681)
+++ gui/wxpython/gui_modules/dbm.py     (working copy)
@@ -546,7 +546,11 @@
             self.editable = True
         else:
             self.editable = False
-        
+
+        # FIXME: editing is currently broken on wingrass (bug #1270)
+        if sys.platform == 'win32':
+            self.editable = False
+
         self.cmdLog     = log    # self.parent.goutput
         
         wx.Frame.__init__(self, parent, id, style=style)

Hamish

comment:7 by hamish, 12 years ago

patch applied in relbr64 in r50701. please test!

sys.platform for Cygwin = cygwin not win32, so it should still work from there.

Hamish

in reply to:  7 ; comment:8 by hellik, 12 years ago

Replying to hamish:

patch applied in relbr64 in r50701. please test!

tested with

osgeo4w-wingrass6.4.3svn r52715 osgeo4w-wingrass6.5svn r52495

error pop up still there.

but map display -> query raster/vector layer -> click on an activated vector layer feature -> a little windows for updating attributes pops up

there you can edit successfully the attribute for the selected feature without any problem.

Helmut

in reply to:  3 ; comment:9 by mlennert, 12 years ago

Replying to hamish:

Hi,

I can reproduce this in 6.5svn nightly build on Windows XP.

steps as described in the orig report, add a new vector column, edit a row, hit submit.

error is now:

Error:
c:\docume~1\hamish\locals~1\temp\tmpuelgf4: Permission denied

Working with a student yesterday, I saw a similar error trying to add a new column.

We were trying to digitize, so I thought it was because the table was open for the digitization, but even when we ended that, no way to add a new column.

Even calling v.db.addcol ended in an error. This all happened in a hurry, so I don't have the exact errors and cannot reproduce right now. Anyone can confirm that this also happens when you try to add a column ? This was with a grass6.4.3svn install (don't have the revision number).

Moritz

by hellik, 11 years ago

Attachment: edittable1.jpg added

by hellik, 11 years ago

Attachment: edittable2.jpg added

by hellik, 11 years ago

Attachment: edittable3.jpg added

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

Replying to mlennert:

Replying to hamish:

Hi,

I can reproduce this in 6.5svn nightly build on Windows XP.

steps as described in the orig report, add a new vector column, edit a row, hit submit.

error is now:

Error:
c:\docume~1\hamish\locals~1\temp\tmpuelgf4: Permission denied

Working with a student yesterday, I saw a similar error trying to add a new column.

still there by editing within the table manager, but not by querying the vector in the map display and changing a table value there.

Helmut

comment:11 by hamish, 11 years ago

Milestone: 6.4.26.4.4

Hi,

editing the table on WinGrass was greyed-out in the release branch by r50701, but that was lost in a bulk backport. The patch from comment:6 is now reapplied with r55016. It doesn't do anything to fix the problem, but makes it not-release critical since the user won't encounter breakage.

Leaving broken in the release branches in hope of a real fix one day; severity of ticket can be lowered after some testing.

thanks, Hamish

comment:12 by neteler, 11 years ago

Milestone: 6.4.46.4.3
Priority: criticalblocker

I guess that http://trac.osgeo.org/grass/changeset/55106 will now block any testing.

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

Replying to neteler:

I guess that http://trac.osgeo.org/grass/changeset/55106 will now block any testing.

yes.

Helmut

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

Replying to mlennert: [...]

Even calling v.db.addcol ended in an error.

v.db.addcol works here (latest osgeo4w-nightly build)

Helmut

in reply to:  8 comment:15 by hellik, 11 years ago

Replying to hellik: [...]

but map display -> query raster/vector layer -> click on an activated vector layer feature -> a little windows for updating attributes pops up

there you can edit successfully the attribute for the selected feature without any problem.

still working this way...

Helmut

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

Replying to neteler:

I guess that http://trac.osgeo.org/grass/changeset/55106 will now block any testing.

not really, just use devbr6 for testing, or open up dbmgr/manager.py in notepad++ or TextPad or whatever favourite text editor under Windows and comment-out the comment-out. The idea of r55106 is to have relbr64 ready for release now, and to continue the debugging in the dev branches. aka this doesn't look like it is being resolved in a hurry, and if we leave it blocking 6.4.3 then the release may take a long time.

is there a wxPy way to grey-out entire tabs? the manage tables and manage layers tabs don't give much feedback that they're disabled beyond "(read-only)" in the window title super-tab. the connection info may still be interesting to see, so fully blocking access to reading what's there wouldn't be the ideal way to do that.. ?

with the r55185-512 6.4.3svn nightly build on Windows7 64bit running the desktop icon wxGUI, I still get an error. Actually it froze with an endless spinning circle hourglass thing when I tried to add a column in the "show attribute data" manage tables tab, with the cursor over any of the open grass windows. I had to kill it by clicking on the "X" in the window, which took out all of grass except a zombie dbf.exe in the task manager + the empty cmd.exe dosbox.

moreover, using v.db.addcol from the main db -> vect db conns menu to add a column had this error:

v.db.addcol --verbose map=copyofbugs2@user1 columns=someint2 integer            
DBMI-DBF driver error:
ERROR: Unable to open database <C:/Program Files (x86)/GRASS GIS 6.4.3svn/msys/Users/Hamish/Documents/GIS DataBase/spearfish60/user1/dbf/>
ERROR: Cannot continue (problem adding column).

Somehow ProgramFiles....msys (GISBASE) is sneaking into the GISDBASE. ??

and again there's a dbf.exe zombie in the task manager, so when you try to quit the empty dos box lurking in the background won't exit without a ^C in it or to kill the dbf.exe in the task manager. No lockup this way though.

running v.db.connect from the same menu has everything looking as it should be:

v.db.connect -p map=copyofbugs2@user1                                           
layer <1> table <copyofbugs2> in database </Users/Hamish/Documents/GIS DataBase\spearfish60\user1\dbf\> through driver <dbf> with key <cat>
Vector map <copyofbugs2@user1> is connected by:

well, everything except the order of stderr and stdout, but I can forgive that.

On a hunch I tried dragging a file into the dbf/ folder directly, but it complied and didn't request that I do that as admin.

Hamish

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

Replying to hamish:

Replying to neteler:

I guess that http://trac.osgeo.org/grass/changeset/55106 will now block any testing.

not really, just use devbr6 for testing

... as per previous discussions (see ML archive) I doubt that devbr6 receives reasonable testing.

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

Replying to hamish:

suspect the attribute manager is holding the temp file open..

tested with

System Info                                                                     
GRASS version: 6.5.svn                                                          
GRASS SVN Revision: 55167                                                       
GIS Library Revision: 50936 (2012-02-25)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ4: Rel. 4.8.0, 6 March 2012                                                 
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W) 

yes, it seems so.

the temp file is in C:\Users\xxxxxxx\AppData\Local\Temp, the file's content is the sql update command, e.g.

UPDATE myhosp SET testc=2 WHERE cat=1;

any idea how to close the temp file?

Helmut

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

Replying to hamish: [...]

moreover, using v.db.addcol from the main db -> vect db conns menu to add a column had this error:

v.db.addcol --verbose map=copyofbugs2@user1 columns=someint2 integer            
DBMI-DBF driver error:
ERROR: Unable to open database <C:/Program Files (x86)/GRASS GIS 6.4.3svn/msys/Users/Hamish/Documents/GIS DataBase/spearfish60/user1/dbf/>
ERROR: Cannot continue (problem adding column).

tested with

GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 55185                                                       
GIS Library Revision: 50937 (2012-02-25)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ4: Rel. 4.8.0, 6 March 2012                                                 
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W) 
v.db.addcol map=myfires@user1 columns=someint2 integer                          
(Mon Feb 25 21:05:23 2013) Command finished (2 sec)   

Helmut

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

Replying to hamish:

moreover, using v.db.addcol from the main db -> vect db conns menu to add a column had this error:

v.db.addcol --verbose map=copyofbugs2@user1 columns=someint2 integer            
DBMI-DBF driver error:
ERROR: Unable to open database <C:/Program Files (x86)/GRASS GIS 6.4.3svn/msys/Users/Hamish/Documents/GIS DataBase/spearfish60/user1/dbf/>
ERROR: Cannot continue (problem adding column).

and now tested with the wingrass-standalone installer

GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 55185                                                       
GIS Library Revision: 50937 (2012-02-25)                                        
GDAL/OGR: GDAL 1.9.2, released 2012/10/08                                       
PROJ4: Rel. 4.8.0, 6 March 2012                                                 
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1      
v.db.addcol map=myhosp@user1 columns=someint3 integer                           
(Mon Feb 25 21:28:45 2013) Command finished (2 sec) 

Helmut

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

Replying to hamish: [...]

with the r55185-512 6.4.3svn nightly build on Windows7 64bit running the desktop icon wxGUI, I still get an error. Actually it froze with an endless spinning circle hourglass thing when I tried to add a column in the "show attribute data" manage tables tab, with the cursor over any of the open grass windows. I had to kill it by clicking on the "X" in the window, which took out all of grass except a zombie dbf.exe in the task manager + the empty cmd.exe dosbox.

tested with

GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 55185                                                       
GIS Library Revision: 50937 (2012-02-25)                                        
GDAL/OGR: GDAL 1.9.2, released 2012/10/08                                       
PROJ4: Rel. 4.8.0, 6 March 2012                                                 
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1  

can't reproduce this ...

Helmut

in reply to:  18 comment:22 by hellik, 11 years ago

Replying to hellik:

yes, it seems so.

the temp file is in C:\Users\xxxxxxx\AppData\Local\Temp, the file's content is the sql update command, e.g.

UPDATE myhosp SET testc=2 WHERE cat=1;

any idea how to close the temp file?

any ideas (from the wxgui-gurus)?

comment:23 by hamish, 11 years ago

note the dbf-zombie problem happened on WinGrass in the past when a module G_fatal_error()'d without explicitly closing the db driver first.

does touch GIS_ERROR_LOG work for WinGrass to keep a permanent log file of errors?

Hamish

in reply to:  18 ; comment:24 by annakrat, 11 years ago

Replying to hellik:

Replying to hamish:

suspect the attribute manager is holding the temp file open..

the temp file is in C:\Users\xxxxxxx\AppData\Local\Temp, the file's content is the sql update command, e.g.

UPDATE myhosp SET testc=2 WHERE cat=1;

any idea how to close the temp file?

According to the python doc, NamedTemporaryFile is automatically deleted after closing, that's why it's not closed in the code. I suggest using tempfile.mkstemp and use this advice.

in reply to:  24 ; comment:25 by annakrat, 11 years ago

Replying to annakrat:

According to the python doc, NamedTemporaryFile is automatically deleted after closing, that's why it's not closed in the code. I suggest using tempfile.mkstemp and use this advice.

Done in r55306 in release branch. I guess this problem affects all branches. Please test if it helped. I have no experience with temp files on Windows so maybe someone has better solution.

Anna

in reply to:  25 ; comment:26 by hellik, 11 years ago

Replying to annakrat:

Replying to annakrat:

According to the python doc, NamedTemporaryFile is automatically deleted after closing, that's why it's not closed in the code. I suggest using tempfile.mkstemp and use this advice.

Done in r55306 in release branch. I guess this problem affects all branches. Please test if it helped. I have no experience with temp files on Windows so maybe someone has better solution.

thanks trying to find a solution. is editing within atm still greyed out?

if yes, maybe this should also be changed that testing is available.

Helmut

in reply to:  26 ; comment:27 by annakrat, 11 years ago

Replying to hellik:

if yes, maybe this should also be changed that testing is available.

thanks, done in r55310. We must keep it in mind and reapply it if the fix fails.

in reply to:  27 comment:28 by hellik, 11 years ago

Replying to annakrat:

Replying to hellik:

if yes, maybe this should also be changed that testing is available.

thanks, done in r55310. We must keep it in mind and reapply it if the fix fails.

tested with

System Info                                                                     
GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 55310                                                       
GIS Library Revision: 50937 (2012-02-25)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ4: Rel. 4.8.0, 6 March 2012                                                 
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)   

in the atm:

(1) adding coloumns (integer, double, varchar, datum) => works

(2) editing a row in the table => works

closing ticket?

thanks

Helmut

comment:29 by annakrat, 11 years ago

There are some other places in digitizer (in vdigit/mapwindow.py) where the same problem should occur. For example adding new feature to a vector map (with attributes) should fail because of the same reason but it seems to work on Windows (please test this case too to be sure).

Anna

in reply to:  29 ; comment:30 by hellik, 11 years ago

Replying to annakrat:

There are some other places in digitizer (in vdigit/mapwindow.py) where the same problem should occur. For example adding new feature to a vector map (with attributes) should fail because of the same reason but it seems to work on Windows (please test this case too to be sure).

digitizing tested with

System Info                                                                     
GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 55310                                                       
GIS Library Revision: 50937 (2012-02-25)                                        
GDAL/OGR: 1.9.2                                                                 
PROJ4: Rel. 4.8.0, 6 March 2012                                                 
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)  

starting to digitize a new vector, defining new columns (integer, double, varchar, datum) works.

digitizing a new point, line or area, the window to enter attributes pops up, but no fields to enter attributes are displayed, on the top of the popup window there is the message "no attributes found".

furthermore, after finishing digitizing point, line and area, only the boundary of the area is displayed ( an extra build topology doesn't help), although there seems point, line and area inside the new vector.

v.info map=testv@user1                                                          
 +----------------------------------------------------------------------------+
 | Layer:           testv@user1                                               |
 | Mapset:          user1                                                     |
 | Location:        nc_spm_08                                                 |
 | Database:        C:\grassdata                                              |
 | Title:                                                                     |
 | Map scale:       1:1                                                       |
 | Map format:      native                                                    |
 | Name of creator: myricaria                                                 |
 | Organization:                                                              |
 | Source date:     Mon Mar 11 12:16:59 2013                                  |
 |----------------------------------------------------------------------------|
 |   Type of Map:  vector (level: 2)                                          |
 |                                                                            |
 |   Number of points:       2               Number of areas:      1          |
 |   Number of lines:        2               Number of islands:    1          |
 |   Number of boundaries:   1               Number of faces:      0          |
 |   Number of centroids:    1               Number of kernels:    0          |
 |                                                                            |
 |   Map is 3D:              No                                               |
 |   Number of dblinks:      1                                                |
 |                                                                            |
 |         Projection: Lambert Conformal Conic                                |
 |               N:   227647.21627409    S:   215332.44111349                 |
 |               E:   644033.19057816    W:   631689.50749465                 |
 |                                                                            |
 |   Digitization threshold: 0                                                |
 |   Comments:                                                                |
 |                                                                            |
 +----------------------------------------------------------------------------+

maybe that's worth for another ticket?

Helmut

in reply to:  30 comment:31 by hellik, 11 years ago

Replying to hellik: [...]

digitizing tested with

System Info                                                                     
GRASS version: 6.4.3svn                                                         

also the same in osgeo4w-wingrass6dev

starting to digitize a new vector, defining new columns (integer, double, varchar, datum) works.

digitizing a new point, line or area, the window to enter attributes pops up, but no fields to enter attributes are displayed, on the top of the popup window there is the message "no attributes found".

furthermore, after finishing digitizing point, line and area, only the boundary of the area is displayed ( an extra build topology doesn't help), although there seems point, line and area inside the new vector.

after a manually v.category input=testv@user1 option=add to the new digitized vector, point, line and area are displaye correctly.

Helmut

in reply to:  30 ; comment:32 by hellik, 11 years ago

Replying to hellik:

maybe that's worth for another ticket?

yes, see http://trac.osgeo.org/grass/ticket/1904

closing ticket?

in reply to:  32 comment:33 by annakrat, 11 years ago

Resolution: fixed
Status: newclosed

Replying to hellik:

closing ticket?

I applied the changes in all branches (r55343, r55344). Closing the ticket.

Note: See TracTickets for help on using tickets.