[GRASS-dev] [GRASS GIS] #1692: calling a script within a script failing on Windows XP

#1692: calling a script within a script failing on Windows XP
---------------------------------------------------------------+------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.report, v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
---------------------------------------------------------------+------------
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?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1692&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
---------------------------------------------------------------+------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.report, v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
---------------------------------------------------------------+------------

Comment(by hamish):

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1692#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------
Changes (by hamish):

  * keywords: v.report, v.random.cover, wingrass, shell scripts =>
               v.random.cover, wingrass, shell scripts
  * priority: normal => critical

Comment:

Replying to [ticket:1692 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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1692#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by hellik):

Replying to [ticket:1692 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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1692#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:3 hellik]:
> Replying to [ticket:1692 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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1692#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------
Changes (by hamish):

  * priority: critical => blocker

Comment:

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1692#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by hamish):

> 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:6 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------
Changes (by martinl):

* cc: grass-dev@… (added)
  * owner: grass-dev@… => martinl
  * status: new => assigned

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by hellik):

Replying to [comment:7 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:9 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
  1. the module runs without problems

Later I will try another Windows machine...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by hellik):

Replying to [comment:10 martinl]:
>
> strange, tested with the same revision (both native and OSGeo4W)
>
> 1. `v.random.cover` reinstalled using wxGUI Extension Manager
> 1. 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
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:11 hellik]:

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

this should be fixed in r53480

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by hellik):

Replying to [comment:12 martinl]:
> Replying to [comment:11 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:10 martinl]:

> 1. `v.random.cover` reinstalled using wxGUI Extension Manager
> 1. 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:9 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
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by hellik):

Replying to [comment:15 martinl]:
> Replying to [comment:9 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:16 hellik]:

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

backported to `relbr64` in r53519

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:17 martinl]:

> backported to `relbr64` in r53519

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#1692: calling a script within a script failing on Windows XP
-----------------------------------------------------+----------------------
Reporter: hamish | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.3
Component: Shell Scripts | Version: 6.4.2
Keywords: v.random.cover, wingrass, shell scripts | Platform: MSWindows XP
      Cpu: x86-32 |
-----------------------------------------------------+----------------------

Comment(by martinl):

Replying to [comment:1 hamish]:
> oh yeah, one more minor problem: the help page in the extension .zip
file was localized to the server's LANG setting :slight_smile:

should be fixed in r53524

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1692#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>