[GRASS-dev] [GRASS GIS] #1090: Access is denied - r.statistics

#1090: Access is denied - r.statistics
----------------------------------------+-----------------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied | Platform: MSWindows 7
      Cpu: x86-32 |
----------------------------------------+-----------------------------------
Related to ticket #1038 - Running the following:

r.statistics --verbose base=HUC@PERMANENT cover=ag@PERMANENT method=sum
output=huc_ag

results in the following error:

Access is denied.
ERROR: o_sum: running r.stats command

Same results when attempting to run an average as well. The fix mentioned
in the other ticket (change security settings to full control for USER)
didn't work.

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------
Changes (by hamish):

  * keywords: r.statistics access denied => r.statistics access denied,
               wingrass

Comment:

does r.stats run on its own? how about `g.tempfile pid=1234`?

note o_sum.c in gr65 calls r.stats via system() with:

{{{
#define STATS "r.stats"
#define RECLASS "r.reclass"
...
     sprintf(command, "%s -cn input=\"%s,%s\" fs=space > %s", STATS,
basemap,
             covermap, tempfile1);

     if (stat = system(command)) {
         unlink(tempfile1);
         G_fatal_error(_("%s: running %s command"), me, STATS);
     }
}}}

but before dealing with system(), a starting point might be:
{{{
Index: o_sum.c

--- o_sum.c (revision 42566)
+++ o_sum.c (working copy)
@@ -27,7 +27,7 @@
      tempfile1 = G_tempfile();
      tempfile2 = G_tempfile();

- sprintf(command, "%s -cn input=\"%s,%s\" fs=space > \"%s\"", STATS,
basemap,
+ sprintf(command, "%s -cn input=\"%s,%s\" fs=space output=\"%s\"",
STATS, basemap,
             covermap, tempfile1);

      if (stat = system(command)) {
}}}

Hamish

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by nkale):

Didn't really follow anything below "note 0_sum.c in gr65...", but as for
the commands you suggested:

r.stats ag@PERMANENT - runs fine, no errors, meaningful output
r.stats HUC@PERMANENT - runs fine, no errors, meaningful output
g.tempfile pid=1234 - no errors, output is:
{{{
C:/Users/Nat Kale/Documents/Grass_GIS
DataBase/Alberts_Landcover/PERMANENT/.tmp/1234.1
}}}
That is the correct location & mapset. Can't think of anything else to
try.

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by hamish):

could you give the grass 7 daily snapshot a try? it uses an improved
method to generate the stats and hopefully bypasses the problem.

system() replaced with G_system() in grass 6.5svn with r42570, daily
WinGrass snapshots for 6.5 are probably broken until bug #1089 gets fixed,
and it this wants testing there before backporting to 6.4.

cheers,
Hamish

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by nkale):

Replying to [comment:3 hamish]:
> could you give the grass 7 daily snapshot a try? it uses an improved
method to generate the stats and hopefully bypasses the problem.
>
> system() replaced with G_system() in grass 6.5svn with r42570, daily
WinGrass snapshots for 6.5 are probably broken until bug #1089 gets fixed,
and it this wants testing there before backporting to 6.4.
>
>
> cheers,
> Hamish

That worked. Ran with a slightly smaller dataset (didn't know if the
raster format was the same between 6 & 7, so I had to do some lengthy re-
importing), but I didn't get any errors, and the output map made sense.

On the other hand, in 7 I can no longer launch GRASS in MSYS mode, but
that's maybe a bug for another ticket.

Thanks,

Nat

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by hamish):

> Replying to [comment:3 hamish]:
> > could you give the grass 7 daily snapshot a try?
...
Replying to [comment:4 nkale]:
> That worked.

ok, good. in a few days once grass6.5 daily snapshots are fixed I might
ask you to try that.

> Ran with a slightly smaller dataset (didn't know if the raster
> format was the same between 6 & 7, so I had to do some lengthy
> re-importing),

for now it is the same, but that is likely to change in the future.

> but I didn't get any errors, and the output map made sense.
>
> On the other hand, in 7 I can no longer launch GRASS in MSYS mode,
> but that's maybe a bug for another ticket.

Known problem, being worked on.

Hamish

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by hellik):

Replying to [comment:5 hamish]:
> > Replying to [comment:3 hamish]:
> > > could you give the grass 7 daily snapshot a try?
> ...
> Replying to [comment:4 nkale]:
> > That worked.
>
> ok, good. in a few days once grass6.5 daily snapshots are fixed I might
ask you to try that.

I've tried following grass65-nightly build:
WinGRASS-6.5.SVN-r42351-1-Setup.exe

{{{
(Sat Jun 19 13:28:32 2010)
r.statistics base=elevation_int@user1 cover=geology_30m@PERMANENT
method=sum output=elev_int_geol
(Sat Jun 19 13:28:33 2010) Befehl ausgeführt (1 sec)
}}}

r.statistics seems to work, no error message.

Helmut

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by hellik):

Replying to [comment:6 hellik]:
> Replying to [comment:5 hamish]:
> > > Replying to [comment:3 hamish]:
> > > > could you give the grass 7 daily snapshot a try?
> > ...
> > Replying to [comment:4 nkale]:
> > > That worked.
> >
> > ok, good. in a few days once grass6.5 daily snapshots are fixed I
might ask you to try that.
>
> I've tried following grass65-nightly build:
> WinGRASS-6.5.SVN-r42351-1-Setup.exe
>

the nightly build is from 2010/06/19, maybe revision-number is not
correct?
tested on WinVista32

Helmut

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

#1090: Access is denied - r.statistics
--------------------------------------------------+-------------------------
Reporter: nkale | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Keywords: r.statistics access denied, wingrass | Platform: MSWindows 7
      Cpu: x86-32 |
--------------------------------------------------+-------------------------

Comment(by martinl):

Replying to [comment:7 hellik]:
> > I've tried following grass65-nightly build:
> > WinGRASS-6.5.SVN-r42351-1-Setup.exe
> >
>
> the nightly build is from 2010/06/19, maybe revision-number is not
correct?
> tested on WinVista32

right, grass65 is broken for several days. Fixed, going to recompile all
branches. Martin

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

#1090: Access is denied - r.statistics
--------------------------+-------------------------------------------------
  Reporter: nkale | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Raster | Version: 6.4.0 RCs
Resolution: fixed | Keywords: r.statistics access denied, wingrass
  Platform: MSWindows 7 | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: new => closed
  * resolution: => fixed

Comment:

tested in 6.4 on wingrass, still fixed.

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