wiki:MapServerErrors

MapServer Errors


Note: a full list of errors can be found on the main Errors page


Here are descriptions of error messages from MapServer and solutions.

  • User Visible Errors contains error messages or symptoms which are visible to users.
  • Technical Problems contains information which may be visible to maintainers but not users.

A Technical Problems entry is likely to have in User Visible Errors a description of a user-visible symptom.

  • If you get an error message which is not in this list, add your new message and a summary of when it happens.
  • Update if you learn more about a problem.
  • Also consider reviewing the suggestions in DebuggingMapserver for diagnosing issues.
  • Items that are clearly reproducible bugs should be reported via the MapServer Issue Tracker with all the details needed to reproduce the error.

User Visible Errors

No query information to decode. QUERY_STRING is set, but empty

The MapServer program has been run but without information which tells it what to do. This is what is seen when the MapServer script is run by a web browser with no options. MapServer is intended to be run by a link with a URL which contains parameters to describe the desired map.

msLoadMap(): Unable to access file. (/data/tutorial/example1-1.map)

The specified file could not be accessed.

  • The location of the file in the URL might be wrong.
  • The permissions of the file or its directories may need adjustment.
  • The script might have a different root directory than expected.
    • The URL in the referencing .html file could be changed.
    • The DocumentRoot in the web server could be changed.
      • (is there a single file in which to define MapServer's root?)

Information about file placement is in http://www.mapserver.org/utilities/manage.html

  • (How to find out where an installation of mapserv is trying to access files? Particularly if access fails.) Assuming /var/www/html is the web server's document root, the location of /data might actually be:
    • /var/www/cgi-bin/data
    • /var/www/htdocs/data
    • /var/www/html/data
    • /var/www/data
    • /data
      • (If the MapServer Tutorial is referring to /data, what can be changed to have MapServer find data elsewhere?)

500 Internal Server Error

  • The server encountered an internal error or misconfiguration and was unable to complete your request.

Something went wrong.

Error reported was 'could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?

The people in charge of the MapServer installation will have to check the .map file and database server. Email them the error and the URL which you used. The URL is probably visible at the top of your web browser as text which begins "http://...". Probably a double-click will highlight the URL, Control-C will copy it, and in your mail program you can use Control-V to paste it in.

Technical Problems

Premature end of script headers: /var/www/cgi-bin/mapserver

  • See also Internal Server Error

500 Internal Server Error

  • The server encountered an internal error or misconfiguration and was unable to complete your request.

Something went wrong.

  • As mentioned in DebuggingMapserver, the MS_ERRORFILE environment variable can be made to point to a file so as to make available MapServer errors.

mapserv: error while loading shared libraries: libXXX.so: cannot load shared object file: No such file or directory

Error reported was 'could not connect to server: Connection refused. Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?

  • This implies that a .map file is referring to a PostgreSQL PostGIS database.
    • See the debugging suggestions in the PostGIS page.
    • Was PostgreSQL server installed? There probably would be a program "postmaster" installed. Try man postmaster to see if that exists.
      • Was the PostgreSQL server started? In ps fax there should be a program "postmaster" running.
      • Test connection to the DB server with a PostgreSQL client.
        • If the DB server is on the web server machine, psql -l may show a list of databases.
        • A username and password may be necessary: psql -U readonlyuser --password -l will connect as user readonlyuser (if that exists) and ask for its password.
        • The MapServer would connect through 127.0.0.1, also called loopback: psql --host localhost -U readonlyuser --password -l
  • Check for errors from the web server and in syslog for PostgreSQL errors.
  • If there are no errors in syslog, you may need to configure the PostgreSQL server to log errors.
    • Try locate postgresql.conf to find the file. It might be in /var/lib/pgsql/data.
    • The PostgreSQL configuration file has options for where to log and what to log.
  • Maybe the database server is simply not listening to TCP requests.
    • A netstat -an | grep 5432 should show TCP port 5432 has a listener.
      • Read the netstat output closely, as a /tmp file with 5432 in the name is not a TCP port.
    • The database server configuration for TCP/IP is in the previously mentioned postgresql.conf file.
    • There also should be a 127.0.0.1 entry in the file pg_hba.conf to allow access by users through loopback TCP/IP connections.
Last modified 8 years ago Last modified on Jan 27, 2009 1:43:01 PM