Hello,

I am using the instructions found at https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ to setup a OSM mapping server. If the ubuntu user matches the postgresql user ( i.e. renderaccount) everything works without any problems.

However, I would like to get stuff to work where the ubuntu user is XXX and the postgresql user remains renderaccount.

I can get past most issues by:

  1. changing pg_hba.conf so:

    local   all             all                                     peer
    

    looks like:

    local   all             all                                     md5
    
  2. Setting the PGUSER environment variable to renderaccount

  3. adding ::gis:renderaccount:<password> to ~/.pgpass

However, when I am ready to startup the renderer by doing:

renderd -f -c /usr/local/etc/renderd.conf

I am presented with the errors:

renderd[47532]: An error occurred while loading the map layer 'ajt': Postgis Plugin: fe_sendauth: no password supplied
Connection string: ' dbname=gis connect_timeout=4'
  encountered during parsing of layer 'landcover-low-zoom' in Layer at line 765 of '/home/lander/src/openstreetmap-carto-de/osm.xml'
renderd[47532]: An error occurred while loading the map layer 'ajt': Postgis Plugin: fe_sendauth: no password supplied
Connection string: ' dbname=gis connect_timeout=4'
  encountered during parsing of layer 'landcover-low-zoom' in Layer at line 765 of '/home/lander/src/openstreetmap-carto-de/osm.xml'
renderd[47532]: An error occurred while loading the map layer 'ajt': Postgis Plugin: fe_sendauth: no password supplied
Connection string: ' dbname=gis connect_timeout=4'
  encountered during parsing of layer 'landcover-low-zoom' in Layer at line 765 of '/home/lander/src/openstreetmap-carto-de/osm.xml'
renderd[47532]: An error occurred while loading the map layer 'ajt': Postgis Plugin: fe_sendauth: no password supplied
Connection string: ' dbname=gis connect_timeout=4'
  encountered during parsing of layer 'landcover-low-zoom' in Layer at line 765 of '/home/lander/src/openstreetmap-carto-de/osm.xml'

I am assuming what is going on is that it is trying to talk to the database using the renderaccount user, but because there is a password, it cannot and does not try to look at the .pgpass file.

This seems to be an issue with postgis...

What might I need to change so the rendering system can use the specific user I specify?

Regards, Willie

asked 23 Sep, 13:07

Willie_H's gravatar image

Willie_H
1614
accept rate: 0%


You might have to add the username and password to the XML style that is processed my mapnik/renderd, or if you prefer add it to the project.mml file before you execute the "carto" command to process that into an XML file. There's a "osm2pgsql" section near the start of the mml file that has database access information:

osm2pgsql: &osm2pgsql
    type: "postgis"
    dbname: "gis"
    key_field: ""
    geometry_field: "way"
    user: "renderaccount"
    password: "password"
    extent: "-20037508,-20037508,20037508,20037508"
permanent link

answered 23 Sep, 15:30

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
71.3k846451113
accept rate: 24%

edited 23 Sep, 19:43

This is what that section currently looks like in the project.mml I am using...

osm2pgsql: &osm2pgsql
    type: "postgis"
    dbname: "gis"
    key_field: ""
    geometry_field: "way"
    extent: "-20037508,-20037508,20037508,20037508"

where is this section documented? I am not certain what the keys should be.

(23 Sep, 15:48) Willie_H

Ok. I was able to find the keys that one needed to use:

osm2pgsql: &osm2pgsql
    type: "postgis"
    dbname: "gis"
    key_field: ""
    geometry_field: "way"
    user: "renderaccount"
    password: "password"
    extent: "-20037508,-20037508,20037508,20037508"

If you wanted to add this to your answer to make it complete, I will mark it as the answer.

(23 Sep, 16:10) Willie_H

sorry for being imprecise, and glad you found it.

(23 Sep, 19:43) Frederik Ramm ♦

Need one more detail. As it turns out, /etc/postgresql/10/main/pg_hba.conf needs to be edited as well to say:

local   all             all                                     trust

(Although, I am not quite sure why this is necessary and it may mean (checked at the moment) that the password entry in the osm2pgsql section is unnecessary.

Can you add that to your answer as well?

(23 Sep, 20:48) Willie_H
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×146
×122
×85

question asked: 23 Sep, 13:07

question was seen: 235 times

last updated: 23 Sep, 20:49

powered by OSQA