Ticket #3972 (closed defect: fixed)

Opened 22 months ago

Last modified 22 months ago

WCS 1.0: WCS Exceptions raise mapscript exceptions

Reported by: fschindler Owned by: sdlime
Priority: high Milestone: 6.2 release
Component: WCS Server Version: unspecified
Severity: normal Keywords: WCS exception mapscript
Cc: sdlime, schpidi, tomkralidis, dmorissette, assefa

Description

WCS Exceptions in WCS 1.0 requests called from mapscript applications raise an exception instead of returning a proper result.

For WCS 1.1 and WCS 2.0 this is not the case, as the exception message is normally returned an can be read with the according msIO_... mapscript functions.

The following python application raises the said exception (because the coverage id is not found):

import mapscript

ows_req = mapscript.OWSRequest()
ows_req.setParameter('SERVICE','WCS')
ows_req.setParameter('REQUEST','DescribeCoverage')
ows_req.setParameter('VERSION','1.0.0')
ows_req.setParameter('COVERAGE','invalid_id')

map = mapscript.mapObj('test.map')
mapscript.msIO_installStdoutToBuffer()
dispatch_status = map.OWSDispatch(ows_req)
print mapscript.msIO_getStdoutBufferBytes()

The used map file:

MAP
  CONFIG "MS_ERRORFILE" "stderr"

  WEB
    METADATA
      "ows_onlineresource" "http://something?"
      "ows_enable_request" "*"
    END
  END 

  LAYER
    NAME "a" 
    DUMP TRUE 
    DATA "test.tif" 
    TYPE RASTER 
    METADATA
      "ows_srs" "EPSG:4326"
    END
  END
END

The exception raised:

Traceback (most recent call last):
  File "describe.py", line 13, in <module>
    dispatch_status = map.OWSDispatch(ows_req)
_mapscript.MapServerError: msWCSDescribeCoverage(): WCS server error. COVERAGE invalid_id cannot be opened / does not exist

The problem occurs in msWCSException, as the error stack is not cleared with msResetErrorList, which is done in the other WCS exception handlers.

The following patch resolves the issue:

  • mapwcs.c

     
    179179  msIO_printf("  </ServiceException>\n"); 
    180180  msIO_printf("</ServiceExceptionReport>\n"); 
    181181 
     182  msResetErrorList(); 
     183 
    182184  return MS_FAILURE; 
    183185} 

Attachments

r11973_wcs_exception_errorstack.patch Download (304 bytes) - added by fschindler 22 months ago.
Patch to resolve the described problem

Change History

Changed 22 months ago by fschindler

Patch to resolve the described problem

Changed 22 months ago by schpidi

  • status changed from new to closed
  • resolution set to fixed

Committed with r11980.

Changed 22 months ago by schpidi

Forgot HISTORY.txt 11981.

Note: See TracTickets for help on using tickets.