riesgos / dlr-riesgos-frontend

Deutsches Zentrum für Luft- und Raumfahrt e.V. * (German Aerospace Center), German Remote Sensing Data Center * Department: Geo-Risks and Civil Security
https://riesgos.de
Apache License 2.0
2 stars 1 forks source link

Chile: Sysrel error #149

Closed MichaelLangbein closed 2 years ago

MichaelLangbein commented 2 years ago

Target: https://riesgos.52north.org/javaps/service --- org.n52.gfz.riesgos.algorithm.impl.SystemReliabilitySingleProcess

Request:

<wps:Execute xmlns:wps="http://www.opengis.net/wps/2.0" service="WPS" version="2.0.0" mode="async" response="document">
    <p0:Identifier xmlns:p0="http://www.opengis.net/ows/2.0">org.n52.gfz.riesgos.algorithm.impl.SystemReliabilitySingleProcess</p0:Identifier>
    <wps:Input id="intensity">
        <wps:Reference p1:href="https://rz-vm140.gfz-potsdam.de:443/wps/RetrieveResultServlet?id=f0808ccb-be44-4400-a637-67d3141d92f3shakeMapFile.3c807241-30cf-4db8-9610-c908c9a1b0ce" xmlns:p1="http://www.w3.org/1999/xlink" mimeType="text/xml"/>
    </wps:Input>
    <wps:Input id="country">
        <wps:Data mimeType="text/plain">chile</wps:Data>
    </wps:Input>
    <wps:Input id="hazard">
        <wps:Data mimeType="text/plain">earthquake</wps:Data>
    </wps:Input>
    <wps:Output id="damage_consumer_areas" transmission="value" mimeType="application/vnd.geo+json"/>
</wps:Execute>

Error:

Request failed with status code 400

Stack:
Error: Request failed with status code 400
    at createError (C:\Users\lang_m13\Desktop\code\js\ukis_projects\dlr-riesgos-frontend\middleware\node_modules\axios\lib\core\createError.js:16:15)
    at settle (C:\Users\lang_m13\Desktop\code\js\ukis_projects\dlr-riesgos-frontend\middleware\node_modules\axios\lib\core\settle.js:17:12)
    at IncomingMessage.handleStreamEnd (C:\Users\lang_m13\Desktop\code\js\ukis_projects\dlr-riesgos-frontend\middleware\node_modules\axios\lib\adapters\http.js:322:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Time: Sun Apr 24 2022 10:54:29 GMT+0200 (Mitteleuropäische Sommerzeit)

MichaelLangbein commented 2 years ago

Making that same call over postman:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/2.0 http://schemas.opengis.net/ows/2.0/owsAll.xsd" version="2.0.0">
    <ows:Exception locator="Input" exceptionCode="InvalidParameterValue">
        <ows:ExceptionText>The value 'intensity' of the parameter 'Input' is invalid: unsupported format</ows:ExceptionText>
        <ows:ExceptionText>[EXCEPTION]: 
org.n52.shetland.ogc.ows.exception.InvalidParameterValueException: The value 'intensity' of the parameter 'Input' is invalid: unsupported format
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.invalidInput(ExecuteParameterValidator.java:283)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.access$100(ExecuteParameterValidator.java:68)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator$InputFormatValidator.unsupportedFormat(ExecuteParameterValidator.java:367)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator$InputFormatValidator.checkCompatibility(ExecuteParameterValidator.java:372)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator$InputFormatValidator.visit(ExecuteParameterValidator.java:352)
    at org.n52.shetland.ogc.wps.description.ProcessInputDescription$2.visit(ProcessInputDescription.java:89)
    at org.n52.shetland.ogc.wps.description.ProcessInputDescription$2.visit(ProcessInputDescription.java:80)
    at org.n52.shetland.ogc.wps.description.ComplexInputDescription.visit(ComplexInputDescription.java:43)
    at org.n52.shetland.ogc.wps.description.ProcessInputDescription.visit(ProcessInputDescription.java:80)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validateFormat(ExecuteParameterValidator.java:227)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validateInput(ExecuteParameterValidator.java:239)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validateInput(ExecuteParameterValidator.java:274)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.lambda$validateInputs$6(ExecuteParameterValidator.java:181)
    at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validateInputs(ExecuteParameterValidator.java:179)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validate(ExecuteParameterValidator.java:121)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validate(ExecuteParameterValidator.java:100)
    at org.n52.javaps.service.operator.validation.ExecuteParameterValidator.validate(ExecuteParameterValidator.java:68)
    at org.n52.iceland.request.operator.GenericRequestOperator.receiveRequest(GenericRequestOperator.java:189)
    at org.n52.iceland.service.operator.GenericServiceOperator.receiveRequest(GenericServiceOperator.java:99)
    at org.n52.iceland.binding.pox.PoxBinding.doPostOperation(PoxBinding.java:85)
    at org.n52.iceland.service.Service.post(Service.java:149)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
    at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:208)
    at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:274)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
    at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:505)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
    at java.lang.Thread.run(Thread.java:748)
</ows:ExceptionText>
    </ows:Exception>
</ows:ExceptionReport>
MichaelLangbein commented 2 years ago

It's weird that Sysrel complains about the intensity input. Following the link to that data yields a shapefile that looks pretty normal to me:

<?xml version='1.0' encoding='UTF-8'?>
<ns1:shakemap_grid xmlns:ns1="http://earthquake.usgs.gov/eqcenter/shakemap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://earthquake.usgs.gov/eqcenter/shakemap" xsi:schemaLocation="http://earthquake.usgs.gov http://earthquake.usgs.gov/eqcenter/shakemap/xml/schemas/shakemap.xsd" event_id="quakeml:quakeledger/80674883" shakemap_id="quakeml:quakeledger/80674883" code_version="shakyground 0.1" shakemap_version="1" process_timestamp="2022-04-23T11:35:46.025951Z" shakemap_originator="GFZ" map_status="RELEASED" shakemap_event_type="expert">
<event event_id="quakeml:quakeledger/80674883" magnitude="8.0" depth="12.7" lat="-31.9306" lon="-72.3538" strike="9.0" rake="90.0" dip="20.0" event_timestamp="2019-01-01T00:00:00.000000Z" event_network="nan" event_description=""/>
<grid_specification lon_min="-74.3333333333" lat_min="-34.7083333333" lon_max="-70.5166666667" lat_max="-29.758333333299998" nominal_lon_spacing="0.008333" nominal_lat_spacing="0.008333" nlon="459" nlat="595" regular_grid="1"/>
<event_specific_uncertainty name="pga" value="0.0" numsta=""/>
<event_specific_uncertainty name="pgv" value="0.0" numsta=""/>
<event_specific_uncertainty name="mi" value="0.0" numsta=""/>
<event_specific_uncertainty name="psa03" value="0.0" numsta=""/>
<event_specific_uncertainty name="psa10" value="0.0" numsta=""/>
<event_specific_uncertainty name="psa30" value="0.0" numsta=""/>
<grid_field index="1" name="LON" units="dd"/>
<grid_field index="2" name="LAT" units="dd"/>
<grid_field index="3" name="PGA" units="g"/>
<grid_field index="4" name="STDPGA" units="g"/>
<grid_field index="5" name="SA(0.3)" units="g"/>
<grid_field index="6" name="STDSA(0.3)" units="g"/>
<grid_field index="7" name="SA(1.0)" units="g"/>
<grid_field index="8" name="STDSA(1.0)" units="g"/>
<grid_data> -74.325 -29.758333333299998 0.035287064 0.8052771 0.07920245 0.8454548 0.038460642 0.7543947 -74.3166666667 -29.758333333299998 0.035470206 0.8052771 0.07965497 0.8454548 0.038593948 0.7543947 -74.3083333333 -29.758333333299998 0.035654455 0.8052771 0.08010995 0.8454548 0.038727853 0.7543947 -74.3 -29.758333333299998 0.03583981 0.8052771 0.0805674 0.8454548 0.038862363 0.7543947 -74.2916666667 -29.758333333299998 0.036026288 0.8052771 0.08102734 0.8454548 0.03899748 0.7543947 -74.28333333329999 -29.758333333299998 0.036213886 0.8052771 0.08148976 0.8454548 0.039133202 0.7543947 -74.275 -29.758333333299998 0.036402613 0.8052771 0.08195468 0.8454548 0.039269533 0.7543947 -74.2666666667 -29.758333333299998 0.036592472 0.8052771 0.0824221 0.8454548 0.03940648 0.7543947 -74.2583333333 -29.758333333299998 0.03678347 0.8052771 0.08289204 0.8454548 0.03954403 0.7543947 -74.25 -29.758333333299998 0.03697562 0.8052771 0.083364494 0.8454548 0.039682202 0.7543947 -74.2416666667 -29.758333333299998 0.037168913 0.8052771 0.08383947 0.8454548 0.039820988 0.7543947 -74.2333333333 -29.758333333299998 0.03736336 0.8052771
...
MichaelLangbein commented 2 years ago

Found the error! Was a bug in Wps-Marshaller 2.0 in Middleware: didn't add schema and encoding to request.

Incorrect:

    <wps:Execute xmlns:wps="http://www.opengis.net/wps/2.0" service="WPS" version="2.0.0" mode="async" response="document">
      <p0:Identifier xmlns:p0="http://www.opengis.net/ows/2.0">org.n52.gfz.riesgos.algorithm.impl.SystemReliabilitySingleProcess</p0:Identifier>
      <wps:Input id="intensity">
          <wps:Reference p1:href="https://rz-vm140.gfz-potsdam.de:443/wps/RetrieveResultServlet?id=64c56a10-a59a-41ab-8b3e-fd9eca202ad1shakeMapFile.1b0d53a0-ccf2-4dda-9b91-ff74ca0c9aa2" xmlns:p1="http://www.w3.org/1999/xlink" mimeType="text/xml"/>
      </wps:Input>
      <wps:Input id="country">
          <wps:Data mimeType="text/plain">chile</wps:Data>
      </wps:Input>
      <wps:Input id="hazard">
          <wps:Data mimeType="text/plain">earthquake</wps:Data>
      </wps:Input>
      <wps:Output id="damage_consumer_areas" transmission="value" mimeType="application/vnd.geo+json" />
    </wps:Execute>

After correction:

    <wps:Execute xmlns:wps="http://www.opengis.net/wps/2.0" service="WPS" version="2.0.0" mode="async" response="document">
      <p0:Identifier xmlns:p0="http://www.opengis.net/ows/2.0">org.n52.gfz.riesgos.algorithm.impl.SystemReliabilitySingleProcess</p0:Identifier>
      <wps:Input id="intensity">
          <wps:Reference p1:href="https://rz-vm140.gfz-potsdam.de:443/wps/RetrieveResultServlet?id=aa622ad8-1c4e-42f3-a870-fdd6b0af0838shakeMapFile.6ee8efc5-bf08-4577-8fa0-77efe9101c7f" xmlns:p1="http://www.w3.org/1999/xlink" mimeType="text/xml" encoding="UTF-8" schema="http://earthquake.usgs.gov/eqcenter/shakemap" />
      </wps:Input>
      <wps:Input id="country">
          <wps:Data mimeType="text/plain">chile</wps:Data>
      </wps:Input>
      <wps:Input id="hazard">
          <wps:Data mimeType="text/plain">earthquake</wps:Data>
      </wps:Input>
      <wps:Output id="damage_consumer_areas" transmission="value" mimeType="application/vnd.geo+json" />
    </wps:Execute>

Error did occur when we moved WPS-communication from frontend to proxy-server.

MichaelLangbein commented 2 years ago

Error resolved :)