Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
florisvdh opened this issue Jul 1, 2024 · 3 comments
Open
1 of 2 tasks

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

florisvdh opened this issue Jul 1, 2024 · 3 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Downstream Downstream packaging issues etc. Packaging Windows Related to Windows operating system

Comments

@florisvdh
Copy link
Contributor

florisvdh commented Jul 1, 2024

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.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

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@florisvdh florisvdh added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 1, 2024
@florisvdh florisvdh changed the title qgis_process-qgis.bat (3.38) on Windows does not launch qgis_process-qgis.bat --json list (3.38) on Windows errors Jul 1, 2024
@agiudiceandrea
Copy link
Member

agiudiceandrea commented Jul 1, 2024

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.

@agiudiceandrea agiudiceandrea added Processing Relating to QGIS Processing framework or individual Processing algorithms Windows Related to Windows operating system labels Jul 1, 2024
@florisvdh
Copy link
Contributor Author

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

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label Jul 1, 2024
@florisvdh
Copy link
Contributor Author

Apologies for the delay. I couldn't fix it by tweaking OSGeo4W installer settings.

But I did find a manual solution, which may somehow point at a packaging problem.

In this OSGeo4W setup, there is a directory C:\OSGeo4W\apps\gdal\lib\gdalplugins that had following contents (why / how: I don't know).

 Directory of C:\OSGeo4W\apps\gdal\lib\gdalplugins

06/07/2024  08:52    <DIR>          .
06/07/2024  08:52    <DIR>          ..
23/06/2024  00:04             2.765 drivers.ini
09/01/2024  10:43           380.928 ogr_MSSQLSpatial.dll

A quickfix according to https://gis.stackexchange.com/a/394484, provided that one doesn't bother having MSSQLSpatial support, is to just delete the dll. Which I did, and consequently qgis_process-qgis.bat --json list worked as expected.

So indeed this was a machine specific situation.

It's fine for me if you consider this issue solved.

I leave it open in case this would still lead to finding a solution in OSGeo4W packaging that prevents this situation from happening.

@agiudiceandrea agiudiceandrea added Packaging Downstream Downstream packaging issues etc. and removed Feedback Waiting on the submitter for answers Processing Relating to QGIS Processing framework or individual Processing algorithms labels Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Downstream Downstream packaging issues etc. Packaging Windows Related to Windows operating system
Projects
None yet
Development

No branches or pull requests

2 participants