Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#2683 closed defect (fixed)

MapServer error on a GetCapabilities request sent to a WCS server

Reported by: nsavard Owned by: warmerdam
Priority: normal Milestone: 5.6 release
Component: WCS Server Version: svn-trunk (development)
Severity: normal Keywords: wcs, msautotest
Cc: tomkralidis, sdlime

Description

When a GetCapabilities is issued to a WCS server an error is trowed out. MapServer is complaining that it cannot find the extent and resolution of the coverage. I checked in tomk_workshop map and I can see them. The test is wcs_get_caps.xml in the msautotest suite.

command=mapserv QUERY_STRING="map=tomk_workshop.map&service=WCS&version=1.0.0&request=GetCapabilities" > result/wcs_get_caps.xml

[Mon Jul 7 09:09:39 2008].992055 msWCSGetCoverageMetadata(): WCS server error. Failed to collect extent and resolution for WCS coverage from metadata. Need value wcs|ows_resolution or wcs|ows_size values.

Change History (19)

comment:1 by tomkralidis, 16 years ago

Norm: I get no error when I test this against trunk. I'm not sure why you would get these errors?

comment:2 by nsavard, 16 years ago

Tom, I don't understand as well. I'm using the fgs self-installer found on http://dl.maptools.org/dl/fgs/releases/1.0/1.0.0/self-installers/fgs-mapserver_5.2.0.beta4-fgs_1.0.0-linux-i386.bin

I checked on another computer which has a mapserver extracted from the trunk in a fgs environment and I didn't get this error.

comment:3 by nsavard, 16 years ago

Notice that the error only appears when you execute the following command in a shell. This explain why you didn't see it initially.

command=mapserv QUERY_STRING="map=tomk_workshop.map&service=WCS&version=1.0.0&request=GetCapabilities"

The error is: [Thu Aug 14 14:29:44 2008].70183 msWCSGetCoverageMetadata(): WCS server error. Failed to collect extent and resolution for WCS coverage from metadata. Need value wcs|ows_resolution or wcs|ows_size values.

comment:4 by tomkralidis, 16 years ago

Norm: running this in a shell, i.e.:

[devgeo:/home/tkralidi/foss4g/mapserver/trunk/msautotest/wxs]$ ../../mapserver/mapserv QUERY_STRING="map=tomk_workshop.map&service=WCS&version=1.0.0&request=GetCapabilities"

Gives me back no error. Not sure what gives here, but it's working for me. Is this what you did essentially? I tested w/ svn trunk.

comment:5 by nsavard, 16 years ago

Yes this is what I meant. Strange. Ok. I'll continue to check this. Thanks Tom.

comment:6 by tomkralidis, 16 years ago

Norm: is this still an issue?

comment:7 by nsavard, 16 years ago

Yes Tom, this is still valid.

comment:8 by tomkralidis, 16 years ago

Norm: by any chance, is this also on Ubuntu?

comment:9 by tomkralidis, 15 years ago

Norm: any update on this one?

comment:10 by nsavard, 15 years ago

Reply to #comment:8

Yes and you still have your account.

Reply to #comment:9

The error is still there (tested with 5.2.1 not svn). See at the end.

mapserv QUERY_STRING="map=tomk_workshop.map&service=WCS&version=1.0.0&request=GetCapabilities"
Content-type: text/xml

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<WCS_Capabilities
   version="1.0.0" 
   updateSequence="123" 
   xmlns="http://www.opengis.net/wcs" 
   xmlns:xlink="http://www.w3.org/1999/xlink" 
   xmlns:gml="http://www.opengis.net/gml" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wcs http://schemas.opengeospatial.net/wcs/1.0.0/wcsCapabilities.xsd">
<Service>
  <metadataLink metadataType="other" xlink:type="simple" xlink:href="http://localhost/ms_ogc_workshop/index.html"/>  <description>Sample OWS for MapServer OGC Web Services Workshop.  Enjoy!</description>
  <name>MapServer WCS</name>
  <label>Sample OWS for MapServer OGC Web Services Workshop</label>
  <keywords>
    <keyword>mapserver</keyword>
    <keyword>ogc</keyword>
    <keyword>workshop</keyword>
  </keywords>
<responsibleParty>
    <individualName>Tom Kralidis</individualName>
    <organisationName>Environment Canada</organisationName>
    <positionName>Senior Systems Scientist</positionName>
  <contactInfo>
    <phone>
    <voice>+01-905-336-4409</voice>
    <facsimile>+01-905-336-4499</facsimile>
    </phone>
    <address>
    <deliveryPoint>867 Lakeshore Road</deliveryPoint>
    <city>Burlington</city>
    <administrativeArea>Ontario</administrativeArea>
    <postalCode>L7R-4A6</postalCode>
    <country>Canada</country>
    <electronicMailAddress>tom.kralidis@ec.gc.ca</electronicMailAddress>
    </address>
    <onlineResource xlink:type="simple" xlink:href="http://localhost/ms_ogc_workshop/index.html"/>
  </contactInfo>
</responsibleParty>
  <fees>none</fees>
  <accessConstraints>
    none
  </accessConstraints>
</Service>
<Capability>
  <Request>
    <GetCapabilities>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&amp;" /></Get>
        </HTTP>
      </DCPType>
      <DCPType>
        <HTTP>
          <Post><OnlineResource xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&amp;" /></Post>
        </HTTP>
      </DCPType>
    </GetCapabilities>
    <DescribeCoverage>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&amp;" /></Get>
        </HTTP>
      </DCPType>
      <DCPType>
        <HTTP>
          <Post><OnlineResource xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&amp;" /></Post>
        </HTTP>
      </DCPType>
    </DescribeCoverage>
    <GetCoverage>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&amp;" /></Get>
        </HTTP>
      </DCPType>
      <DCPType>
        <HTTP>
          <Post><OnlineResource xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&amp;" /></Post>
        </HTTP>
      </DCPType>
    </GetCoverage>
  </Request>
  <Exception>
    <Format>application/vnd.ogc.se_xml</Format>
  </Exception>
</Capability>
<ContentMetadata>
[Wed Jan 28 12:13:21 2009].860707 msWCSGetCoverageMetadata(): WCS server error. Failed to collect extent and resolution for WCS coverage from metadata.  Need value wcs|ows_resolution or wcs|ows_size values.
  <CoverageOfferingBrief>
  <metadataLink metadataType="other" xlink:type="simple" xlink:href="http://geogratis.cgdi.gc.ca/clf/en?action=fullMetadata&amp;entryId=4373"/>  <description>Toronto Landsat 5 TM</description>
  <name>toronto</name>
  <label>Landsat 5 TM - Toronto</label>
    <lonLatEnvelope srsName="urn:ogc:def:crs:OGC:1.3:CRS84">
      <gml:pos>-81.5452675343945 42.7135512181083</gml:pos>
      <gml:pos>-78.3874252671819 44.7672915258482</gml:pos>
    </lonLatEnvelope>
  <keywords>
    <keyword>landsat</keyword>
    <keyword>toronto</keyword>
  </keywords>
  </CoverageOfferingBrief>
</ContentMetadata>
</WCS_Capabilities>


comment:11 by nsavard, 15 years ago

Tom: I found why I see this error and not you. I have 'CONFIG "MS_ERRORFILE" "stderr"' set at the map level.

comment:12 by tomkralidis, 15 years ago

Cc: warmerdam added

Norm: thanks for the info. So what does this mean? Should this be handled as a full Exception? An XML comment in the Caps XML?

cc'ing Frank for thoughts.

comment:13 by nsavard, 15 years ago

Tom: Can you translated what does this error means based on the source code?

msWCSGetCoverageMetadata(): WCS server error. Failed to collect extent and resolution for WCS coverage from metadata. Need value wcs|ows_resolution or wcs|ows_size values.

comment:14 by nsavard, 15 years ago

Reply #comment:13

I understand that resolution and size metadata seem to be missing even though I see one in the Toronto layer.

# x and y resolution of the data "wcs_resolution" "100 100"

in reply to:  14 comment:15 by tomkralidis, 15 years ago

Replying to nsavard:

Reply #comment:13

I understand that resolution and size metadata seem to be missing even though I see one in the Toronto layer.

# x and y resolution of the data "wcs_resolution" "100 100"

This is happenning in mapwcs.c, line 1996:

    /* do we have information to do anything */
    if( cm->xresolution == 0.0 || cm->yresolution == 0.0 || cm->xsize == 0 || cm->ysize == 0 ) {
      msSetError( MS_WCSERR, "Failed to collect extent and resolution for WCS coverage from metadata.  Need value wcs|ows_resolution or wcs|ows_size values.", "msWCSGetCoverageMetadata()");
      return MS_FAILURE;
    }

comment:16 by warmerdam, 15 years ago

Cc: sdlime added; warmerdam removed
Milestone: 5.4 release5.6 release
Owner: changed from sdlime to warmerdam

I see that an error is issued when a 1.0.0 request is made, but the capabilities is still returned. With 1.1.0/1 the error is preventing the generation of capabilities. I will dig into this.

comment:17 by warmerdam, 15 years ago

Resolution: fixed
Status: newclosed

OK, my analysis is that msWCSGetCoverageMetadata() was trying to get the extents and resolution from the layer metadata because it found an extents metadata value. But this file, tomk_workshop.map, does not have wcs or ows resolution information for this layer (land_shallow_topo_2048) so it failed.

I have modified the code to confirm it has extent and either resolution or size before it tries to utilize the .map metadata from the layer - otherwise it falls back to asking GDAL for details.

Also, Tom noted that WCS 1.0.0 was still returning capabilities. That is because the WCS 1.0.0 code makes little effort to check return values from functions like msWCSGetCapabilities_CoverageOfferingBrief, and so it just effectively skipped the problem layer and went on. This behavior is subideal, in my humble opinion, but I am not inclined to change things at this point. Also, since much of the capabilities document has already been streamed back to the client at this point there is no way we could return a properly formatted error.

Tom also noted that the error was being returned as html instead of xml in the WCS 1.1.x case. I am not clear on why this is or how to properly deal with it. If this is important, it should be filed as a new ticket though it might be hard to trigger a similar error now.

I have corrected the msautotest/wxs/expected/wcs_get_caps.xml which now includes the extra coverage brief values. I'm not sure if there are other wxs test changes needed.

Fixes are in trunk (r9401, r9402, r9403).

comment:18 by warmerdam, 15 years ago

Normand, may I add thanks for a good bug report, sorry for the delay in followup. And thanks to TomK for bumping this again.

comment:19 by nsavard, 15 years ago

RE comment:18

Thank you Frank.

Note: See TracTickets for help on using tickets.