[Pywps-dev] Raster Output error

Lorenzo Bottaccioli lorenzo.bottaccioli at gmail.com
Mon Jun 20 08:29:13 PDT 2016


Hi Jachym,

As I wrote in the previous mail I have changed

response.outputs['response'].file* = 'done' *in
response.outputs['response'].data = 'done'  .

But I stil get an error:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your
request.  Either the server is overloaded or there is an error in the
application.</p>


Which is the HTTPD error.log file? The pywps.log file is always empty and
the log level is set to DEBUG
Best,

Lorenzo

2016-06-18 23:39 GMT+02:00 Jachym Cepicky <jachym.cepicky at gmail.com>:

> hi,
>
> as jonas was saying: response.outputs['response'].data = 'done' should
> work better
>
> Lorenzo:  do you get anything in the HTTPD server error.log file?
>
> pá 10. 6. 2016 v 15:30 odesílatel Lorenzo Bottaccioli <
> lorenzo.bottaccioli at gmail.com> napsal:
>
>> Hi,
>>
>> I'have changed from file to data in response.outputs['response'].data =
>> 'done', but bow I still get an error in the response.
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
>> <title>500 Internal Server Error</title>
>> <h1>Internal Server Error</h1>
>> <p>The server encountered an internal error and was unable to complete
>> your request.  Either the server is overloaded or there is an error in the
>> application.</p>
>>
>>
>> The GET request is written like this:
>>
>>
>> http://130.192.5.114:8080/wps?service=wps&version=1.0.0&request=execute&Identifier=rast_try&datainputs=raster=@xlink:href=file:///home/lorenzo/aspect_1ifGBx0
>>
>> In the terminal I dont get any error report.
>>
>> Tnx,
>>
>> Lorenzo
>>
>> 2016-06-10 10:20 GMT+02:00 Jonas Eberle <jonas.eberle at gmx.de>:
>>
>>> The error "no such file or directory" comes from the following line:
>>> response.outputs['response'].file = 'done'
>>>
>>> As response is a LiteralOutput I guess it is not correct to use the file
>>> attribute, better use the data attribute:
>>> response.outputs['response'].data = 'done'
>>>
>>> Cheers,
>>> Jonas
>>>
>>> ----- Am 10. Jun 2016 um 10:13 schrieb Jachym Cepicky <
>>> jachym.cepicky at gmail.com>:
>>>
>>> Hi Lorenzo,
>>> There are two bugs as I understand. The first one:
>>>
>>> IOError: [Errno 2] No such file or directory:
>>> '/tmp/pywps/pypws_process_lQqN_6/done'
>>>
>>> do you have /tmp/pywps/ directory in you system (and is it writeable?)
>>>
>>> The second bug is about attempt to write log to database
>>>
>>> nice report btw, with the process I believe, we can fix it (both) once
>>> we find out what the problem could be
>>>
>>> Jachym
>>>
>>>
>>> st 8. 6. 2016 v 11:50 odesílatel Lorenzo Bottaccioli <
>>> lorenzo.bottaccioli at gmail.com> napsal:
>>>
>>>> Hi List,
>>>>
>>>> I'm trying to run a process that recives a GeoTIFF as input and
>>>> response a GeoTIFF as output. But I'm having an error. The process is this:
>>>> from pywps import Process, ComplexInput, ComplexOutput,
>>>> get_format,LiteralOutput, Format
>>>>
>>>>
>>>> class Raster(Process):
>>>>
>>>>     def __init__(self):
>>>>         inputs = [ComplexInput('raster','Raster
>>>> input',[Format('GEOTIFF')])]
>>>>
>>>>         outputs = [ComplexOutput('raster_out', 'Raster
>>>> output',[Format('GEOJSON')]),LiteralOutput('response', 'Output response',
>>>> data_type='string')]
>>>>         super(Raster, self).__init__(
>>>>             self._handler,
>>>>             identifier='rast_try',
>>>>             title='Raster try',
>>>>             inputs=inputs,
>>>>             outputs=outputs,
>>>>             store_supported=True,
>>>>             status_supported=True
>>>>         )
>>>>
>>>>     def _handler(self, request, response):
>>>>
>>>>         from osgeo import gdal
>>>>         app=request.inputs['raster'][0].file
>>>>         inds = gdal.Open(app)
>>>>         outdriver = gdal.GetDriverByName('GTiff')
>>>>         outds = outdriver.CreateCopy('output.tiff', inds)
>>>>         outds.FlushCache()
>>>>         response.outputs['raster_out'].output_format = Format('GEOTIFF')
>>>>         response.outputs['raster_out'].file = 'output.tiff'
>>>>         response.outputs['response'].file = 'done'
>>>>         return response
>>>>
>>>> The error that I recive is this one:
>>>>
>>>> Traceback (most recent call last):
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py",
>>>> line 156, in _run_process
>>>>     wps_response.update_status('PyWPS Process finished', 100)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py",
>>>> line 41, in update_status
>>>>     self.doc = self._construct_doc()
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py",
>>>> line 171, in _construct_doc
>>>>     output_elements = [self.outputs[o].execute_xml() for o in
>>>> self.outputs]
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/outputs.py",
>>>> line 276, in execute_xml
>>>>     literal_data_doc = WPS.LiteralData(text_type(self.data))
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/basic.py",
>>>> line 231, in get_data
>>>>     return IOHandler.get_data(self)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/basic.py",
>>>> line 173, in get_data
>>>>     file_handler = open(self.source, mode='r')
>>>> IOError: [Errno 2] No such file or directory:
>>>> '/tmp/pywps/pypws_process_lQqN_6/done'
>>>> ERROR:root:Service error: near "''": syntax error
>>>> Traceback (most recent call last):
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Service.py",
>>>> line 358, in _parse_and_execute
>>>>     wps_response = process.execute(wps_request, uuid)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py",
>>>> line 145, in execute
>>>>     wps_response = self._run_process(wps_request, wps_response)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py",
>>>> line 178, in _run_process
>>>>     wps_response.update_status('Process error: %s.%s Line %i %s' %
>>>> (fname, method_name, exc_tb.tb_lineno, e), -1)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py",
>>>> line 47, in update_status
>>>>     update_response(self.uuid, self)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/dblog.py",
>>>> line 67, in update_response
>>>>     cur.execute(update)
>>>> OperationalError: near "''": syntax error
>>>>
>>>>
>>>> How can I fix this?
>>>>
>>>> Best,
>>>>
>>>> Lorenzo
>>>>
>>>> _______________________________________________
>>>> pywps-dev mailing list
>>>> pywps-dev at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/pywps-dev
>>>
>>>
>>> _______________________________________________
>>> pywps-dev mailing list
>>> pywps-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/pywps-dev
>>>
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pywps-dev/attachments/20160620/977454b8/attachment.html>


More information about the pywps-dev mailing list