Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gawbul opened this issue Dec 1, 2014 · 9 comments

Comments

@gawbul
Copy link
Contributor

gawbul commented Dec 1, 2014

Getting the following error when using the image:

# docker run -i -t nimiq/postgresql93 /sbin/my_init -- bash
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/01_start_postgresql.sh...
 * Starting PostgreSQL 9.3 database server                                                                                                                       * The PostgreSQL server failed to start. Please check the log output:
2014-12-01 17:41:37 UTC FATAL:  could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
                                                                                                                                                         [fail]
*** /etc/my_init.d/01_start_postgresql.sh failed with status 1

*** Killing all processes...
@gawbul
Copy link
Contributor Author

gawbul commented Dec 1, 2014

See comments here puntonim/ansible-biostar#30.

@gawbul
Copy link
Contributor Author

gawbul commented Dec 1, 2014

This is a Docker AUFS bug (moby/moby#783) - workaround is to roll back to phusion/baseimage:9.1.13 rather then latest. This is recommend by phusion anyway - https://github.com/phusion/baseimage-docker#getting_started.

@gawbul
Copy link
Contributor Author

gawbul commented Dec 1, 2014

Lol, just opened this #3 but you beat me to it ;)

@gawbul
Copy link
Contributor Author

gawbul commented Dec 3, 2014

Started hitting this with 0.9.13 too... must be AUFS issue.

Running docker -D info from DigitalOcean server confirms AUFS:

$ docker -D info
Containers: 1
Images: 25
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 27
Execution Driver: native-0.2
Kernel Version: 3.13.0-37-generic
Operating System: Ubuntu 14.04.1 LTS
Debug mode (server): false
Debug mode (client): true
Fds: 10
Goroutines: 12
EventsListeners: 0
Init Path: /usr/bin/docker
WARNING: No swap limit support

Work around here moby/moby#783 (comment).

Ideal solution is to switch docker to use devmapper for storage as per Painted-Fox/docker-postgresql#30 (comment).

@gawbul
Copy link
Contributor Author

gawbul commented Dec 3, 2014

Submitted a new pull request (#4) to implement this workaround. Will change ansible-biostar to use devicemapper instead of AUFS too, but this fix will solve for non ansible users.

@atulya
Copy link

atulya commented Jun 24, 2015

Try this
sudo chown postgres:postgres /etc/ssl/private/ssl-cert-snakeoil.key

@igorsantos07
Copy link

igorsantos07 commented May 10, 2016

For those who felt here as well, using chown/chmod (as suggested above) will not work.
However, the workaround linked by gawbul do work: mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private

@ianchute
Copy link

ianchute commented Jun 9, 2016

omg it works!

@abarrere
Copy link

abarrere commented Mar 9, 2018

It works ! thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants