Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1692 closed defect (fixed)

calling a script within a script failing on Windows XP

Reported by: hamish Owned by: martinl
Priority: blocker Milestone: 6.4.3
Component: Shell Scripts Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts Cc: grass-dev@…
CPU: x86-32 Platform: MSWindows XP

Description

Hi,

We're trying to run v.random.cover(.sh) from grass6 addons on Windows XP using the standard 6.4.2-2 prebuilt binaries. That script calls v.report(.sh), but v.report fails. "g.parser has encountered a problem and needs to close." and v.report exits with a non-zero error code.

turning debug to level 1 I see "ret = 1" from the G_spawn() command.

Running the exact same v.report command from the msys command line works fine.

I'd note v.report sends data to both stderr and stdout, but that's all after the g.parser call.

I seem to recall a problem long ago where in wingrass a script calling another script didn't work.

Running which v.report from the msys command prompt shows C:/Program Files/GRASS 6.4.2/scripts, not the wrapper .bat file in $GISBASE/bin/. maybe it doesn't like $0 != what gets run on the second g.parser pass??

I'm not sure what to try to debug next.

thanks, Hamish

ps- we were also unable to download any of the addons directly with the gui extension tool, although the zip files seem ok on the server. Is it working for anyone with those 6.4.2-2 binaries?

Change History (25)

comment:1 by hamish, 12 years ago

oh yeah, one more minor problem: the help page in the extension .zip file was localized to the server's LANG setting :)

in reply to:  description comment:2 by hamish, 12 years ago

Keywords: v.report removed
Priority: normalcritical

Replying to hamish:

I seem to recall a problem long ago where in wingrass a script calling another script didn't work.

sort of #580, but not exactly.

I can confirm that it's calling any shell script from within another script, not just v.report. bumping priority

e.g. adding this to a script triggers it too:

g.manual -m dummy

Hamish

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

Replying to hamish:

ps- we were also unable to download any of the addons directly with the gui extension tool, although the zip files seem ok on the server. Is it working for anyone with those 6.4.2-2 binaries?

confirmed, unable to download

Helmut

in reply to:  3 comment:4 by martinl, 12 years ago

Replying to hellik:

Replying to hamish:

ps- we were also unable to download any of the addons directly with the gui extension tool, although the zip files seem ok on the server. Is it working for anyone with those 6.4.2-2 binaries?

confirmed, unable to download

should be fixed now for 6.4.3svn. Martin

comment:5 by hamish, 12 years ago

Priority: criticalblocker

bumping to blocker. we need to fix this ASAP as it takes out a bunch of the scripts, including many of the v.db.* ones.

thanks, Hamish

comment:6 by hamish, 12 years ago

we need to fix this ASAP as it takes out a bunch of the scripts, including many of the v.db.* ones.

anyone have ideas?

thanks, Hamish

in reply to:  6 ; comment:7 by martinl, 12 years ago

Replying to hamish:

we need to fix this ASAP as it takes out a bunch of the scripts, including many of the v.db.* ones.

It seems to me that shell scripts don't work only if there are installed as AddOns. I think it's caused by the fact that shell script and bat script are placed in the same directory. It's result of your wish [1] which required extra hacking on g.extension side (it was the bad idea from POV) and moreover produced this blocker. It would be nice to simplify things and to complicated them when it's really not necessary. I hope that it was fixed in r53428 in G65. Please could you try the next snapshot, at least v.random.cover seems to work for me.

Martin

http://lists.osgeo.org/pipermail/grass-dev/2011-December/056938.html

comment:8 by martinl, 12 years ago

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

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

Replying to martinl: I hope that it was fixed in r53428 in G65. Please could you try the next snapshot, at least v.random.cover seems to work for me.

tested here

System Info                                                                     
GRASS version: 6.5.svn                                                          
GRASS SVN Revision: 53456                                                       
GIS Library Revision: 50936 (2012-02-25)                                        
GDAL/OGR: unknown                                                               
Python: 2.7.2                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1  
v.random.cover --verbose cover=fields@PERMANENT cat=63 output=random_NP_cover n=500 raster=landcover.30m@PERMANENT
C:\Users\XXXX\AppData\Roaming\GRASS6\addons/v.random.co
ver: line 158: v.report: command not found
ERROR: v.report failed

Helmut

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

Replying to hellik:

v.random.cover --verbose cover=fields@PERMANENT cat=63 output=random_NP_cover n=500 raster=landcover.30m@PERMANENT
C:\Users\XXXX\AppData\Roaming\GRASS6\addons/v.random.co
ver: line 158: v.report: command not found
ERROR: v.report failed

strange, tested with the same revision (both native and OSGeo4W)

  1. v.random.cover reinstalled using wxGUI Extension Manager
  2. the module runs without problems

Later I will try another Windows machine...

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

Replying to martinl:

strange, tested with the same revision (both native and OSGeo4W)

  1. v.random.cover reinstalled using wxGUI Extension Manager
  2. the module runs without problems

maybe unrelated but deinstalling via wxgui-g.extension-manager seems not to work, folder content after deinstalling

docs
modules.xml
v.random.cover
v.random.cover.bat

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

Replying to hellik:

maybe unrelated but deinstalling via wxgui-g.extension-manager seems not to work, folder content after deinstalling

this should be fixed in r53480

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

Replying to martinl:

Replying to hellik:

maybe unrelated but deinstalling via wxgui-g.extension-manager seems not to work, folder content after deinstalling

this should be fixed in r53480

confirmed

Helmut

in reply to:  10 comment:14 by martinl, 12 years ago

Replying to martinl:

  1. v.random.cover reinstalled using wxGUI Extension Manager
  2. the module runs without problems

unfortunately I can confirm this bug

v.random.cover cover=fields cat=63 output=cover n=500 raster=landcover.30m      
C:\Users\landa\AppData\Roaming\GRASS6\addons/v.random.cover:
line 158: v.report: command not found
ERROR: v.report failed

I am not sure how to fix it. Any idea? Martin

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

Replying to hellik:

please try next build (G65), I hope that r53512 will be better.

v.random.cover cover=fields cat=63 output=cover n=500 raster=landcover.30m --o  
WARNING: Vrstva 1 - žádná tabulka
WARNING: Vektorová mapa <cover> již existuje a bude přepsána.
Created <cover> with 500 random points
ERROR: Vector map <> not found in current mapset

in reply to:  15 ; comment:16 by hellik, 12 years ago

Replying to martinl:

Replying to hellik:

please try next build (G65), I hope that r53512 will be better.

System Info                                                                     
GRASS version: 6.5.svn                                                          
GRASS SVN Revision: 53516                                                       
GIS Library Revision: 50936 (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 (OSGeo4W)    
v.random.cover --verbose cover=fields@PERMANENT cat=63 output=random_NP_cover n=500 raster=landcover.30m@PERMANENT
WARNING: Layer 1 - no table
Created <random_NP_cover> with 500 random points
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected $end processing
''
in statement:
Error in db_open_select_cursor()
WARNING: 39 points outside current region were skipped
Raster values from <landcover.30m@PERMANENT> uploaded to
column <sampled>
(Sun Oct 21 10:12:23 2012) Command finished (6 sec)    

it seems the 'command not found'-issue is solved, more testing welcomed.

thanks Helmut

in reply to:  16 ; comment:17 by martinl, 12 years ago

Replying to hellik:

it seems the 'command not found'-issue is solved, more testing welcomed.

backported to relbr64 in r53519

in reply to:  17 ; comment:18 by martinl, 12 years ago

Replying to martinl:

backported to relbr64 in r53519

with the last winGRASS build, it seems to work. Testing welcomed...

in reply to:  1 ; comment:19 by martinl, 12 years ago

Replying to hamish:

oh yeah, one more minor problem: the help page in the extension .zip file was localized to the server's LANG setting :)

should be fixed in r53524

in reply to:  18 comment:20 by hellik, 12 years ago

Replying to martinl:

Replying to martinl:

backported to relbr64 in r53519

with the last winGRASS build, it seems to work. Testing welcomed...

confirmed, tested with

System Info                                                                     
GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 53519                                                       
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 (OSGeo4W)   

Helmut

in reply to:  19 comment:21 by hellik, 12 years ago

Replying to martinl:

Replying to hamish:

oh yeah, one more minor problem: the help page in the extension .zip file was localized to the server's LANG setting :)

should be fixed in r53524

there is no manual-tab in the v.random.cover-wx-gui at all, tested with

System Info                                                                     
GRASS version: 6.4.3svn                                                         
GRASS SVN Revision: 53519                                                       
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 (OSGeo4W)

Helmut

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

Replying to martinl:

Replying to martinl:

backported to relbr64 in r53519

with the last winGRASS build, it seems to work. Testing welcomed...

this ticket was about shell-scripts; maybe following it's worth for an extra ticket?:

there are some very nice python-based-script-addons for grass6.x, like the inter-dependent r.basin-, r.ipso-, r.wf-scripts (and others).

the pyhton addon-sscripts (r.basin.py, etc.) are stored in C:\Users\XXXX\AppData\Roaming\GRASS6\addons, whereas the related bat-files (r.basin.py.bat) are in C:\Users\XXXX\AppData\Roaming\GRASS6\addons\bin.

the content of the bat-files are e.g.

@"%GRASS_SH%" "%GISBASE%/scripts/r.basin.py" %*

in windows #!/usr/bin/env python isn't recognized, so "%GRASS_SH%" should be changed to "%GRASS_PYTHON%"

but changing this manually, r.basin calling r.ipso/r.wf isn't really working.

AFAIK python addons-scripts aren't at the moment officially supported in grass6.x (working out of the box in linux, but not in windows), although it would be nice if such peculiar scripts would also be available in windows.

Helmut

in reply to:  22 ; comment:23 by martinl, 12 years ago

Replying to hellik:

this ticket was about shell-scripts; maybe following it's worth for an extra ticket?:

yes, please fill extra tickets. The reported bug seems to be fixed, so I am closing this ticket. Please feel free to reopen if needed. For other issues please fill separated bug reports. The key point is that another blocker is fixed and we are closer to 6.4.3RC1.

comment:24 by martinl, 12 years ago

Resolution: fixed
Status: assignedclosed

in reply to:  23 comment:25 by hellik, 12 years ago

Replying to martinl:

Replying to hellik:

this ticket was about shell-scripts; maybe following it's worth for an extra ticket?:

yes, please fill extra tickets. The reported bug seems to be fixed, so I am closing this ticket.

done:

Ticket #1768 wingrass6.x: python addon scripts aren't working Ticket #1769 wingrass6.x: addons' manual tab not there in wxgui

Helmut

Note: See TracTickets for help on using tickets.