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.02k stars 2.92k forks source link

qgis_process-qgis.bat --json list (3.38) on Windows errors #57949

Open florisvdh opened 3 days ago

florisvdh commented 3 days ago

What is the bug or the crash?

Running C:/OSGeo4W/bin/qgis_process-qgis.bat --json list in the Windows CMD prompt results in a RuntimeError:

>C:/OSGeo4W/bin/qgis_process-qgis.bat --json list
Traceback (most recent call last):
  File "C:\OSGeo4W/apps/qgis/./python/plugins\processing\algs\gdal\GdalAlgorithmProvider.py", line 212, in supportedOutputRasterLayerExtensions
    return GdalUtils.getSupportedOutputRasterExtensions()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\OSGeo4W/apps/qgis/./python/plugins\processing\algs\gdal\GdalUtils.py", line 229, in getSupportedOutputRasterExtensions
    for exts in list(GdalUtils.getSupportedOutputRasters().values()):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\OSGeo4W/apps/qgis/./python/plugins\processing\algs\gdal\GdalUtils.py", line 211, in getSupportedOutputRasters
    GdalUtils.getSupportedRasters()
  File "C:\OSGeo4W/apps/qgis/./python/plugins\processing\algs\gdal\GdalUtils.py", line 185, in getSupportedRasters
    metadata = driver.GetMetadata()
               ^^^^^^^^^^^^^^^^^^^^
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\osgeo\gdal.py", line 3645, in GetMetadata
    return self.GetMetadata_Dict(domain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\OSGeo4W\apps\Python312\Lib\site-packages\osgeo\gdal.py", line 3621, in GetMetadata_Dict
    return _gdal.MajorObject_GetMetadata_Dict(self, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Function RegisterOGRMSSQLSpatial of C:\OSGeo4W\apps\gdal\lib\gdalplugins\ogr_MSSQLSpatial.dll did not register a driver MSSQLSpatial

This prevents R package qgisprocess from loading successfully.

Steps to reproduce the issue

  1. Install qgis with OSGeo4W installer
  2. Open a Windows CMD prompt
  3. Type C:/OSGeo4W/bin/qgis_process-qgis-dev.bat --json list
  4. Press Enter

Versions

>C:/OSGeo4W/bin/qgis_process-qgis.bat --version
QGIS 3.38.0-Grenoble 'Grenoble' (37aa6188bc)
QGIS code revision 37aa6188bc
Qt version 5.15.13
Python version 3.12.4
GDAL/OGR version 3.9.0
PROJ version 9.4.0
EPSG Registry database version v11.004 (2024-02-24)
GEOS version 3.12.2-CAPI-1.18.2
SQLite version 3.45.1
OS Windows 10 Version 2009

Supported QGIS version

New profile

Additional context

No response

agiudiceandrea commented 3 days ago

I cannot replicate the issue on Windows 10 using QGIS 3.38.0 installed by the OSGeo4W network installer osgeo4w-setup.exe. The command qgis_process-qgis.bat --json list works as expected either in the OSGeo4W Shell or in the Windows Command Prompt:

C:\OSGeo4W>qgis_process-qgis.bat --version
QGIS 3.38.0-Grenoble 'Grenoble' (37aa6188bc)
QGIS code revision 37aa6188bc
Qt version 5.15.13
Python version 3.12.4
GDAL/OGR version 3.9.0
PROJ version 9.4.0
EPSG Registry database version v11.004 (2024-02-24)
GEOS version 3.12.2-CAPI-1.18.2
SQLite version 3.45.1
OS Windows 10 Version 1903

C:\OSGeo4W>qgis_process-qgis.bat --json list
{
  "gdal_version": "3.9.0",
  "geos_version": "3.12.2-CAPI-1.18.2",
  "proj_version": "Rel. 9.4.0, March 1st, 2024",
  "providers": {
    "3d": {
      "algorithms": {
        "3d:tessellate": {
          "can_cancel": true,
          "deprecated": false,
          "group": "Vector geometry",
          "has_known_issues": false,
          "help_url": null,
          "name": "Tessellate",
          "requires_matching_crs": false,
          "short_description": null,
          "tags": [
            "3d",
            "triangle"
          ]
        }
      },
      "can_be_activated": true,
      "default_raster_file_extension": "tif",
      "default_vector_file_extension": "gpkg",
      "is_active": true,
      "long_name": "QGIS (3D)",
      "name": "QGIS (3D)",

[[ ***** ]]

  "python_version": "3.12.4",
  "qgis_code_revision": "37aa6188bc",
  "qgis_version": "3.38.0-Grenoble",
  "qt_version": "5.15.13"
}
C:\OSGeo4W>

Anyway it seems to me the issue you are experiencing in your system may be due to an OSGeo4W packaging issue and /or conflicting / mismatching / missing DLLs on your system. Probably @jef-n may be of help.

florisvdh commented 3 days ago

Thanks for testing. Then I'll try re-installing OSGeo4W QGIS in Windows tomorrow. Today I experienced issues with OSGeo4W bandwidth.