qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

qgis_process algorithms create temporary file 'srs6.db' without cleaning #51474

Closed florisvdh closed 1 year ago

florisvdh commented 1 year ago

What is the bug or the crash?

In the dev version, apparently all algorithms used with qgis_process result in a temporary file srs6.db which is not removed after finishing.

The algorithms that have been tested and where this occurs (none were found where it doesn't happen):

native:buffer
native:createconstantrasterlayer
native:simplifygeometries
native:splitvectorlayer
native:extractbyattribute
native:reprojectlayer
native:mergevectorlayers
native:printlayouttopdf
qgis:relief

Steps to reproduce the issue

$ mkdir ~/test
$ cd ~/test
$ pwd
/home/floris/test
$ 
$ find /tmp -type f -name srs* 2> /dev/null
$
$ myJSON=$(</dev/stdin)
{
  "area_units": "m2",
  "distance_units": "meters",
  "ellipsoid": "EPSG:7030",
  "inputs": {
    "FIELD": "NAME",
    "INPUT": "/home/floris/git_repositories2/QGIS/build-216fdff9/output/data/resources/data/world_map.gpkg|layername=countries",
    "OPERATOR": 0,
    "OUTPUT": "ogr:dbname='/home/floris/test/output_country.gpkg' table=\"output\" (geom)",
    "VALUE": "Norway"
  }
}
$
$ echo "$myJSON" | ~/git_repositories2/QGIS/build-216fdff9/output/bin/qgis_process run native:extractbyattribute - 1> /dev/null
$ 
$ ls ~/test
output_country.gpkg
$ 
$ find /tmp -type f -mmin -1 2> /dev/null
/tmp/srs6.db

Versions

$ ~/git_repositories2/QGIS/build-216fdff9/output/bin/qgis_process --version
QGIS 3.29.0-Master 'Master' (216fdff9)
QGIS code revision 216fdff9
Qt version 5.15.3
Python version 3.10.6
GDAL/OGR version 3.6.2
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.37.2
OS Linux Mint 21.1

Supported QGIS version

New profile

Additional context

This behaviour did not occur in QGIS 3.28.2, in which related issue #50623 had been solved. Also, file srs6.db is new compared to the temp files found in that issue.

florisvdh commented 1 year ago

It may be related to interaction with the more recent GDAL 3.6.2 version which this dev version is compiled against, since I didn't see it happen in GH Action checks with the ubuntu-nightly release, that use GDAL 3.4.1 from the regular Ubuntu repo.

The QGIS 3.28.2 installation that I locally tested (ubuntugis package) and which didn't yield the srs6.db files, uses the same GDAL 3.6.2 on my machine but is compiled against 3.6.1:

$ qgis_process --version
QGIS 3.28.2-Firenze 'Firenze' (b47e00ba60)
QGIS code revision b47e00ba60
Qt version 5.15.3
Python version 3.10.6
Compiled against GDAL/OGR 3.6.1
Running against GDAL/OGR 3.6.2
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.37.2
OS Linux Mint 21.1
florisvdh commented 1 year ago

The issue is gone in QGIS 3.30.0, so closing here!