3liz / py-qgis-server

QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
https://docs.3liz.org/py-qgis-server
Mozilla Public License 2.0
68 stars 16 forks source link

Cannot use WFS3 ogc api #70

Closed lucamanga closed 10 months ago

lucamanga commented 11 months ago

Hello, I'm trying to use WFS3 OGC API as stated in documentation. I'm using the 3liz/qgis-map-server:3.22 image. When I invoke this url: http://localhost:10000/wfs3/collections.html?MAP=gis_wfs_test.qgs it returns this error: Internal Server Error

where can I see the log for this error? Docker container logs doesn't show anything.

dmarteau commented 11 months ago

How do you run the server ? Logs are printed to stderr so if you run in background with docker you may need to run docker logs -f <mycontaner>

lucamanga commented 10 months ago

I'm now running with latest LTR, 3.28. Here's my docker-compose.yml:

version: '3.3'
services:
  qgis-server:
    image: 3liz/qgis-map-server:3.28
    environment:
      QGSRV_LOGGING_LEVEL: "DEBUG"

When I am trying the url:

http://localhost:10000/wfs3/collections.html?MAP=gis_wfs_test.qgs

It returns me an error, and the docker log states:

2023-10-23 10:54:02,124 DEBUG   [50]    Qgis: Server: MAP:gis_wfs_test.map
2023-10-23 10:54:02,124 DEBUG   [50]    Qgis: Server: TEST_NEW_PARAM:ParamsFilter
2023-10-23 10:54:02,125 DEBUG   [50]    Qgis: Server: Trying URL path: '/wfs3' for '/'
2023-10-23 10:54:02,125 DEBUG   [50]    Qgis: Server: Trying URL path: '/wfs3' for '/wfs3'
2023-10-23 10:54:02,125 DEBUG   [50]    Qgis: Server: API OGC WFS3 (Draft) accepts the URL path '/wfs3' 
2023-10-23 10:54:02,125 DEBUG   [50]    Qgis: Server: Checking API path / for /collections/(?<collectionId>[^/]+)/items(\.geojson|\.json|\.html|/)?$ 
2023-10-23 10:54:02,125 DEBUG   [50]    Qgis: Server: Checking API path / for /collections/(?<collectionId>[^/]+)/items/(?<featureId>[^/]+?)(\.json|\.geojson|\.html|/)?$ 
2023-10-23 10:54:02,125 DEBUG   [50]    Qgis: Server: Checking API path / for /collections(\.json|\.html|/)?$ 
2023-10-23 10:54:02,126 DEBUG   [50]    Qgis: Server: Checking API path / for /collections/(?<collectionId>[^/]+?)(\.json|\.html|/)?$ 
2023-10-23 10:54:02,126 DEBUG   [50]    Qgis: Server: Checking API path / for /conformance 
2023-10-23 10:54:02,126 DEBUG   [50]    Qgis: Server: Checking API path / for /static/(?<staticFilePath>.*)$ 
2023-10-23 10:54:02,126 DEBUG   [50]    Qgis: Server: Checking API path / for /api 
2023-10-23 10:54:02,126 DEBUG   [50]    Qgis: Server: Checking API path / for (.html|.json)?$ 
2023-10-23 10:54:02,126 DEBUG   [50]    Qgis: Server: API OGC WFS3 (Draft): found handler getLandingPage
2023-10-23 10:54:02,127 WARNING [50]    Qgis: : SUCCESS - ParamsFilter.responseComplete
2023-10-23 10:54:02,127 ERROR   [50]    Internal Server Error (500)
2023-10-23 10:54:02,127 ERROR   [50]    Qgis: Server: 'NoneType' object has no attribute 'upper'
lucamanga commented 10 months ago

As you can see, there's the error: Qgis: Server: 'NoneType' object has no attribute 'upper'

Gustry commented 10 months ago

Can you share your full docker-compose file ? And the command ?

The upper looks like a missing parameter in the URL which was not expected.

lucamanga commented 10 months ago

What is the command are you referring?

Here is the docker-compose.yml:

version: '3.3'
services:
  qgis-server:
    image: 3liz/qgis-map-server:3.28
    environment:
      QGSRV_LOGGING_LEVEL: "DEBUG"
      QGSRV_SERVER_WORKERS: 4
      SERVER_PLUGINPATH: /srv/projects/plugins
      QGSRV_SERVER_PLUGINPATH: /srv/projects/plugins
      QGSRV_CACHE_ROOTDIR: /srv/projects
      QGIS_OPTIONS_PATH: /srv/projects
      QGIS_AUTH_DB_DIR_PATH: /srv/projects
      QGIS_SERVER_PARALLEL_RENDERING: 1
      QGSRV_TRUST_LAYER_METADATA: 1
      QGSRV_DISABLE_GETPRINT: 1
      QGIS_SERVER_FORCE_READONLY_LAYERS: 'yes'
      GDAL_HTTP_UNSAFESSL: 'YES'
      QGSRV_SERVER_MEMORY_HIGH_WATER_MARK: 0.3
      QGSRV_SERVER_TIMEOUT: 60
    ports:
      - 10000:8080
lucamanga commented 10 months ago

It seems that OGC API WFS3 is not enabled by default. How can I enable it?

lucamanga commented 10 months ago

I.e., I tested with:

http://SERVER:10000/wfs3/conformance/

ad it still release a 500 error.

dmarteau commented 10 months ago

The log in https://github.com/3liz/py-qgis-server/issues/70#issuecomment-1774937058 show that WFS3 api is ok and the path is resolved correctly.

On our side, all test with WFS3 are OK, and the landingpage (json and html) display correctly.

Note that the error is the log above is prefixed with Qgis: Server: ... this means that this error is a internal qgis error that use QgsMessageLog interface: this indicates that the error occurs during the Qgis processing of the request.

Amha, this errors occurs in a plugin: disable all plugins and try the /wfs3/ request again.

lucamanga commented 10 months ago

Thank you! It was a plugin problem.