NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi, I've been following the instruction on the github page for installing the Rails Port, and have successfully completed all of those instructions. I am now trying to populate the database following the instructions here. I've tried running the osmosis command:

osmosis --read-pbf [my-osm-file].osm.pbf --write-apidb host="localhost" database="openstreetmap" user="openstreetmap" password="" validateSchemaVersion="no"

However, it initially gives me an error that argument 7 (password) doesn't contain a value after the '=', so I removed that field. Now it is giving me a password authentication failed error for user "openstreetmap".

I tried manually logging into the openstreetmap database by running the following command:

psql -d openstreetmap -U openstreetmap

and I get this error:

psql: FATAL: Peer authentication failed for user "openstreetmap"

Running the same command but with my own username allows me to log into the database. So then I tried the osmosis command with the username replaced with mine, but it still gives me a password authentication failure error. I'm stuck now as to what to try next. Any suggestions would be very much appreciated.

asked 21 Dec '16, 15:05

AndrewPalmer's gravatar image

AndrewPalmer
16112
accept rate: 0%


Try

sudo -u postgres psql -c "alter role openstreetmap with password 'openstreetmap'"

and then specify "openstreetmap" as a password in your osmosis command line. You will then also be able to do

psql -W -d openstreetmap -U openstreetmap

and log in to the database with the password. (Logging in without password, as you tried above, would require "trust" authentication configured in pg_hba.conf or a special configuration of the "peer" authentication method to allow your Unix user to connect as PostgreSQL user "openstreetmap".)

permanent link

answered 21 Dec '16, 16:19

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 21 Dec '16, 16:19

1

Thanks, adding the password worked.

(22 Dec '16, 10:06) AndrewPalmer

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:

×252
×29

question asked: 21 Dec '16, 15:05

question was seen: 3,055 times

last updated: 22 Dec '16, 10:06

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum