docker-postgresql icon indicating copy to clipboard operation
docker-postgresql copied to clipboard

PostgreSQL fails to start: [Errno 13] Permission denied setuser

Open jrjparks opened this issue 10 years ago • 8 comments

Not sure if anyone else has this issue but, using the latest image, postgresql fails to start. Any help will be appreciated.

Note item two of the docker top output._

/usr/bin/runsvdir -P /etc/service log: : [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied

docker run

$ docker run -d --name="postgresql" -p 127.0.0.1:5432:5432 -v /tmp/postgresql:/data -e USER="super" -e DB="database_name" -e PASS="$(pwgen -s -1 16)" paintedfox/postgresql

docker logs

$ docker logs postgresql

*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 9
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...
POSTGRES_USER=super
POSTGRES_PASS=nlMU71xfRsejnrbn
POSTGRES_DATA_DIR=/data
POSTGRES_DB=database_name
Starting PostgreSQL...

docker top

$ docker top postgresql

root                20549               19271               2                   15:46               ?                   00:00:00            /usr/bin/python3 -u /sbin/my_init
root                20578               20549               0                   15:46               ?                   00:00:00            /usr/bin/runsvdir -P /etc/service log: : [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied setuser: cannot execute /usr/lib/postgresql/9.3/bin/postgres: [Errno 13] Permission denied
root                20579               20578               0                   15:46               ?                   00:00:00            runsv postgresql
root                20580               20578               0                   15:46               ?                   00:00:00            runsv syslog-ng
root                20581               20578               0                   15:46               ?                   00:00:00            runsv cron
root                20584               20581               0                   15:46               ?                   00:00:00            /usr/sbin/cron -f
root                20591               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20593               20591               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20594               20580               0                   15:46               ?                   00:00:00            syslog-ng -F -p /var/run/syslog-ng.pid --no-caps
root                20600               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20602               20600               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20607               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20608               20607               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20614               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20616               20614               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20621               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20622               20621               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20628               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20630               20628               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20641               20549               0                   15:46               ?                   00:00:00            /bin/bash ./run
root                20642               20641               0                   15:46               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20648               20549               0                   15:47               ?                   00:00:00            /bin/bash ./run
root                20649               20648               0                   15:47               ?                   00:00:00            inotifywait -q -e create /run/postgresql/
root                20655               20549               0                   15:47               ?                   00:00:00            /bin/bash ./run
root                20656               20655               0                   15:47               ?                   00:00:00            inotifywait -q -e create /run/postgresql/

jrjparks avatar Jun 18 '14 19:06 jrjparks

I can't reproduce. Could you give us some context of your system?

jonmorehouse avatar Jun 19 '14 09:06 jonmorehouse

clean install of ubuntu 14.04 with docker 1.0.0.

Edit for more clarification about hardware: VMware ESXi 5.0 VM v8 4 vCPU 6GB RAM 1x 80GB HDD Ubuntu 14.04 LTS Server x64 1x NIC

jrjparks avatar Jun 19 '14 17:06 jrjparks

I have the same problem. Im also running a freshly installed Ubuntu 14.04

thall avatar Jun 21 '14 17:06 thall

I have the same problem.

richardgill avatar Jun 28 '14 14:06 richardgill

I have the same problem using Ubuntu 14.04

adonespitogo avatar Jul 02 '14 08:07 adonespitogo

Just wanted to add that I'm seeing the same thing. Host is OSX 10.9.

If I use a different box, the issue does not occur:

config.vm.box = "ubuntu/trusty64"

ghost avatar Jul 03 '14 22:07 ghost

I am also facing this problem on a new Ubuntu 14.04 install. But when I change the setuser command back to what it was before (using su), everything works fine. So its either a problem of setuser, the usage of it or a problem in the baseimage..

For quick help, just change the one line in scripts/start.sh from setuser postgres /usr/lib/postgresql/9.3/bin/postgres -D /etc/postgresql/9.3/main back to su postgres -c '/usr/lib/postgresql/9.3/bin/postgres -D /etc/postgresql/9.3/main'

Angel0fDarkness avatar Aug 05 '14 17:08 Angel0fDarkness

I had the same issue and following @Angel0fDarkness suggestion fixed it for me.

radyz avatar Aug 22 '14 22:08 radyz