mapnik gis authentication error during boot

858 views Asked by At

I am using tilelite to serve up maps. I need it to run at the time the server is started. I have built a script that runs the following command at startup:
/usr/local/bin/liteserv.py /home/Uname/bin/mapnik/my_osm.xml --caching --debug=False
The process is failing with:
FATAL: Ident authentication failed for user "user_name" (encountered during parsing of layer 'leisure')
According to this page:

http://wiki.openstreetmap.org/wiki/Mapnik#Authentication_failed

I ran the following command:

./generate_xml.py osm.xml my_osm.xml --accept-none --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/

Now I get:

RuntimeError: PSQL error:
FATAL: Ident authentication failed for user "root" (encountered during parsing of layer 'leisure')

I am really new to postgres so could someone give me some very simple insructions on how to fix this.

1

There are 1 answers

3
Dane Springmeyer On BEST ANSWER

If you call ./generate_xml.py --help you will see the various options. One of them is --user. If you do not supply it and also pass --accept-none then no specific user will be written into the Mapnik XML, which means that when Mapnik attempts to connect to the postgres database the current user will be used. So, if you run that script as root, 'root' will be used.

So, you need to either run that script as a unix user that can connect to postgres, or you need to go back and regenerate the XML and embed the name of a user that can connect to postgres. The latter is likely easier. Here is what I would do:

Assuming your normal unix use is named 'heman' do:

$ sudo su postgres
$ createuser heman # make superuser
$ exit
$ ./generate_xml.py osm.xml --accept-none --user heman --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/
$ liteserv.py osm.xml --caching --debug=False

More details on postgres and how to enable "trust" so that you can connect as the "postgres" user here: http://dbsgeo.com/foss4g2010/html/troubleshooting.html#troubleshooting-postgresql-connections