[GRASS-dev] [GRASS GIS] #2712: WARNING: Unable to rename null file

#2712: WARNING: Unable to rename null file
-----------------------------+---------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Keywords: | CPU: x86-32
Platform: MSWindows Vista |
-----------------------------+---------------------------------
running some raster modules, I get following warning message:

e.g.

{{{
(Sun Jul 19 15:14:36 2015)
r.slope.aspect --verbose elevation=elevation@PERMANENT slope=myslope
Prozent fertig...
Höhen-Ergebnisse für Mapset <user1> in <nc_spm_08_grass7>.
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/4828.1' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/myslope/null': Permission
denied
minimale berechnete Hangneigung 0.0000, maximale berechnete Hangneigung
38.6894.
Neigungs-Rasterkarte <myslope> komplett.
(Sun Jul 19 15:14:38 2015) Befehl ausgeführt (1 Sek)
}}}

{{{
(Sun Jul 19 15:15:24 2015)
r.param.scale --verbose input=elevation@PERMANENT output=mymorpho
method=feature
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/3040.1' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/mymorpho/null': Permission
denied
(Sun Jul 19 15:15:26 2015) Befehl ausgeführt (1 Sek)
}}}

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

#2712: WARNING: Unable to rename null file
----------------------+---------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
----------------------+---------------------------------
Changes (by hellik):

* keywords: => raster

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

#2712: WARNING: Unable to rename null file
----------------------+---------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
----------------------+---------------------------------

Comment (by hellik):

Replying to [ticket:2712 hellik]:
> running some raster modules, I get following warning message:

e.g. also in r.watershed

{{{
(Sun Jul 19 15:20:04 2015)
r.watershed --verbose elevation=elevation@PERMANENT threshold=100
accumulation=myaccum tci=mytopoi drainage=mydraindir basin=myabasin
ABSCHNITT 1a (von 5): Initiiere den Speicher.
ABSCHNITT 1b (of 5): Ermittle den Fluß aus der Karte heraus.
SECTION 2: A* Search.
SECTION 3a: Accumulating Surface Flow with MFD.
SECTION 3b: Adjusting drainage directions.
ABSCHNITT 4: Bestimme Wassereinzugsgebiet.
ABSCHNITT 5: Schließe Karten.
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/4520.1' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/myabasin/null': Permission
denied
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/4520.3' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/myaccum/null': Permission
denied
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/4520.5' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/mytopoi/null': Permission
denied
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/4520.7' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/mydraindir/null': Permission
denied
(Sun Jul 19 15:20:14 2015) Befehl ausgeführt (9 Sek)
}}}

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

#2712: WARNING: Unable to rename null file
----------------------+---------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
----------------------+---------------------------------

Comment (by hellik):

Replying to [comment:2 hellik]:
> Replying to [ticket:2712 hellik]:
> > running some raster modules, I get following warning message:
>
> e.g. also in r.watershed

see also https://trac.osgeo.org/grass/ticket/2689

in contrary to #2689, the null file isn't there.

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

#2712: WARNING: Unable to rename null file
----------------------+---------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
----------------------+---------------------------------
Changes (by neteler):

* priority: normal => blocker

Comment:

Replying to [ticket:2712 hellik]:
> running some raster modules, I get following warning message:

The file in question is

lib/raster/close.c

{{{
...
WARNING: Unable to rename null file
'J:\gisdata/nc_spm_08_grass7/user1/.tmp/unknown/4828.1' to
'J:\gisdata/nc_spm_08_grass7/user1/cell_misc/myslope/null': Permission
denied
}}}

The directory separators are likely wrong. Since it is in libraster it
affects several modules.

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

#2712: WARNING: Unable to rename null file
----------------------+---------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
----------------------+---------------------------------

Comment (by hellik):

Replying to [comment:3 hellik]:
> Replying to [comment:2 hellik]:
> > Replying to [ticket:2712 hellik]:
> > > running some raster modules, I get following warning message:
> >
> > e.g. also in r.watershed
>
> see also https://trac.osgeo.org/grass/ticket/2689

and also here: https://trac.osgeo.org/grass/ticket/2434

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

#2712: WARNING: Unable to rename null file
----------------------+---------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.0.1
Component: Default | Version: svn-releasebranch70
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
----------------------+---------------------------------

Comment (by hellik):

Replying to [comment:2 hellik]:
> Replying to [ticket:2712 hellik]:
> > running some raster modules, I get following warning message:
>
> e.g. also in r.watershed

tested with the elevation data of the nc sample data set

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone:
Component: LibRaster | Version: svn-trunk
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------
Changes (by annakrat):

* version: svn-releasebranch70 => svn-trunk
* component: Default => LibRaster
* milestone: 7.0.1 =>

Comment:

Replying to [comment:6 hellik]:
> Replying to [comment:2 hellik]:
> > Replying to [ticket:2712 hellik]:
> > > running some raster modules, I get following warning message:
> >
> > e.g. also in r.watershed
>
> tested with the elevation data of the nc sample data set

Problem seems to be only in trunk.

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------
Changes (by martinl):

* milestone: => 7.1.0

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by martinl):

The bug seems to be related to the recent changes in null data support
done in trunk.

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by glynn):

Replying to [comment:9 martinl]:
> The bug seems to be related to the recent changes in null data support
done in trunk.

I think that it's because r65323 deferred closing the null file (because a
compressed null file needs to have the row pointers written out), meaning
that the file is still open at the time of the rename() call. This is
valid on Unix but not on Windows (although the MSDN documentation neglects
to mention this in the description of the EACCESS error for rename()).

So, the order needs to be:

* Write out row pointers
* Close file
* Rename file

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by glynn):

Replying to [comment:10 glynn]:

> So, the order needs to be:
>
> * Write out row pointers
> * Close file
> * Rename file

Try r65775.

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by hellik):

Replying to [comment:11 glynn]:
> Replying to [comment:10 glynn]:
>
> > So, the order needs to be:
> >
> > * Write out row pointers
> > * Close file
> > * Rename file
>
> Try r65775.

tested with

{{{
GRASS Version: 7.1.svn
GRASS SVN revision: 65777
Build date: 2015-07-25
Build platform: i686-pc-mingw32
GDAL: 1.11.2
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-Vista-6.0.6002-SP2 (OSGeo4W)
}}}

{{{
r.slope.aspect --verbose elevation=elevation@PERMANENT slope=myslope
Prozent fertig...
Höhen-Ergebnisse für Mapset <user1> in <nc_spm_08_grass7>.
minimale berechnete Hangneigung 0.0000, maximale berechnete Hangneigung
38.6894.
Neigungs-Rasterkarte <myslope> komplett.
(Sun Jul 26 10:12:35 2015) Befehl ausgeführt (2 Sek)
}}}

{{{
r.param.scale --verbose input=elevation@PERMANENT output=myfeature
method=feature
(Sun Jul 26 10:14:01 2015) Befehl ausgeführt (1 Sek)
}}}

{{{
r.watershed --verbose elevation=elevation@PERMANENT threshold=100
accumulation=myaccum
ABSCHNITT 1a (von 5): Initiiere den Speicher.
ABSCHNITT 1b (of 5): Ermittle den Fluß aus der Karte heraus.
SECTION 2: A* Search.
SECTION 3a: Accumulating Surface Flow with MFD.
SECTION 3b: Adjusting drainage directions.
ABSCHNITT 4: Bestimme Wassereinzugsgebiet.
ABSCHNITT 5: Schließe Karten.
(Sun Jul 26 10:15:31 2015) Befehl ausgeführt (7 Sek)
}}}

seems to be fixed now, closing ticket

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: fixed | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------
Changes (by hellik):

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

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: fixed | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by hellik):

Replying to [comment:11 glynn]:
> Replying to [comment:10 glynn]:
>
> > So, the order needs to be:
> >
> > * Write out row pointers
> > * Close file
> > * Rename file
>
> Try r65775.

#2689 seems to be solved, #2434 is still valid

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: fixed | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by glynn):

Replying to [comment:14 hellik]:

> #2434 is still valid

#2434 was opened long before any of these changes were made.

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

#2712: WARNING: Unable to rename null file
------------------------+-----------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.1.0
Component: LibRaster | Version: svn-trunk
Resolution: fixed | Keywords: raster
       CPU: x86-32 | Platform: MSWindows Vista
------------------------+-----------------------------

Comment (by hellik):

Replying to [comment:15 glynn]:
> Replying to [comment:14 hellik]:
>
> > #2434 is still valid
>
> #2434 was opened long before any of these changes were made.

right; but there seems to be similar problems with raster:

see e.g. 2434#comment:14

{{{
[...]
WARNING: Unable to rename null file
'J:\gisdata\nc_spm_08_grass7\user1\.tmp/unknown\5848.1' to
'J:\gisdata\nc_spm_08_grass7\user1\cell_misc\elev_lid792_rast\null':
Permission denied
WARNING: Unable to rename cell file
'J:\gisdata\nc_spm_08_grass7\user1\.tmp/unknown\5848.0' to
'J:\gisdata\nc_spm_08_grass7\user1\fcell\elev_lid792_rast': Permission
denied
WARNING: Unable to write quant rules: raster map <elev_lid792_rast> is
integer
}}}

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