I succeed in connecting to the following WMS in QGIS (2.14.15 LTR): https://secure.erlangen.de/arcgiser/services/Luftbild2016/MapServer/WMSServer?SERVICE=WMS&REQUEST=GetCapabilities

... with the following configuration:

enter image description here

The image is displayed, but in the Layer tree there is an error message Returned legend image is flawed:

enter image description here

It is not flawed, because legend image url http://secure.erlangen.de/arcgiser/services/Luftbild2016/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=0 seems to work:

enter image description here

Since error messages like this might be confusing to simple minded people, what might be wrong here? Do I miss any settings?


This seems only to occur in case of some configuration issues in our ArcGIS for Server / ArcGIS WebAdaptor environment and is not a general issue in QGIS not displaying WMS legends, as indicated by the screenshot below (WMS is http://sg.geodatenzentrum.de/wms_topplus_web_open)

enter image description here

  • Same issue using QGIS 2.18.16 and the Geogratis Canvec WMS: maps.geogratis.gc.ca/wms/… Using All Transport layer as an example, the Legend URL indicated under metadata for the layer works fine in a browser, but generates "image is flawed error" in Layers Panel: maps.geogratis.gc.ca/wms/…
    – Lance
    Commented Feb 21, 2018 at 19:23

1 Answer 1


This is more of an extended comment than a complete answer.

I note you have to tell QGIS to ignore the GetMap / GetFeatureInfo URIs advertised in the GetCapabilities response. The service is HTTPS, the advertised URIs are all HTTP. I note too in QGIS that if you don't ignore these URI's you don't get a map... and the request goes to https:///.../index.html?, so that's the same error you are getting with the GetLegendGraphic, there is no graphic at that location, and there is no way of telling QGIS to ignore the advertised GetLegendGraphic location.

When you go to the advertised location for the GetLegendGraphic in a browser, the service redirects you to a graphic at an HTTPS address.


This redirection fails in QGIS.

I'm not sure if this is a bug with QGIS, or a bug with the redirection in the service, or both. Certainly it seems an error for the GetCapabilities response to advertise URLs that are incorrect.

  • I think the redirection is somehow configured in the ArcGIS Web Adaptor and the ArcGIS Server wich generates the WMS does not take this redirections into account. So its more an issue of the ArcGIS Server/WebAdaptor configuration, than of QGIS not displaying WMS legend images (cp. update in my question). Commented Oct 20, 2017 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.