I am following the steps as described in http://wiki.openstreetmap.org/wiki/Nominatim/Installation to install the nominatim osm db on my own server. I need to create some functions before doing

./utils/setup.php <my-planet-file> --load-data

So to create those functions I am running this command:

./utils/setup.php --create-functions

But, it gives me following error:

Error in query: ERROR: could not access file "/home/nominati/public_html/Nominatim/module/nominatim.so": Permission denied

As I can see error occurs while running the following query:

CREATE OR REPLACE FUNCTION transliteration(text) RETURNS text  AS '/home/nominati/public_html/Nominatim/module/nominatim.so', 'transliteration' LANGUAGE c IMMUTABLE STRICT;

I am running the commands with root user and nominatim.so file owner is also root. I already changed the file owner to postgres and tried but the same error is there. Please guide what to do?

asked 27 Jun '12, 07:24

Ravi%20Kotwani's gravatar image

Ravi Kotwani
136669
accept rate: 0%


Found on postgreSQL doc:

"The user ID the PostgreSQL server runs as must be able to traverse the path to the file you intend to load. Making the file or a higher-level directory not readable and/or not executable by the postgres user is a common mistake."

If the full path is reachable, perhaps you need the 'executable' flag on the .so file as well (chmod +x)...

permanent link

answered 27 Jun '12, 10:09

Pieren's gravatar image

Pieren
9.7k2075157
accept rate: 15%

I have already applied the 777 permission to module folder (Directory of .so file). And owner of nominatim.so file is root, I have also already tried it by changing the owner (chown) as postgres, nominatim and etc. But still facing the same problem? Is it a way I can delete this nominatim.so file and get new one with some easy steps?

(27 Jun '12, 10:49) Ravi Kotwani
2

You need to check the permissions not just of the directory, but of the directory's parent, and that directories parent, and... etc.

They all need to be accessible by which ever user you are running postgresql as.

To confirm if this is the case it maybe be helpful to switch to the postgres user and attempt to access the nominatim.so file using the full path. i.e.

su -l postgres ls -alh /home/user/path/path/nominatim.so

(27 Jun '12, 10:51) twain
2

Yeah, and don't forget the execution permission flag on the .so file itself. Rebuilding the .so file is not your current problem since postgreSQL is even not able to access the file.

(27 Jun '12, 10:59) Pieren

@Twain: Thanks for guiding, I just checked the owner of parent -> parent -> parent etc. and set the parent directory permission same as you told and its working fine now. Thanks.

(27 Jun '12, 12:05) Ravi Kotwani

I had the same problem. I checked all privileges and they were ok. I restarted postgres (/usr/bin/pg_ctl stop|start) and then it worked.

(06 Jan '16, 12:06) dusiema
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:

×555
×546
×24
×4

question asked: 27 Jun '12, 07:24

question was seen: 6,363 times

last updated: 06 Jan '16, 12:06

powered by OSQA