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

Postgres container fails to launch #919

Closed
mboisvertdupras opened this issue May 8, 2017 · 10 comments
Closed

Postgres container fails to launch #919

mboisvertdupras opened this issue May 8, 2017 · 10 comments

Comments

@mboisvertdupras
Copy link

Info:

  • Docker version ($ docker --version): 17.03.1-ce, build c6d412e
  • Laradock commit ($ git rev-parse HEAD): 0e0dc44
  • System info (Mac, PC, Linux): MacOS
  • System info disto/version: 10.12.4

Issue:

What seems to be going wrong?

With a fresh copy of laradock, the postgres container fails to launch.


Expected behavior:

What should be happening instead?

Self-explanatory


Reproduce:

How might we be able to reproduce the error?

docker-compose up -d postgres


Relevant Code:

Console output:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
2017-05-08T16:31:05.846593429Z 
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".
2017-05-08T16:31:05.846867875Z 
Data page checksums are disabled.
2017-05-08T16:31:05.846872770Z 
initdb: directory "/var/lib/postgresql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data" or run initdb
with an argument other than "/var/lib/postgresql/data".
@FMate
Copy link

FMate commented Jul 1, 2017

I have a same problem. My solution was add to docker-compose.yml file - PGDATA=/tmp in postgres container.

Like this:
`### PostgreSQL Container ####################################

postgres:
  build: ./postgres
  volumes:
    - ${DATA_SAVE_PATH}/postgres:/var/lib/postgresql/data
  ports:
    - "${POSTGRES_PORT}:5432"
  environment:
    - POSTGRES_DB=${POSTGRES_DB}
    - POSTGRES_USER=${POSTGRES_USER}
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - PGDATA=/tmp
  networks:
    - backend`

@rlindner81
Copy link

Can confirm, I had this bug and the suggested addition fixes it

@yblondeau
Copy link

I had the same issue also and the suggested edit to the docker-compose.yml file fixed it.

Info:

  • Docker version ($ docker --version): 17.09.0-ce, build afdb6d4
  • Laradock commit ($ git rev-parse HEAD): 9877f0453ef5d1c8f556403804f8f21df2618de6
  • System info (Mac, PC, Linux): Windows
  • System info disto/version: 10 Pro

@dmz9
Copy link

dmz9 commented Apr 29, 2018

helped - PGDATA=/tmp

@mhaagens
Copy link

mhaagens commented May 5, 2018

Setting PGDATA=/tmp worked for me as well!

@SalahAdDin
Copy link

@FMate Thank you very much man.

But, does it affect the our database persistence?

@eloyekunle
Copy link

I think it will affect the database persistence since everything is lost on reboot.

@abhijitgujar86
Copy link

Thanks @FMate but @eloyekunle and @SalahAdDin is right the data is not persistent on reboot everything is lost. does any one know better solution.

@stale
Copy link

stale bot commented Feb 2, 2020

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 2, 2020
@stale
Copy link

stale bot commented Feb 23, 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 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests