rduivenvoorde / pdokservicesplugin

QGIS plugin for dutch PDOK services
GNU Affero General Public License v3.0
16 stars 23 forks source link

QGIS crashes when using the PDOK AHN WCS Tool #117

Open Jellest opened 5 months ago

Jellest commented 5 months ago

When trying to use the PDOK AHN WCS Tool, QGIS crashes quickly after pressing run.

As an input I use the points gpkg (in 28992). I have attached it the gpkg to this post.

points.zip

image

Any idea what might be going wrong?

I use QGIS 3.36 on Windows and PDOK Services plugin 5.0.1.

best, Jelle Stuurman

rduivenvoorde commented 5 months ago

Mmm, on Linux I cannot reproduce this.

But on Windows I can:

## Report Details

**Python Stack Trace**

Windows fatal exception: access violation

Current thread 0x00002150 (most recent call first):
  File "C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages\owslib\coverage\wcsBase.py", line 128 in readString
    return etree.fromstring(st)
  File "C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages\owslib\coverage\wcs201.py", line 66 in __init__
    self._capabilities = reader.readString(xml)
  File "C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages\owslib\coverage\wcsBase.py", line 49 in __new__
    obj.__init__(url, xml, cookies, auth=auth, headers=headers)
  File "C:\Users/richa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\pdokservicesplugin\processing_provider\processing_ahn.py", line 192 in processAlgorithm
    self.wcs = WebCoverageService_2_0_1(PDOKWCSTool.wcs_url, _xml_bytes, None)

Thread 0x000013e0 (most recent call first):
  File "C:\PROGRA~1/QGIS33~1.1/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 435 in executeAlgorithm
    dlg.exec()
  File "C:\PROGRA~1/QGIS33~1.1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232 in executeAlgorithm
    self.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)

**Stack Trace**

RtlpWaitOnCriticalSection :
RtlpEnterCriticalSectionContended :
RtlEnterCriticalSection :
xmlGetGlobalState :
_xmlDefaultSAXHandler :
xmlDefaultSAXHandlerInit :
xmlInitParserCtxt :
xmlNewParserCtxt :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyEval_EvalFrameDefault :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFunction_Vectorcall :
PyObject_LookupAttr :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFunction_Vectorcall :
PyObject_GC_Del :
PyVectorcall_Call :
PyObject_Call :
pdal::PointContainer::freeTemp :
pdal::Option::getName :
QgsProcessingAlgorithm::runPrepared :
QgsProcessingAlgRunnerTask::run :
pdal::Option::getName :
QgsTask::start :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

**QGIS Info**
QGIS Version: 3.36.1-Maidenhead
QGIS code revision: 3e589453
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.8.4
Running against GDAL: 3.8.4

**System Info**
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.22631
rduivenvoorde commented 5 months ago

Mmm, idem in 3.34


**Python Stack Trace**

Windows fatal exception: access violation

Current thread 0x00000838 (most recent call first):
  File "C:\PROGRA~1\QGIS33~1.3\apps\Python39\lib\site-packages\owslib\coverage\wcsBase.py", line 128 in readString
    return etree.fromstring(st)
  File "C:\PROGRA~1\QGIS33~1.3\apps\Python39\lib\site-packages\owslib\coverage\wcs201.py", line 66 in __init__
    self._capabilities = reader.readString(xml)
  File "C:\PROGRA~1\QGIS33~1.3\apps\Python39\lib\site-packages\owslib\coverage\wcsBase.py", line 49 in __new__
    obj.__init__(url, xml, cookies, auth=auth, headers=headers)
  File "C:\Users/richa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\pdokservicesplugin\processing_provider\processing_ahn.py", line 192 in processAlgorithm
    self.wcs = WebCoverageService_2_0_1(PDOKWCSTool.wcs_url, _xml_bytes, None)

Thread 0x00000330 (most recent call first):
  File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python/plugins\processing\ProcessingPlugin.py", line 432 in executeAlgorithm
    dlg.exec_()
  File "C:\PROGRA~1/QGIS33~1.3/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py", line 232 in executeAlgorithm
    self.executeWithGui.emit(alg.id(), self, self.in_place_mode, False)

**Stack Trace**

RtlpWaitOnCriticalSection :
RtlpEnterCriticalSectionContended :
RtlEnterCriticalSection :
xmlGetGlobalState :
_xmlDefaultSAXHandler :
xmlDefaultSAXHandlerInit :
xmlInitParserCtxt :
xmlNewParserCtxt :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyInit_etree :
PyEval_EvalFrameDefault :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFunction_Vectorcall :
PyObject_LookupAttr :
PyEval_EvalFrameDefault :
PyFunction_Vectorcall :
PyFunction_Vectorcall :
PyObject_GC_Del :
PyVectorcall_Call :
PyObject_Call :
pdal::PointContainer::freeTemp :
pdal::Option::getName :
QgsProcessingAlgorithm::runPrepared :
QgsProcessingAlgRunnerTask::run :
pdal::Option::getName :
QgsTask::start :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

**QGIS Info**
QGIS Version: 3.34.3-Prizren
QGIS code revision: 47373234ac
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.8.3
Running against GDAL: 3.8.3

**System Info**
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.22631
rduivenvoorde commented 5 months ago

@raymondnijssen @arbakker any idea?

rduivenvoorde commented 5 months ago

Nog even verder gekeken, hij klapt op:

https://github.com/rduivenvoorde/pdokservicesplugin/blob/develop/pdokservicesplugin/processing_provider/processing_ahn.py#L192

het aanmaken van 'WebCoverageService_2_0_1'

Maar als ik dat gewoon doe in de python console:

from owslib.coverage.wcs201 import WebCoverageService_2_0_1

wcs_url = "https://service.pdok.nl/rws/ahn/wcs/v1_0"
cap_url = f"{wcs_url}?request=GetCapabilities&service=WCS"

qgs_request = QgsBlockingNetworkRequest()
request = QNetworkRequest(QUrl(cap_url))
request.setRawHeader(b"User-Agent", b"qgis-pdokservices-plugin")
_ = qgs_request.get(
    request, True
)
reply = qgs_request.reply()
#print(str(reply.rawHeader(b"Content-Type"), encoding="utf-8"))
#print(bytes(reply.content()))
_xml_bytes = bytes(reply.content())
wcs = WebCoverageService_2_0_1(wcs_url, _xml_bytes, None)

gaat het wel goed???

En de allereerste keer dat ik het probeerde onder Windows, ging het WEL goed... daarna nooit meer