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

laradock_postgres container exist immediately after starting #2189

Closed
menadio opened this issue Jun 28, 2019 · 5 comments
Closed

laradock_postgres container exist immediately after starting #2189

menadio opened this issue Jun 28, 2019 · 5 comments
Labels

Comments

@menadio
Copy link

menadio commented Jun 28, 2019

Info:

  • Docker version ($ docker --version): 18.06.0-ce
  • Laradock commit ($ git rev-parse HEAD): ca80dd1
  • System info (Mac, PC, Linux): PC (Dell Inspiron 7573)
  • System info disto/version: Windows 10 Home

Issue:

This is my first attempt using laradock for containerizing a laravel app using Docker Toolbox on windows. I tried to set up an nginx, postgres and pgadmin environment but only the postgres container fails. So it gets started then exits immediately. The logs show that the error

FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
HINT:  The server must be started by the user that owns the data directory.

Expected behavior:

Like nginx server and pgadmin containers, postgres container should be up so the laravel app can be connected.

Reproduce:

docker-compose up -d postgres

Relevant Code:

Full log

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 20
selecting default shared_buffers ... 400kB
selecting default timezone ... UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
2019-06-28 14:27:44.010 UTC [47] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
2019-06-28 14:27:44.010 UTC [47] HINT:  The server must be started by the user that owns the data directory.
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/data"
running bootstrap script ...
@raducristyan
Copy link

This issue can be fixed by creating a volume and ataching it to postgres container. I had the same issue on Windows 10.

@garbinmarcelo
Copy link
Contributor

This issue can be fixed by creating a volume and ataching it to postgres container. I had the same issue on Windows 10.

How did you do it? could show the settings/code? Thanks

@stale
Copy link

stale bot commented Feb 7, 2020

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Feb 7, 2020
@stale
Copy link

stale bot commented Feb 28, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 28, 2020
@dendihandian
Copy link

dendihandian commented May 30, 2020

docker-compose up -d postgres pgadmin
C:\Users\dhn\git\laradock>docker-compose ps
           Name                          Command                State                         Ports                     
------------------------------------------------------------------------------------------------------------------------                
laradock_pgadmin_1            /entrypoint.sh                   Up         443/tcp, 0.0.0.0:5050->80/tcp                                         
laradock_postgres_1           docker-entrypoint.sh postgres    Exit 1
C:\Users\dhn\git\laradock>docker-compose logs postgres
Attaching to laradock_postgres_1
postgres_1             | The files belonging to this database system will be owned by user "postgres".
postgres_1             | This user must also own the server process.
postgres_1             |
postgres_1             | The database cluster will be initialized with locale "en_US.utf8".
postgres_1             | The default database encoding has accordingly been set to "UTF8".
postgres_1             | The default text search configuration will be set to "english".
postgres_1             |
postgres_1             | Data page checksums are disabled.
postgres_1             |
postgres_1             | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres_1             | creating subdirectories ... ok
postgres_1             | selecting default max_connections ... 20
postgres_1             | selecting default shared_buffers ... 400kB
postgres_1             | selecting default timezone ... UTC
postgres_1             | selecting dynamic shared memory implementation ... posix
postgres_1             | creating configuration files ... ok
postgres_1             | 2020-05-30 16:16:26.186 UTC [47] FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
postgres_1             | 2020-05-30 16:16:26.186 UTC [47] HINT:  The server must be started by the user that owns the data directory.
postgres_1             | child process exited with exit code 1
postgres_1             | initdb: removing contents of data directory "/var/lib/postgresql/data"
postgres_1             | running bootstrap script ...

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

No branches or pull requests

4 participants