Skip to content

[Bug]: GetLegendGraphic returns HTTP 400 for layers configured as groupAsLayer #6752

@guenterw

Description

@guenterw

What is the bug? (in English)

When a layer group is configured as a single layer (groupAsLayer = true) in the Lizmap QGIS plugin, Lizmap Web Client sends a GetLegendGraphic WMS request for this layer. QGIS Server returns HTTP 400 because it cannot render a legend image for a grouped layer treated as a single layer.
The map renders correctly — only the legend request fails.

Steps to reproduce the issue

  1. In QGIS Desktop, create a layer group and enable "Group as layer" in the Lizmap plugin layer settings
  2. Leave legend_image_option unset (default) in the Lizmap plugin
  3. Publish the project to Lizmap Web Client
  4. Open the map in the browser and expand the layer legend

Expected behavior:
Lizmap should either skip the GetLegendGraphic request for groupAsLayer layers, or handle the 400 response gracefully without logging errors.
Actual behavior:
Lizmap sends GetLegendGraphic requests for these layers, QGIS Server returns HTTP 400, and errors are logged repeatedly in lizmap-admin.log:
HTTP code 400 on ... "REQUEST" = 'getlegendgraphic' ... "LAYER" = 'Gebaeude'
Workaround:
Set legend_image_option = disabled for all groupAsLayer layers in the Lizmap plugin. This prevents Lizmap from requesting the legend image.

Versions, safeguards, check summary etc

Versions :

  • Lizmap Web Client : 3.9.7 - commit 800219e 800219e95
  • Lizmap plugin : 5.0.0-beta.1
  • QGIS Desktop : 3.44.9
  • QGIS Server : 3.44.9
  • Py-QGIS-Server : 1.9.6
  • QGIS Server plugin atlasprint : 3.4.3
  • QGIS Server plugin lizmap_server : 2.14.1
  • QGIS Server plugin wfsOutputExtension : 1.8.3
List of Lizmap Web Client modules :
* Version Lizmap Web Client 3.8 needed
List of safeguards :
* Mode : normal
* Allow parent folder : yes
* Number of parent : 4 folder(s)
* Prevent other drive : no
* Prevent PG service : no
* Prevent PG Auth DB : no
* Force PG user&pass : no
* Prevent ECW : yes

Check Lizmap plugin

  • I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Operating system

Ubuntu 24.04

Browsers

Chrome

Browsers version

Version 147.0.7727.102

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions