镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Network error should not result in a Apache syntax error for a WMTS source #357

Description

@marisn

Our national mapping agency struggles to keep their ArcGIS based servers up and running all the time – quite often they reply with an error (e.g. 503). Unfortunately in a such case, it is not possible to operate MapCache, as it fails when a configuration file is parsed. This is bad as a single broken WMTS source means that Apache process will fail to start. It is also impossible to use (undocumented!) fallback source, as each individual source is parsed first.

The GDAL source performs some checks on data source that requires opening of the source thus I don't see how to easily work around the issue.

if( GDALGetProjectionRef( hDataset ) != NULL

# apachectl configtest
ERROR 1: HTTP error code : 503
ERROR 1: Missing Capabilities.Contents element
AH00526: Syntax error on line 58 of /etc/apache2/sites-enabled/prod.conf:
gdalOpen failed on data /home/conf/source.xml

Activity

  1. tbonfort commented on Aug 25, 2025

    @tbonfort
    Member

    The configuration check is actually only needed to set/cache src->srs_wkt. I believe it would be relatively easy to defer this caching when actually accessing a metatile.
    NB: this deferred check/caching should be protected by a mutex, as it will potentially be ran concurrently, in pseudo-code:

    if src->srs_wkt == NULL:
      aquire_mutex()
      if src->srs_wkt == NULL:
        call gdal methods to get srs_wkt
        if error: //i.e. your 503
          release_mutext()
          return error
        src->srs_wkt = srs_wkt
      release_mutex()
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions