Closed agstephens closed 2 years ago
I have the same problem now: First I had a general issue with getting the BBOX parameter work, but this was to my own mistake. But now I have the same problem with the CRS not being serializable.
It happens very randomly: I can submit a job with the following input:
<wps:Input>
<ows:Identifier>area_of_interest</ows:Identifier>
<wps:Data>
<wps:BoundingBoxData crs="epsg:4326" dimensions="2">
<ows:LowerCorner>-90.0 -45.0</ows:LowerCorner>
<ows:UpperCorner>90.0 45.0</ows:UpperCorner>
</wps:BoundingBoxData>
</wps:Data>
</wps:Input>
It gets accepted and runs. After a few more executions I suddenly get this answer:
<?xml version="1.0" encoding="UTF-8"?>
<!-- PyWPS 4.5.1 -->
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" version="1.0.0">
<ows:Exception exceptionCode="NoApplicableCode" locator="" >
<ows:ExceptionText>No applicable error code, please check error log.</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
and the log file tells me:
2022-03-21 08:57:37,137] [ERROR] file=/usr/local/lib/python3.8/dist-packages/pywps/exceptions.py line=48 module=exceptions function=__init__ Exception: code: 500, description: No applicable error code, please check error log., locator:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pywps/app/Service.py", line 314, in call
raise e
File "/usr/local/lib/python3.8/dist-packages/pywps/app/Service.py", line 304, in call
response = self.execute(
File "/usr/local/lib/python3.8/dist-packages/pywps/app/Service.py", line 82, in execute
return self._parse_and_execute(process, wps_request, uuid)
File "/usr/local/lib/python3.8/dist-packages/pywps/app/Service.py", line 145, in _parse_and_execute
wps_response = process.execute(wps_request, uuid)
File "/usr/local/lib/python3.8/dist-packages/pywps/app/Process.py", line 149, in execute
wps_response = self._execute_process(self.async_, wps_request, wps_response)
File "/usr/local/lib/python3.8/dist-packages/pywps/app/Process.py", line 215, in _execute_process
dblog.store_process(self.uuid, wps_request)
File "/usr/local/lib/python3.8/dist-packages/pywps/dblog.py", line 192, in store_process
request_json = request.json
File "/usr/local/lib/python3.8/dist-packages/pywps/app/WPSRequest.py", line 461, in json
return json.dumps(obj, allow_nan=False, cls=ExtendedJSONEncoder)
File "/usr/lib/python3.8/json/__init__.py", line 234, in dumps
return cls(
File "/usr/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.8/dist-packages/pywps/app/WPSRequest.py", line 442, in default
encoded_object = json.JSONEncoder.default(self, obj)
File "/usr/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
To make it execute again or at least not get an error is to remove the CRS from the BBox input like this:
<wps:Input>
<ows:Identifier>area_of_interest</ows:Identifier>
<wps:Data>
<wps:BoundingBoxData dimensions="2">
<ows:LowerCorner>-90.0 -45.0</ows:LowerCorner>
<ows:UpperCorner>90.0 45.0</ows:UpperCorner>
</wps:BoundingBoxData>
</wps:Data>
</wps:Input>
I am calling the service asynchronously and have pyWPS integrated into a flask app that is run via gunicorn and exposed via nginx. The same as described in the Howtos for production system. I suspect it has to do if jobs are immediately executed by a worker or put into a local queue. It is all very sporadic and my feeling is that increasing the number of workers helped, but the whole pyWPS interface degrades over a time
Could it be a problem with the BBox input serialisation if it needs to be scheduled via a queue?
My further investigations
The object that is not JSON encodable is urn:ogc:def:crs:EPSG::4326
.
It fails at: /pywps/app/WPSRequest.py", line 444, in default
fixed by PR #650
Description
When sending a Bounding Box input type to the WPS server, it fails with an error:
This seems to happen when trying to submit jobs to a Slurm cluster - so serialisation is required before submitting to Slurm, and it cannot do that.
Environment
Steps to Reproduce
I am connecting from a GUI that posts the request, not sure how to reproduce.
Additional Information
I was able to fix if I make these two hacks to
owslib
andpywps
:I don't really know what these hacked lines do but it gets things working.
I'm happy to provide more info and test when I have more time.