geo-data / openstreetmap-tiles-docker

The OpenStreetMap Tile Server in a Docker container
218 stars 147 forks source link

FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied #3

Open warmwater opened 10 years ago

warmwater commented 10 years ago

Hi When I try to run initdb then run startdb (or service postgresql start),it keeps showing following error message:

FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied

homme commented 10 years ago

I am assuming you are mounting the same volume from the host when running initdb and startdb. Do you get the same problem when running the commands in series in the same container e.g.

docker run -v /tmp/osm-postgresql:/var/lib/postgresql homme/openstreetmap-tiles initdb startdb

Also do a docker pull homme/openstreetmap-tiles to ensure you are running an up to date image.

warmwater commented 10 years ago

Thanks for response

yes I encounter the same problem when I run the commands in series

warmwater commented 10 years ago

Temp solution: I disabled ssl in postgresql.conf, then "run startdb" works fine now.

I create a container and "run initdb" using the bash prompt. Then edit postgresql.conf to set ssl disabled, then "run startdb", and it works.

So I continued to "run createuser createdb", all looks good. However, I can not find "migrate" function in run script. What does this function do? and where do I find it?

anyway, I can import osm file and start service now. I am happy :)

Thanks for help.

clkao commented 10 years ago

This is likely caused by using docker aufs storage backend. switching to devicemapper or btrfs should fix this.

PoCk3T commented 9 years ago

@warmwater : how did you disabled ssl in postgresql.conf ?

I went to /data/osm-postgresql/9.3/main/postgresql.conf, uncommented the "ssl = off" line, tried to "startdb" again, even "initdb startdb", but ....

I still got the very same error related to "FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied"

What did I do wrong ?

Thanks in advance :)

PoCk3T commented 9 years ago

My own workaround:

Just after you installed Docker, add this line to /etc/default/docker: DOCKER_OPTS="--storage-driver=devicemapper"

Worked like a charm for me :)

PS : source = https://github.com/Painted-Fox/docker-postgresql/issues/30#issuecomment-61350621