camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
64 stars 46 forks source link

QGIS 3: Online resource console error #2968

Closed llienher closed 7 years ago

llienher commented 7 years ago

The issue appears in GMF in the browser console. The project I was working on is Agrola where I was doing a QGIS update to 3.0 with gmf 2.1.4. We know that QGIS 3.0 is still under development as the official release is to be planned for september 2017.

The console error mentionned my "test" layer is not existing in the capabilities despite that this layer was correctly displayed in geomapfish panel and map.

I voluntarily removed some length from the capabilities log as it was just what the qgis server sent. To be looked as well is that the WMS request capabilities is called in 1.1.1 version instead of 1.3.0.

The console error is the following:

desktop.js:1400 The themes contain some errors:
The layer 'test' (test) is not defined in WMS capabilities from 'source for image/jpeg'
WARNING! an error occured while trying to read the mapfile and recover the themes.
URL: http://qgis/mapserv_proxy?VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WMS
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM 'http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd'>
<WMT_MS_Capabilities version="1.1.1">
 <Service>
   ...
 </Service>
 <Capability>
   ...
 </Capability>
</WMT_MS_Capabilities>

(anonymous) @ desktop.js:1400
(anonymous) @ desktop.js:143
$eval @ desktop.js:157
$digest @ desktop.js:154
$apply @ desktop.js:158
l @ desktop.js:109
D @ desktop.js:114
w.onload @ desktop.js:115

The error in the WSGI docker image logs:

 2017-06-01 13:43:14,392 ERROR [c2cgeoportal.views.entry][Dummy-3] WARNING! an error occured while trying to read the mapfile and recover the themes.
 URL: http://qgis/mapserv_proxy?VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WMS
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE WMT_MS_Capabilities SYSTEM 'http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd'>
 <WMT_MS_Capabilities version="1.1.1">
  <Service>
   ...
 </Service>
 <Capability>
   ...
 </Capability>
 </WMT_MS_Capabilities>
 Traceback (most recent call last):
   File "/usr/local/python/lib/python2.7/site-packages/c2cgeoportal/views/entry.py", line 263, in _wms_getcap_cached
     wms = WebMapService(None, xml=content)
   File "/usr/local/python/lib/python2.7/site-packages/owslib/wms.py", line 46, in WebMapService
     timeout=timeout, headers=headers)
   File "/usr/local/python/lib/python2.7/site-packages/owslib/map/wms111.py", line 92, in __init__
     self._buildMetadata(parse_remote_metadata)
   File "/usr/local/python/lib/python2.7/site-packages/owslib/map/wms111.py", line 102, in _buildMetadata
     self.provider = ServiceProvider(serviceelem)
   File "/usr/local/python/lib/python2.7/site-packages/owslib/map/wms111.py", line 376, in __init__
     self.url=self._root.find('OnlineResource').attrib.get('{http://www.w3.org/1999/xlink}href', '')
 AttributeError: 'NoneType' object has no attribute 'attrib'
sbrunner commented 7 years ago

Should be fixed with: https://github.com/qgis/QGIS/pull/4700 ...

llienher commented 7 years ago

I confirm the qgis update fixed my issue. I close this.

sbrunner commented 7 years ago

Thanks :-)