[GIS] How to debug “msProcessProjection(): Projection library error. no system list, errno: 2” error in mapserver

mapserver

I think I have a misconfiguration in my mapserver that is preventing it from serving up imagery.

In my map file, I have this section:

  PROJECTION
    "init=epsg:4326"
  END

If I leave that section in, I get this error when calling GetMap or even GetCapabilities:

msProcessProjection(): Projection library error. no system list, errno: 2

If I remove that section (not desirable), GetCapabilities works, but GetMap gives this error:

<ServiceExceptionReport version="1.1.1">
    <ServiceException code="InvalidSRS">msWMSLoadGetMapParams(): WMS server error. Cannot set new SRS on a map that doesn&#39;t have any projection set. Please make sure your mapfile has a projection defined at the top level.</ServiceException>
</ServiceExceptionReport>

Which is expected because I just removed the section.

So, my question is how do I debug the error: msProcessProjection(): Projection library error. no system list, errno: 2?

Searching online, I see comments related to permissions, but apache (user running httpd) can access the following directories defined in my httpd.conf:

SetEnv LD_LIBRARY_PATH /some/place/lib/
SetEnv PROJ_LIB /some/place/share/proj/
SetEnv GDAL_DATA /some/place/share/gdal/
SetEnv LC_NUMBERIC C
SetEnv GEOTIFF_CSV /some/place/share/gdal/
SetEnv LANG=C

In /some/place/share/proj, there is a file epsg that is as I expect.

I get no errors from apache.

Best Answer

A couple of thoughts. It is somewhat difficult to diagnose this without looking at your mapfile, but here goes:

  1. You should try setting your PROJ_LIB variable to /some/place/share/proj/nad/ That is where the epsg file should be located.

  2. Enable debugging. Set it to level 5. You will need to set up an error log file too. See more info her in the MapServer docs http://mapserver.org/mapfile/map.html

I am guessing that either the path to the epsg database is wrong or your user doesn't have rights to read it.

I this isn't the problem, I would look at whether you have set all of the layer and map level metadata in your MapFile that is necessary to serve as a WMS server. More info here: http://mapserver.org/ogc/wms_server.html Make sure that you have set a valid SRS/CRS in your WMS metadata.

Related Question