<div dir="ltr">HI Jachym,<div><br></div><div>This is the error I get:</div><div><i><br></i></div><div><div><i>[Thu Jun 30 14:36:36.451990 2016] [:error] [pid 9432:tid 140582713661184] <contextlib.GeneratorContextManager object at 0x7fdbd3517f90></i></div><div><i>[Thu Jun 30 14:36:36.452096 2016] [:error] [pid 9432:tid 140582713661184] /tmp/tmpvDyTG6</i></div><div><i>[Thu Jun 30 14:36:36.546497 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>] mod_wsgi (pid=9432): Exception occurred processing WSGI script '/var/www/html/wps/pywps2.wsgi'.</i></div><div><i>[Thu Jun 30 14:36:36.546603 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>] Traceback (most recent call last):</i></div><div><i>[Thu Jun 30 14:36:36.546640 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]   File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 291, in application</i></div><div><i>[Thu Jun 30 14:36:36.546697 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]     return f(*args[:-2] + (request,))(*args[-2:])</i></div><div><i>[Thu Jun 30 14:36:36.546705 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]   File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 291, in application</i></div><div><i>[Thu Jun 30 14:36:36.546713 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]     return f(*args[:-2] + (request,))(*args[-2:])</i></div><div><i>[Thu Jun 30 14:36:36.546720 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]   File "/usr/local/lib/python2.7/dist-packages/pywps-4.0.0_alpha2-py2.7.egg/pywps/app/WPSResponse.py", line 203, in __call__</i></div><div><i>[Thu Jun 30 14:36:36.546759 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]     self.process.clean()</i></div><div><i>[Thu Jun 30 14:36:36.546763 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]   File "/usr/local/lib/python2.7/dist-packages/pywps-4.0.0_alpha2-py2.7.egg/pywps/app/Process.py", line 291, in clean</i></div><div><i>[Thu Jun 30 14:36:36.546769 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]     shutil.rmtree(self.workdir)</i></div><div><i>[Thu Jun 30 14:36:36.546772 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]   File "/usr/lib/python2.7/shutil.py", line 239, in rmtree</i></div><div><i>[Thu Jun 30 14:36:36.546779 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]     onerror(os.listdir, path, sys.exc_info())</i></div><div><i>[Thu Jun 30 14:36:36.546782 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]   File "/usr/lib/python2.7/shutil.py", line 237, in rmtree</i></div><div><i>[Thu Jun 30 14:36:36.546786 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>]     names = os.listdir(path)</i></div><div><i>[Thu Jun 30 14:36:36.546797 2016] [:error] [pid 9432:tid 140582713661184] [remote <a href="http://130.192.5.114:46065">130.192.5.114:46065</a>] OSError: [Errno 2] No such file or directory: '/tmp/pyws_process_8iTSrj'</i></div></div><div><i><br></i></div><div> Looks similar to the other! If i try to run the process many times some of them gives this as error:</div><div><br></div><div>[Thu Jun 30 14:40:31.133572 2016] [:error] [pid 9431:tid 140582705268480] Traceback (most recent call last):</div><div>[Thu Jun 30 14:40:31.133602 2016] [:error] [pid 9431:tid 140582705268480]   File "/usr/local/lib/python2.7/dist-packages/pywps-4.0.0_alpha2-py2.7.egg/pywps/app/Process.py", line 241, in _run_process</div><div>[Thu Jun 30 14:40:31.133631 2016] [:error] [pid 9431:tid 140582705268480]     wps_response = self.handler(wps_request, wps_response)</div><div>[Thu Jun 30 14:40:31.133641 2016] [:error] [pid 9431:tid 140582705268480]   File "/home/lorenzo/tools/pywps-4/demo/processes/raster.py", line 38, in _handler</div><div>[Thu Jun 30 14:40:31.133657 2016] [:error] [pid 9431:tid 140582705268480]     response.outputs['raster_out'].output_format = Format('GEOTIFF')</div><div>[Thu Jun 30 14:40:31.133679 2016] [:error] [pid 9431:tid 140582705268480] KeyError: 'raster_out'</div><div>[Thu Jun 30 14:40:31.133780 2016] [:error] [pid 9431:tid 140582705268480] ERROR:PYWPS:Process error: raster.py._handler Line 38 'raster_out' </div><div><br></div><div>When it gives this error, in the /tmp/ directory I find a pyws_process_****** folder with two files inside 1)output.tiff and 2)tmp*****. Output.tiff is a empty file tmp**** is the expected out put.<br><br>This is the script of the process:</div><div><div><i><br></i></div><div><i>from pywps import Process, ComplexInput, ComplexOutput, get_format,LiteralOutput, Format</i></div><div><i>from pywps.wpsserver import temp_dir</i></div><div><i><br></i></div><div><i>class Raster(Process):</i></div><div><i><br></i></div><div><i>    def __init__(self):</i></div><div><i>        inputs = [ComplexInput('raster','Raster input',[Format('GEOTIFF')])]</i></div><div><i><br></i></div><div><i>        outputs = [ComplexOutput('raster_out','Raster input',[Format('GEOTIFF')]), LiteralOutput('response', 'Output response', data_type='string')]</i></div><div><i>        super(Raster, self).__init__(</i></div><div><i>            self._handler,</i></div><div><i>            identifier='rast_try',</i></div><div><i>            title='Raster try',</i></div><div><i>            inputs=inputs,</i></div><div><i>            outputs=outputs,</i></div><div><i>            store_supported=True,</i></div><div><i>            status_supported=True</i></div><div><i>        )</i></div><div><i><br></i></div><div><i>    def _handler(self, request, response):</i></div><div><i><br></i></div><div><i>        print temp_dir()</i></div><div><i>        </i></div><div><i>        with temp_dir() as tmp:</i></div><div><i>            print tmp</i></div><div><i>            from osgeo import gdal</i></div><div><i>            app=request.inputs['raster'][0].file</i></div><div><i>            inds = gdal.Open(app)</i></div><div><i>            outdriver = gdal.GetDriverByName('GTiff')</i></div><div><i>            outds = outdriver.CreateCopy('output.tiff', inds)</i></div><div><i>            outds.FlushCache()</i></div><div><i>            response.outputs['raster_out'].output_format = Format('GEOTIFF')</i></div><div><i>            response.outputs['raster_out'].file = 'output.tiff'</i></div><div><i>            response.outputs['response'].data = 'done'</i></div><div><i><br></i></div><div><i>            return response</i></div></div><div><br></div><div>Best,<br><br>Lorenzo</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-29 10:25 GMT+02:00 Lorenzo Bottaccioli <span dir="ltr"><<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi Jachym,</p>
<p dir="ltr">This is the GET request:</p>
<p dir="ltr"><a href="http://localhost/pywps?service=wps&version=1.0.0&request=execute&Identifier=rast_try&datainputs=raster=@xlink:href=file:///home/lorenzo/aspect_1ifGBx0" target="_blank">http://localhost/pywps?service=wps&version=1.0.0&request=execute&Identifier=rast_try&datainputs=raster=@xlink:href=file:///home/lorenzo/aspect_1ifGBx0</a></p>
<p dir="ltr">Tnx</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">Il 29 giu 2016 10:23 AM, "Jachym Cepicky" <<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Lorenzo,<div><br></div><div>looks like your request is not formatted well - the XML input. How does it look?</div><div><br></div><div>J</div></div><br><div class="gmail_quote"><div dir="ltr">út 28. 6. 2016 v 15:29 odesílatel Lorenzo Bottaccioli <<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">HI all,<br><br><div>I have setup the pywps linked by Jachym (<a href="https://github.com/jachym/pywps/tree/pygrass" style="font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:12.8px" target="_blank">https://github.com/jachym/pywps/tree/pygrass</a>) run on Apache2 with mod_wsgi.</div><div>I have created a wsgi file with this script</div><div><i><br></i></div><div><div><i>import sys</i></div><div><i>sys.path.insert(0, '/home/lorenzo/tools/pywps-4/')</i></div><div><i>import pywps</i></div><div><i>from pywps.app import Service,  Process</i></div><div><i>from processes.raster import Raster</i></div><div><i>from processes.solar.PV_NOCT import PV_CALC</i></div><div><i>from processes.get_year_rad import get_year_rad_pitch</i></div><div><i>from processes.get_year_rad_zstat import get_year_rad_pitch_query</i></div><div><i>from processes.get_year_rad_all import get_year_rad_all</i></div><div><i>from processes.solar.real_sky import Real_sky</i></div><div><i><br></i></div><div><i>application = Service(processes=[Raster(),</i></div><div><i><span style="white-space:pre-wrap">         </span>PV_CALC(),</i></div><div><i><span style="white-space:pre-wrap">            </span>get_year_rad_pitch(),</i></div><div><i><span style="white-space:pre-wrap">         </span>get_year_rad_pitch_query(),</i></div><div><i><span style="white-space:pre-wrap">           </span>Real_sky(),</i></div><div><i><span style="white-space:pre-wrap">           </span>get_year_rad_all()], cfgfile='/var/www/pywps/pywps.cfg')</i></div></div><div><i><br></i></div><div>I still get an error when I try to use the Raster process which is:</div><div><br></div><div></div></div><div dir="ltr"><div><div><i>from pywps import Process, ComplexInput, ComplexOutput, get_format,LiteralOutput, Format</i></div><div><i>class Raster(Process):</i><br></div><div><i><br></i></div><div><i>    def __init__(self):</i></div><div><i>        inputs = [ComplexInput('raster','Raster input',[Format('GEOTIFF')])]</i></div><div><i><br></i></div></div></div><div dir="ltr"><div><div><i>        outputs = [ComplexOutput('raster_out', 'Raster output',[Format('GEOTIFF')]),LiteralOutput('response', 'Output response', data_type='string')]</i></div></div></div><div dir="ltr"><div><div><i>        super(Raster, self).__init__(</i></div><div><i>            self._handler,</i></div><div><i>            identifier='rast_try',</i></div><div><i>            title='Raster try',</i></div><div><i>            inputs=inputs,</i></div><div><i>            outputs=outputs,</i></div><div><i>            store_supported=True,</i></div><div><i>            status_supported=True</i></div><div><i>        )</i></div><div><i><br></i></div><div><i>    def _handler(self, request, response):</i></div><div><i><br></i></div><div><i>        from osgeo import gdal</i></div><div><i>        app=request.inputs['raster'][0].file</i></div><div><i>        inds = gdal.Open(app)</i></div><div><i>        outdriver = gdal.GetDriverByName('GTiff')</i></div><div><i>        outds = outdriver.CreateCopy('output.tiff', inds)</i></div><div><i>        outds.FlushCache()</i></div><div><i>        response.outputs['raster_out'].output_format = Format('GEOTIFF')</i></div><div><i>        response.outputs['raster_out'].file = 'output.tiff'</i></div></div></div><div dir="ltr"><div><div><i>        response.outputs['response'].data = 'done'</i></div><div><i>        return response</i></div></div><div><i><br></i></div><div> The error I get in the apache error.log is:</div><div><br></div><div><div>[Tue Jun 28 15:23:54.052594 2016] [:error] [pid 4437:tid 140256591759104] ERROR:PYWPS:Exception: code: 400, locator: None, description: </div><div>[Tue Jun 28 15:23:54.052615 2016] [:error] [pid 4437:tid 140256591759104] Traceback (most recent call last):</div><div>[Tue Jun 28 15:23:54.052617 2016] [:error] [pid 4437:tid 140256591759104]   File "/usr/local/lib/python2.7/dist-packages/pywps-4.0.0_alpha2-py2.7.egg/pywps/app/WPSRequest.py", line 80, in _post_request</div><div>[Tue Jun 28 15:23:54.052618 2016] [:error] [pid 4437:tid 140256591759104]     doc = lxml.etree.fromstring(self.http_request.get_data())</div><div>[Tue Jun 28 15:23:54.052620 2016] [:error] [pid 4437:tid 140256591759104]   File "lxml.etree.pyx", line 3032, in lxml.etree.fromstring (src/lxml/lxml.etree.c:68106)</div><div>[Tue Jun 28 15:23:54.052622 2016] [:error] [pid 4437:tid 140256591759104]   File "parser.pxi", line 1785, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:102455)</div><div>[Tue Jun 28 15:23:54.052626 2016] [:error] [pid 4437:tid 140256591759104]   File "parser.pxi", line 1673, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:101284)</div><div>[Tue Jun 28 15:23:54.052628 2016] [:error] [pid 4437:tid 140256591759104]   File "parser.pxi", line 1074, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:96466)</div><div>[Tue Jun 28 15:23:54.052629 2016] [:error] [pid 4437:tid 140256591759104]   File "parser.pxi", line 582, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:91275)</div><div>[Tue Jun 28 15:23:54.052630 2016] [:error] [pid 4437:tid 140256591759104]   File "parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:92461)</div><div>[Tue Jun 28 15:23:54.052632 2016] [:error] [pid 4437:tid 140256591759104]   File "parser.pxi", line 633, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:91924)</div><div>[Tue Jun 28 15:23:54.052633 2016] [:error] [pid 4437:tid 140256591759104] XMLSyntaxError: None<br><br>Any suggestion to solve it?<br><br>Best,<br><br>Lorenzo</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-28 10:28 GMT+02:00 Lorenzo Bottaccioli <span dir="ltr"><<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jachym,<br><br>I have changed my code in this. I create the file 'output.tiff' the error indeed was not related to output.tiff.<br><div><br></div><div><span><div style="font-size:12.8px">from pywps import Process, ComplexInput, ComplexOutput, get_format,LiteralOutput, Format</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><i><br></i></div><div style="font-size:12.8px"><i>class Raster(Process):</i></div><div style="font-size:12.8px"><i><br></i></div><div style="font-size:12.8px"><i>    def __init__(self):</i></div><div style="font-size:12.8px"><i>        inputs = [ComplexInput('raster','Raster input',[Format('GEOTIFF')])]</i></div><div style="font-size:12.8px"><i><br></i></div></span><div style="font-size:12.8px"><i>        outputs = [ComplexOutput('raster_out', 'Raster output',[Format('GEOJSON')])]</i></div><span><div style="font-size:12.8px"><i>        super(Raster, self).__init__(</i></div><div style="font-size:12.8px"><i>            self._handler,</i></div><div style="font-size:12.8px"><i>            identifier='rast_try',</i></div><div style="font-size:12.8px"><i>            title='Raster try',</i></div><div style="font-size:12.8px"><i>            inputs=inputs,</i></div><div style="font-size:12.8px"><i>            outputs=outputs,</i></div><div style="font-size:12.8px"><i>            store_supported=True,</i></div><div style="font-size:12.8px"><i>            status_supported=True</i></div><div style="font-size:12.8px"><i>        )</i></div><div style="font-size:12.8px"><i><br></i></div><div style="font-size:12.8px"><i>    def _handler(self, request, response):</i></div><div style="font-size:12.8px"><i><br></i></div><div style="font-size:12.8px"><i>        from osgeo import gdal</i></div><div style="font-size:12.8px"><i>        app=request.inputs['raster'][0].file</i></div><div style="font-size:12.8px"><i>        inds = gdal.Open(app)</i></div><div style="font-size:12.8px"><i>        outdriver = gdal.GetDriverByName('GTiff')</i></div><div style="font-size:12.8px"><i>        outds = outdriver.CreateCopy('output.tiff', inds)</i></div><div style="font-size:12.8px"><i>        outds.FlushCache()</i></div><div style="font-size:12.8px"><i>        response.outputs['raster_out'].output_format = Format('GEOTIFF')</i></div><div style="font-size:12.8px"><i>        response.outputs['raster_out'].file = 'output.tiff'</i></div></span><div style="font-size:12.8px"><i>        return response</i></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"> This is the Error:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div style="font-size:12.8px">130.192.5.114 - - [28/Jun/2016 10:26:51] "GET /wps?service=wps&version=1.0.0&request=execute&Identifier=rast_try&datainputs=raster=@xlink:href=file:///home/lorenzo/aspect_1ifGBx0 HTTP/1.1" 500 -</div><span><div style="font-size:12.8px">Traceback (most recent call last):</div></span><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__</div><div style="font-size:12.8px">    return self.wsgi_app(environ, start_response)</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app</div><div style="font-size:12.8px">    response = self.make_response(self.handle_exception(e))</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception</div><div style="font-size:12.8px">    reraise(exc_type, exc_value, tb)</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app</div><div style="font-size:12.8px">    response = self.full_dispatch_request()</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1478, in full_dispatch_request</div><div style="font-size:12.8px">    response = self.make_response(rv)</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1577, in make_response</div><div style="font-size:12.8px">    rv = self.response_class.force_type(rv, request.environ)</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 847, in force_type</div><div style="font-size:12.8px">    response = BaseResponse(*_run_wsgi_app(response, environ))</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 57, in _run_wsgi_app</div><div style="font-size:12.8px">    return _run_wsgi_app(*args)</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/test.py", line 871, in run_wsgi_app</div><div style="font-size:12.8px">    app_rv = app(environ, start_response)</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 291, in application</div><div style="font-size:12.8px">    return f(*args[:-2] + (request,))(*args[-2:])</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 291, in application</div><div style="font-size:12.8px">    return f(*args[:-2] + (request,))(*args[-2:])</div><div style="font-size:12.8px">  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py", line 180, in __call__</div><div style="font-size:12.8px">    except HTTPException as httpexp:</div><div style="font-size:12.8px">NameError: global name 'HTTPException' is not defined</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'll test your banch ASAP and I let you know.<br><br>Tnx,<br><br>Lorenzo</div><div><br></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-27 22:39 GMT+02:00 Jachym Cepicky <span dir="ltr"><<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Lorenzo,<div><br></div><div>two things,</div><div><br></div><div>in your code:</div><span><div><br></div><div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">IOError: [Errno 2] No such file or directory: '/tmp/pywps/pypws_process_lQqN_6/done'</div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">ERROR:root:Service error: near "''": syntax error</div></div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif"><br></div></span><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">means - you can not save output.file as 'done' - it must be file name</div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif"><br></div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">second: there was bug in pywps, which lead to error while constructing the final response from pywps, please test pygrass branch in my repository</div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif"><br></div><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif"><a href="https://github.com/jachym/pywps/tree/pygrass" target="_blank">https://github.com/jachym/pywps/tree/pygrass</a></font><br></div><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif"><br></font></div><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif">one more time:</font></div><span><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif"><br></font></div><div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">        response.outputs['raster_out'].output_format = Format('GEOTIFF')</div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">        response.outputs['raster_out'].file = 'output.tiff'</div></div><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif"><br></div></span><div style="color:rgb(33,33,33);font-family:'helvetica neue',helvetica,arial,sans-serif">should work ASSUMING, output.tiff is existing file!</div><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif"><br></font></div></div><br><div class="gmail_quote"><div dir="ltr">pá 24. 6. 2016 v 13:17 odesílatel Lorenzo Bottaccioli <<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>> napsal:<br></div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<br><br>Can you please show a simple PyWPS process that revice a geotiff and returns it back and the url for requesting it?. <br>I'm not finding a way to do that.<br><br>Thanks in advantage,<br>Best</div><div dir="ltr"><br><br>Lorenzo</div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-21 17:40 GMT+02:00 Jachym Cepicky <span dir="ltr"><<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi, <div><br></div><div>if you are running pywps in apache2, it's usually /var/log/apache2/error.log</div><div>if flask - it should be written to the command line</div><div><br></div><div>look for some pythonish error</div></div><br><div class="gmail_quote"><div dir="ltr">po 20. 6. 2016 v 17:29 odesílatel Lorenzo Bottaccioli <<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>> napsal:<br></div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jachym,<br><br>As I wrote in the previous mail I have changed<div><br></div><div><span style="font-style:italic;font-family:"times new roman";font-size:14.16px;background-color:rgb(253,253,253)">response.outputs['response'].file</span><span style="font-family:"times new roman";font-size:14.16px;background-color:rgb(253,253,253)"><i> = 'done' </i>in<i> </i></span><span style="font-style:italic;font-family:"times new roman";font-size:14.16px;background-color:rgb(253,253,253)">response.outputs['response'].</span><span style="font-style:italic;font-family:"times new roman";font-size:14.16px;background-color:rgb(253,253,253)">data = 'done' </span><span style="font-family:"times new roman";font-size:14.16px;background-color:rgb(253,253,253)"> .<br></span><br>But I stil get an error:</div></div><div dir="ltr"><div><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"></div><div><title>500 Internal Server Error</title></div><div><h1>Internal Server Error</h1></div></div><div dir="ltr"><div><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><br><br><br></div></div><div dir="ltr"><div>Which is the HTTPD error.log file? The pywps.log file is always empty and the log level is set to DEBUG<br>Best,<br><br>Lorenzo</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-18 23:39 GMT+02:00 Jachym Cepicky <span dir="ltr"><<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi,<div><br></div><div>as jonas was saying: <span style="font-family:'times new roman';font-size:14.16px;line-height:normal;background-color:rgb(253,253,253)">response.outputs['response'].</span><span style="font-family:'times new roman';font-size:14.16px;line-height:normal;background-color:rgb(253,253,253)">data = 'done' should work better</span></div><div><span style="font-family:'times new roman';font-size:14.16px;line-height:normal;background-color:rgb(253,253,253)"><br></span></div><div><span style="font-family:'times new roman';font-size:14.16px;line-height:normal;background-color:rgb(253,253,253)">Lorenzo:  do you get anything in the HTTPD server error.log file?</span></div></div><br><div class="gmail_quote"><div dir="ltr">pá 10. 6. 2016 v 15:30 odesílatel Lorenzo Bottaccioli <<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>> napsal:<br></div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><br>I'have changed from file to data in <span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:14.16px;background-color:rgb(253,253,253)">response.outputs['response'].</span><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:14.16px;background-color:rgb(253,253,253)">data = 'done', but bow I still get an error in the response.</span><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:14.16px;background-color:rgb(253,253,253)"><br></span></div><div><span style="background-color:rgb(253,253,253)"><font color="#000000" face="Times New Roman"><div style="font-size:14.16px"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"></div><div style="font-size:14.16px"><title>500 Internal Server Error</title></div><div style="font-size:14.16px"><h1>Internal Server Error</h1></div><div style="font-size:14.16px"><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></div><div style="font-size:14.16px"><br></div><div style="font-size:14.16px"><br></div><div style="font-size:14.16px">The GET request is written like this:</div><div style="font-size:14.16px"><br></div><div><span style="font-size:14.16px"><a href="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" target="_blank">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</a></span><br></div><div><span style="font-size:14.16px"><br></span></div><div><span style="font-size:14.16px">In the terminal I dont get any error report.<br><br>Tnx,<br><br>Lorenzo</span></div></font></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-10 10:20 GMT+02:00 Jonas Eberle <span dir="ltr"><<a href="mailto:jonas.eberle@gmx.de" target="_blank">jonas.eberle@gmx.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000">The error "no such file or directory" comes from the following line: </div><span><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><span style="color:#000000;font-family:'Times New Roman';font-size:14.16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#fdfdfd">response.outputs['response'].file = 'done'</span><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br></div></span><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000">As response is a LiteralOutput I guess it is not correct to use the file attribute, better use the data attribute:</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><span style="color:#000000;font-family:'Times New Roman';font-size:14.16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#fdfdfd">response.outputs['response'].data = 'done'</span></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000">Cheers,</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000">Jonas</div><div><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><br><span>----- Am 10. Jun 2016 um 10:13 schrieb Jachym Cepicky <<a href="mailto:jachym.cepicky@gmail.com" target="_blank">jachym.cepicky@gmail.com</a>>:<br></span><div><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr">Hi Lorenzo,<br><div>There are two bugs as I understand. The first one:</div><br><div>IOError: [Errno 2] No such file or directory: '/tmp/pywps/pypws_process_lQqN_6/done'</div><br><div>do you have /tmp/pywps/ directory in you system (and is it writeable?)</div><br><div>The second bug is about attempt to write log to database</div><br><div>nice report btw, with the process I believe, we can fix it (both) once we find out what the problem could be</div><br><div>Jachym</div><div><span style="line-height:1.5"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr">st 8. 6. 2016 v 11:50 odesílatel Lorenzo Bottaccioli <<a href="mailto:lorenzo.bottaccioli@gmail.com" target="_blank">lorenzo.bottaccioli@gmail.com</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi List,<br><br>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:<br><div><div>from pywps import Process, ComplexInput, ComplexOutput, get_format,LiteralOutput, Format</div><br><br><div>class Raster(Process):</div><br><div>    def __init__(self):</div><div>        inputs = [ComplexInput('raster','Raster input',[Format('GEOTIFF')])]</div><br><div>        outputs = [ComplexOutput('raster_out', 'Raster output',[Format('GEOJSON')]),LiteralOutput('response', 'Output response', data_type='string')]</div><div>        super(Raster, self).__init__(</div><div>            self._handler,</div><div>            identifier='rast_try',</div><div>            title='Raster try',</div><div>            inputs=inputs,</div><div>            outputs=outputs,</div><div>            store_supported=True,</div><div>            status_supported=True</div><div>        )</div><br><div>    def _handler(self, request, response):</div><br><div>        from osgeo import gdal</div><div>        app=request.inputs['raster'][0].file</div><div>        inds = gdal.Open(app)</div><div>        outdriver = gdal.GetDriverByName('GTiff')</div><div>        outds = outdriver.CreateCopy('output.tiff', inds)</div><div>        outds.FlushCache()</div><div>        response.outputs['raster_out'].output_format = Format('GEOTIFF')</div><div>        response.outputs['raster_out'].file = 'output.tiff'</div><div>        response.outputs['response'].file = 'done'</div><div>        return response</div></div><br><div>The error that I recive is this one:</div><br><div><div>Traceback (most recent call last):</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py", line 156, in _run_process</div><div>    wps_response.update_status('PyWPS Process finished', 100)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py", line 41, in update_status</div><div>    self.doc = self._construct_doc()</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py", line 171, in _construct_doc</div><div>    output_elements = [self.outputs[o].execute_xml() for o in self.outputs]</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/outputs.py", line 276, in execute_xml</div><div>    literal_data_doc = WPS.LiteralData(text_type(self.data))</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/basic.py", line 231, in get_data</div><div>    return IOHandler.get_data(self)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/basic.py", line 173, in get_data</div><div>    file_handler = open(self.source, mode='r')</div><div>IOError: [Errno 2] No such file or directory: '/tmp/pywps/pypws_process_lQqN_6/done'</div><div>ERROR:root:Service error: near "''": syntax error</div><div>Traceback (most recent call last):</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Service.py", line 358, in _parse_and_execute</div><div>    wps_response = process.execute(wps_request, uuid)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py", line 145, in execute</div><div>    wps_response = self._run_process(wps_request, wps_response)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py", line 178, in _run_process</div><div>    wps_response.update_status('Process error: %s.%s Line %i %s' % (fname, method_name, exc_tb.tb_lineno, e), -1)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py", line 47, in update_status</div><div>    update_response(self.uuid, self)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/dblog.py", line 67, in update_response</div><div>    cur.execute(update)</div><div>OperationalError: near "''": syntax error</div></div><div><br><br>How can I fix this?<br><br>Best,<br><br>Lorenzo</div><br></div>
_______________________________________________<br>
pywps-dev mailing list<br>
<a href="mailto:pywps-dev@lists.osgeo.org" target="_blank">pywps-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a></blockquote></div>
<br>_______________________________________________<br>pywps-dev mailing list<br><a href="mailto:pywps-dev@lists.osgeo.org" target="_blank">pywps-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/pywps-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/pywps-dev</a></blockquote></div></div><br></div></div></div></div></blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div>
</blockquote></div>
</div></div></blockquote></div><br></div>