qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.5k stars 2.99k forks source link

QGIS stops requesting WMS layer #43071

Closed ItaloCunhaBueno closed 3 years ago

ItaloCunhaBueno commented 3 years ago

I have configured dozens of geoserver WMS layers, when added to QGIS, it reproject and display the layers just fine, checking the request log with F12 shows all requests as it should.

The issue: after some time, QGIS stops requesting the WMS layer and it disappears from the canvas. Clicking in 'Zoom to layer', adjusts canvas extent to layer extent correctly, but the layer does not show.

Here's a screenshot of the requests:

image

inside the yellow square are all the correct requests wich have returned image just fine, outside the square, each pair of lines was me removing and adding the layer to see if it reappears, with no success.

A normal successful request looks like this: image

the pair of requests after it stops working, looks like this: image image

The Geoserver log after everything stops working looks like this:

2021-05-04 07:50:55,597 INFO [geoserver.wms] - 
Request: getServiceInfo
2021-05-04 07:50:55,597 INFO [geoserver.wms] - 
Request: getCapabilities
    BaseUrl = http://10.0.0.18:8080/geoserver/
    Get = false
    Namespace = null
    RawKvp = {TILED=true, HINTS=quality, REQUEST=GetCapabilities, BGCOLOR=0x000000, VERSION=1.1.1, SERVICE=WMS, TRANSPARENT=true}
    Request = GetCapabilities
    RequestCharset = null
    RootLayerEnabled = null
    UpdateSequence = null
    Version = 1.1.1
2021-05-04 07:50:55,957 INFO [geoserver.wms] - 
Request: getServiceInfo
2021-05-04 07:50:55,957 INFO [geoserver.wms] - 
Request: getLegendGraphic
    BaseUrl = http://10.0.0.18:8080/geoserver/
    Env = {}
    Exceptions = SE_XML
    FeatureType = null
    Format = image/png
    Get = false
    Height = 20
    Kvp = {FORMAT=image/png, STYLE=, MAP_RESOLUTION=95, WIDTH=20, HEIGHT=20, REQUEST=GetLegendGraphic, SLD_VERSION=1.1.0, FORMAT_OPTIONS={DPI=95}, VERSION=1.1.1, SERVICE=WMS, SCALE=0.000000, LAYER=REURB_IMAGENS:OS_001_PalhocaPontal_22S_07102019, DPI=95, TRANSPARENT=true}
    Layers = [SimpleFeatureTypeImpl http://www.opengis.net/gml:GridCoverage identified extends Feature(geom:geom,grid:grid,params:params)]
    LegendOptions = {}
    Legends = [LegendRequest [layer=REURB_IMAGENS:OS_001_PalhocaPontal_22S_07102019, name=REURB_IMAGENS:OS_001_PalhocaPontal_22S_07102019 styleName=raster, title=OS_001_PalhocaPontal_22S, legendInfo=null]]
    Locale = null
    RawKvp = {FORMAT=image/png, STYLE=, MAP_RESOLUTION=95, WIDTH=20, HEIGHT=20, REQUEST=GetLegendGraphic, SLD_VERSION=1.1.0, FORMAT_OPTIONS=dpi:95, VERSION=1.1.1, SERVICE=WMS, SCALE=0.000000, LAYER=REURB_IMAGENS:OS_001_PalhocaPontal_22S_07102019, DPI=95, TRANSPARENT=true}
    Request = GetLegendGraphic
    RequestCharset = null
    Scale = 0.0
    Strict = true
    Transparent = true
    Version = 1.1.1
    Width = 20
    Wms = org.geoserver.wms.WMS@22e2fee6

The geoserver log before everything stops looks like a repeated bunch of these lines:

2021-05-04 07:34:20,593 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-2.147483647E9 : 2.147483647E9, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GeneralGridEnvelope[0..311, 0..316], PARAM_MT["Affine", 
  PARAMETER["num_row", 3], 
  PARAMETER["num_col", 3], 
  PARAMETER["elt_0_0", 0.998397435897436], 
  PARAMETER["elt_0_2", 733018.16469], 
  PARAMETER["elt_1_1", -0.6982649842271293], 
  PARAMETER["elt_1_2", 6932579.77884]]]
2021-05-04 07:34:20,593 WARN [lite.gridcoverage2d] - Could not reduce the grid geometry inside the valid area bounds: ReferencedEnvelope[-2.147483647E9 : 2.147483647E9, -85.0 : 85.0]
Grid geometry isGridGeometry2D[GeneralGridEnvelope[0..303, 0..308], PARAM_MT["Affine", 
  PARAMETER["num_row", 3], 
  PARAMETER["num_col", 3], 
  PARAMETER["elt_0_0", 1.0485197368421053], 
  PARAMETER["elt_0_2", 732747.26469], 
  PARAMETER["elt_1_1", -0.6995145631067962], 
  PARAMETER["elt_1_2", 6932579.77884]]]

For now, the only way to make QGIS show the layer correctly again is to shut QGIS down and open the project again. After some time the problem returns.

Other useful information:

QGIS network settings:

image

Geoserver WMS settings:

image

QGIS about info:

QGIS version
3.16.6-Hannover
QGIS code revision
bfd36fddc9
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
3.1.4
Running against GDAL/OGR
3.1.4
Compiled against GEOS
3.8.1-CAPI-1.13.3
Running against GEOS
3.8.1-CAPI-1.13.3
Compiled against SQLite
3.29.0
Running against SQLite
3.29.0
PostgreSQL Client Version
11.5
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
6.3.2
Running against PROJ
Rel. 6.3.2, May 1st, 2020
OS Version
Windows 10 (10.0)
Active python plugins
DataPlotly; 
LAStools; 
LoadQSS; 
new_layer_from_selection; 
nominatim_locator_filter; 
plugin_reloader; 
Qgis2threejs; 
qgis2web; 
quick_map_services; 
StreetView; 
db_manager; 
MetaSearch; 
processing

I dont think it's a Geoserver problem because it appears that QGIS simply stops requesting the layer (in opposite to show bad request errors).

Any help is welcome. Thanks.

gioman commented 3 years ago

Any help is welcome. Thanks.

@ItaloCunhaBueno does it happens only with this specific endpoint or it happens also with others?

ItaloCunhaBueno commented 3 years ago

I had two other people in our network complaining about this exact behaviour. So, yes, it happens in other clients accessing these WMS layers.

gioman commented 3 years ago

So, yes, it happens in other clients

@ItaloCunhaBueno my question is the other way around, it happens using other (server) endpoints? Does it happens outside your network?

ItaloCunhaBueno commented 3 years ago

Our network is not open so I cant tell if it happens to outside access, about other WMS services, I will search for a public WMS link and test it.

gioman commented 3 years ago

Our network is not open so I cant tell if it happens to outside access, about other WMS services, I will search for a public WMS link and test it.

@ItaloCunhaBueno you have to test also outside your network, using a public endpoint, to rule out that the issue is in your network.

ItaloCunhaBueno commented 3 years ago

Our network is not open so I cant tell if it happens to outside access, about other WMS services, I will search for a public WMS link and test it.

@ItaloCunhaBueno you have to test also outside your network, using a public endpoint, to rule out that the issue is in your network.

This I cant do, company rules. But would that explain why QGIS is not even trying to request the tiles?

gioman commented 3 years ago

This I cant do, company rules.

@ItaloCunhaBueno you can't test QGIS on a personal PC?

ItaloCunhaBueno commented 3 years ago

This I cant do, company rules.

@ItaloCunhaBueno you can't test QGIS on a personal PC?

Well, let me explain my setup:

I'm working from home (bnecause COVID) as every other employee in the company I work, we all use a VPN to connect to the company's network. The geoserver is located in the company's network, wich is not open to the public (hense the VPN) and I cant expose the geoserver services to the public.

My access to the internet does not pass through the VPN (I have internet access with vpn turned off), so I dont think it's something to do with the VPN.

I just tested several layers in a public WMS service and the problem persist, so (thankfully for me) it's not a problem in our geoserver configuration. Must be something in QGIS. And if it's a QGIS configuration problem, it's a default configuration problem because other employees (that arent tech savvy and problably didnt change QGIS configs) are having the same issue.

gioman commented 3 years ago

I just tested several layers in a public WMS service and the problem persist, so (thankfully for me) it's not a problem in our geoserver configuration. Must be something in QGIS. And if it's a QGIS configuration problem, it's a default configuration problem because other employees (that arent tech savvy and problably didnt change QGIS configs) are having the same issue.

@ItaloCunhaBueno are you all using the VPN? if yes you must remove the VPN from the equation. Just test a public endpoint without using the VPN.

ItaloCunhaBueno commented 3 years ago

I have now shutdown the VPN and QGIS and start all over. I added some public layers:

https://geoservicos.ibge.gov.br/geoserver/CGEO/ows?SERVICE=WMS&

Still, same behaviour, after some time QGIS stops requesting the layer and what was already there disappears (you dont even have to change zoom level, just panning the canvas makes the layer disappears).

So, VPN out of equasion, our geoserver config out of equasion too.

gioman commented 3 years ago

https://geoservicos.ibge.gov.br/geoserver/CGEO/ows?SERVICE=WMS&

Still, same behaviour, after some time QGIS stops requesting the layer and what was already there disappears (you dont even have to change zoom level, just panning the canvas makes the layer disappears).

@ItaloCunhaBueno I have added 10/12 layers from the above service, and in a few minutes of zooming and panning I have not lost the visibility of any layer. Can You post a screencast of what you observe? Thanks.

ItaloCunhaBueno commented 3 years ago

let qgis rest still for some minutes and see if it disappears when you move. I will try to record a video later today.

note: Im using the LTR version (3.16.6)

gioman commented 3 years ago

let qgis rest still for some minutes

@ItaloCunhaBueno vou almoçar, let's see what happens after.

ItaloCunhaBueno commented 3 years ago

Here's some recording of the problem:

https://drive.google.com/file/d/1yDGZU4gGQChL4kdGmfDUmC8Z4jfKsN7y/view?usp=sharing

Since the problem happened with VPN off and everything we discussed until now, I used my original setup (company's geoserver and VPN):

I added some vector layer just to force QGIS to reproject the WMS layer, then added the WMS, everything works fine (requests are made in the right panel), I then let QGIS rest still for 2 minutes, then pan the canvas. As you can see, the WMS layer disappears. To prove that QGIS think it's there, I 'zoom to layer' (for some reason record doesnt show right click menus), QGIS pan with success to the layer extent. The right panel does not show any request being made. I then remove the layer and add it again, and itial request is made but nothing else.

gioman commented 3 years ago

@ItaloCunhaBueno vou almoçar, let's see what happens after.

@ItaloCunhaBueno left qgis idle for over 1 hour, changed connection from cable to wireless > no issues. With the above public endpoint it works without issues. This do not seems to be a general QGIS issue. Have you tried with a new QGIS profile and see if it makes any difference?

ItaloCunhaBueno commented 3 years ago

Created a new profile, same result as in the video, after 2 minutes the layer disappears.

gioman commented 3 years ago

Created a new profile, same result as in the video, after 2 minutes the layer disappears.

@ItaloCunhaBueno ok, it was worth giving a try. Still not a general QGIS issue in my opinion (and after having tested several different endpoints and different versions of QGIS on different platforms).

ar-siddiqui commented 3 years ago

Have been using WMS layers a lot in QGIS of late, and this issue has never occurred to me.

ItaloCunhaBueno commented 3 years ago

It's probably a Geoserver problem but still, it doesn't explain why QGIS don't even log it trying to request new tiles... Is it possible that geoserver is "banning" the client process that is requesting, and when I restart QGIS I'm able to request againd because it's using a new process ID?

Update: for some reason it's not happening anymore.

github-actions[bot] commented 3 years ago

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

github-actions[bot] commented 3 years ago

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. Or, if you have any further questions, there are also further support channels that can help you.