Bug report #12234

QGIS freezes when adding a legend in composer and project has a WMS layer with a missing graphic legend

Added by Gerhard Spieles over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:20421

Description

Loading WMS Layer (contains sub-Layers, see atttached jpg --->Nr. 5) p.e. from
http://www.gis-schweich.de/service_schweich_on/mod_wms/wms_getmap.php?mapfile=07235015x%x%

works fine in QGIS 2.6.1.

Loading the same layer Nr. 5 in QGIS-dev, it freeze, when you use a project from older version.
Loading the same layer in a new project created in QGIS-dev, the layer loads, but the legend grafik reports a fault.
Loading one of the sub-layers (e.g. Nr. 6 or any other), works fine.

wms1.jpg (326 KB) Gerhard Spieles, 2015-02-21 02:58 PM

testwms.zip (58.3 KB) Gerhard Spieles, 2015-02-25 11:07 AM

testwms.tar.gz (60.9 KB) Giovanni Manghi, 2015-02-26 12:20 AM

wmslegend_freeze.qgs (7.07 KB) Giovanni Manghi, 2015-05-22 03:04 AM

wms_without_legend_grafic.jpg (141 KB) Gerhard Spieles, 2015-06-15 09:02 AM

wms_12234.zip (17.5 KB) Gerhard Spieles, 2015-07-08 10:07 AM

Associated revisions

Revision 837c7ee8
Added by Nyall Dawson over 9 years ago

[composer] Don't redraw map if layers change and map is set to cached

Previously map was being redrawn every time a layer was added or
removed from the registry, which blocked the ui until the map
redraw is complete.

Now the map will only be redrawn as a result of layer changes
if it's set to Render mode.

Possible fix for 12234 and 12125. (refs #12234, #12125)

Revision 06732f13
Added by Nyall Dawson over 9 years ago

Possible fix for slow loading projects when the project contains
print compositions and there is network issues with connections
to installed printers. (workaround QTBUG-3033)

(refs #12234)

Revision 05a8491b
Added by Nyall Dawson over 9 years ago

Possible fix for slow loading projects when the project contains
print compositions and there is network issues with connections
to installed printers. (workaround QTBUG-3033)

(refs #12234)

cherry-picked from 06732f137357ff1f3c2a55a3253037d8df85596b

Revision 4f29c58e
Added by Nyall Dawson over 9 years ago

Avoid hang on WMS legends with missing graphics (fix #12234)

Revision 56613cc9
Added by Nyall Dawson over 9 years ago

Avoid hang on WMS legends with missing graphics (fix #12234)

Cherry-picked from 4f29c58e4357fad505c82459e97c17449bf4891b

Revision dff089d7
Added by Nyall Dawson over 9 years ago

Avoid hang on WMS legends with missing graphics (fix #12234)

(Cherry-picked from 4f29c58e4357fad505c82459e97c17449bf4891b)

Revision d371fd63
Added by Nyall Dawson over 9 years ago

[composer] Don't redraw map if layers change and map is set to cached

Previously map was being redrawn every time a layer was added or
removed from the registry, which blocked the ui until the map
redraw is complete.

Now the map will only be redrawn as a result of layer changes
if it's set to Render mode.

Possible fix for 12234 and 12125. (refs #12234, #12125)

(cherry-picked from 837c7ee8d3ecacfce45ac0a299eb20c8a76f983b)

History

#1 Updated by Jürgen Fischer over 9 years ago

Loading the WMS layer from a 2.6.1 project or directly in master works fine for me. The legend GetLegendGraphics request is:

http://www.gis-schweich.de/service_schweich_on/mod_wms/wms_getmap.php?mapfile=07235015&&SERVICE=WMS&VERSION=1.1.1&SLD_VERSION=1.1.0&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=BPLAN.07235015&STYLE=

The server response is:

<ServiceExceptionReport version="1.1.1"><ServiceException code="LayerNotDefined">
msWMSGetLegendGraphic(): WMS server error. Invalid layer given in the LAYER parameter.
</ServiceException></ServiceExceptionReport>

although the request looks good to me and corresponds to the layer name used in the working GetMap request:

http://www.gis-schweich.de/service_schweich_on/mod_wms/wms_getmap.php?mapfile=07235015&&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=6.83373245779695715,49.8168997392995152,6.86000248737879126,49.82823769654798696&SRS=EPSG:4326&WIDTH=1513&HEIGHT=653&LAYERS=BPLAN.07235015&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE

#2 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Open to Feedback

#3 Updated by Gerhard Spieles over 9 years ago

Attached a sample testproject. It was created by QGIS <2.6. and last saved in QGIS 2.9

The wms url for the WMS-conection in QGIS s:
http://www.gis-schweich.de/service_schweich_on/mod_wms/wms_getmap.php?mapfile=07235004x%x%

When you try to add a wms layer, QGIS stop working.

#4 Updated by Giovanni Manghi over 9 years ago

  • OS version deleted (7)
  • Affected QGIS version changed from 2.6.0 to 2.8.0
  • File testwms.tar.gz added
  • Operating System deleted (win)

after a few tests I would say that this ticket seems somehow related to #12170 and #12125.

  • open the attached project with a text editor and remove manually all the composer section <comopser>...</composer>
  • save it and open it in qgis... no deleays/freezes
  • add a WMS layer from the above service: no issues. Save, close and reopen, no delays.
  • add an empty layout to the project, save, close and reopen... huge delays (with an empty composer the delay is little but appreciable, with complex layouts then the delay can be very big).

see the attcahed project "test_wms2" and "test_wms3", without and with a composer layout.

#5 Updated by Gerhard Spieles over 9 years ago

Confirm, that the composer entries make the trouble.
But it is not a delay! When you open projects created with release 2.6 or < which contains composer items with Release 2.8 or in dev, QGIS stop working, no menue is available and you can only close QGIS click on the "cross bar" in the program window.

We are a little city civil-administration and have many projects with complex composer items. It would not be a good idea to remove all composer items.

Ist there another solution possible?

#6 Updated by Giovanni Manghi over 9 years ago

Gerhard Spieles wrote:

Confirm, that the composer entries make the trouble.
But it is not a delay! When you open projects created with release 2.6 or < which contains composer items with Release 2.8 or in dev, QGIS stop working, no menue is available and you can only close QGIS click on the "cross bar" in the program window.

We are a little city civil-administration and have many projects with complex composer items. It would not be a good idea to remove all composer items.

Ist there another solution possible?

I added as watcher of this ticket the developer that made the bulk of the work on the composer lately, maybe he could try to figure where is the real source of the issue.

#7 Updated by Gerhard Spieles over 9 years ago

Is the status "Feedback" ok?

#8 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Open

Gerhard Spieles wrote:

Is the status "Feedback" ok?

the title should be changed to better described the issue, that has nothing to do with WMS layers. What do you suggest?

#9 Updated by Gerhard Spieles over 9 years ago

I agree.
Proposal for new title:
QGIS freeze, using a project from previous version with composer entries when adding a wms layer

#10 Updated by Giovanni Manghi over 9 years ago

  • Priority changed from Normal to High
  • Subject changed from WMS Layer handling seems to work not proper in qgis dev to QGIS freeze, using a project from previous version with composer entries when adding a wms layer
  • Category changed from Web Services clients/WMS to Project Loading/Saving
  • Crashes QGIS or corrupts data changed from No to Yes

#11 Updated by Nyall Dawson over 9 years ago

  • Status changed from Open to Feedback

Please test with latest dev version and let me know if this is now fixed

#12 Updated by Giovanni Manghi over 9 years ago

Nyall Dawson wrote:

Please test with latest dev version and let me know if this is now fixed

Hi Nyall,

it just updated to the latest master (nightly build repo for Ubuntu) and I can't see any difference.The attached project with composers take a lot of time to load (so much you can call it a freeze), without composers it opens very quickly.

Then the issues seems the same as above:

  • in the project without composer (I removed them manually from the .qgs file) add a layer from (example)

http://www.gis-schweich.de/service_schweich_on/mod_wms/wms_getmap.php?mapfile=07235015

and then save/load the project is quick

  • add a composer (first issue: before the composer window show it takes several seconds)
  • save the empty layout
  • close project and load it again... delay... in this case it does not freeze, but as soon you add things to the layout the delay become bigger and bigger.

#13 Updated by Gerhard Spieles over 9 years ago

Tested it on windows with QGIS-dev, rev. 733b7c9.
Problem exist further

#14 Updated by Gerhard Spieles over 9 years ago

Hi Giovanni,
is it possible to change the status after the feedback?
Thanks

#15 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Open

If we can say that this is a regression (as it seems to me) then we can tag this as blocker. At the moment I lack the time to do the proper tests with different qgis versions on different platforms.

#16 Updated by Giovanni Manghi over 9 years ago

  • Target version changed from Version 2.8 to Version 2.8.2

#17 Updated by Giovanni Manghi over 9 years ago

  • Target version changed from Version 2.8.2 to Version 2.10

#18 Updated by Nyall Dawson over 9 years ago

  • Status changed from Open to Feedback

Please test and give feedback with latest master (06732f137357ff1f3c2a55a3253037d8df85596b)

#19 Updated by Gerhard Spieles over 9 years ago

Tested QGIS-Codeversion 06732f1 without success

#20 Updated by Gerhard Spieles over 9 years ago

Testing the problem in detail show, that following elements in the composers make the stress:

- Expression in a Textfield with the content: Druckdatum: [% format_date( $now , 'dd.MM.yyyy')%]
- Legenditems

When you delete these elements in the composers, save the project again and then you can add wms-layers fine.

#21 Updated by Giovanni Manghi over 9 years ago

  • Affected QGIS version changed from 2.8.0 to master
  • Status changed from Feedback to Open
  • Target version changed from Version 2.10 to Future Release - High Priority

#22 Updated by Gerhard Spieles over 9 years ago

Hi Giovanni,
when you add a legend in composer again, the poblem is back again.
The issue schould be solved in 2.10.

Please change the target version to 2.10
Thanks

Gerhard

#23 Updated by Gerhard Spieles over 9 years ago

Tested the problem with a newly creates Project in 2.90, rev. e8587c3.
If a legend elemet is added to any composer in the newly created Project, then QGis freeze, when you add a WMS-Layer.

I think, this is a blocker for for the 2.10 Release and also the 2.8LTR.

#24 Updated by Giovanni Manghi over 9 years ago

Gerhard Spieles wrote:

Tested the problem with a newly creates Project in 2.90, rev. e8587c3.
If a legend elemet is added to any composer in the newly created Project, then QGis freeze, when you add a WMS-Layer.

I think, this is a blocker for for the 2.10 Release and also the 2.8LTR.

it happens only if the legend of WMS layer is not loaded (probably for a Server misconfiguration).

Attached a sample project, just add the legend int he composer and qgis freezes.

#25 Updated by Gerhard Spieles over 9 years ago

Confirm, that the missing legend-grafic in wms seems to lead to freeze QGIS, when a legend-element is in a composer.
Unfortunately, WebMapServices are verry often not porber configured in legend-grafic.

QGIS should handle this, without freezing!
Until Version 2.6, this was no problem an QGIS handled it.

Is it possible to solve this problem in 2.10?
Verry much Thanks

Gerhard

#26 Updated by Gerhard Spieles over 9 years ago

Hello Giovanni,
should we change
-the title to
"QGIs freeze, adding a wms layer with missing legend grafic and any composer contains a legend"
-categorie to
"Map Composer/Printing"
-Target Version to
Version 2.10

Thanks

#27 Updated by Giovanni Manghi over 9 years ago

  • Subject changed from QGIS freeze, using a project from previous version with composer entries when adding a wms layer to QGIS freezes when adding a legend in composer and project has a WMS layer with a missing graphic legend
  • Category changed from Project Loading/Saving to Map Composer/Printing

#28 Updated by Gerhard Spieles over 9 years ago

Hello Giovanni,

we corrected our wms serverconfiguration (see #24)and can now use it with QGIS.

Unfortunately, many WMS-Services have the legend-grafic fault. We have no influence to the sercices.
Samples are in the attached "wms_without_legend_grafic.jpg".

Is it possible to solve the problem in 2.10?

Thanks

Gerhard

#29 Updated by Giovanni Manghi over 9 years ago

Gerhard Spieles wrote:

Hello Giovanni,

we corrected our wms serverconfiguration (see #24)and can now use it with QGIS.

Unfortunately, many WMS-Services have the legend-grafic fault. We have no influence to the sercices.
Samples are in the attached "wms_without_legend_grafic.jpg".

Is it possible to solve the problem in 2.10?

Thanks

Gerhard

Hi,
I listed this ticket among the ones I suggest to urgently solve in the bug fixing effort pre-release.

Please also raise this matter on the developers list.

#30 Updated by Gerhard Spieles over 9 years ago

Hi,
how can i do this and bring the issue it to the developpers list?

Thanks
Gerhard

#31 Updated by Nyall Dawson over 9 years ago

  • Status changed from Open to Feedback

Can someone please post an example of one of these misconfigured WMS servers? I can't replicate this using any of the attached projects.

#32 Updated by Gerhard Spieles over 9 years ago

Here a wms url

http://geodaten.service24.rlp.de/cgi-bin/RLP_VBORISFREE2014.cgi?

A test project is attached.
When you add a legend item to the composer, then QGIS freeze.

#33 Updated by Nyall Dawson over 9 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF