crazy-max / docker-nextcloud

Nextcloud Docker image
MIT License
239 stars 47 forks source link

PostgreSQL Database directory appears to contain a database; Skipping initialization #138

Closed aronmgv closed 1 year ago

aronmgv commented 1 year ago

Support guidelines

I've found a bug and checked that ...

Description

Moved my docker-compose stack to new server and started having this error when trying to run it:

PostgreSQL Database directory appears to contain a database; Skipping initialization

Is there a "hack" to overcome this error/check? Thanks a lot!

Expected behaviour

24.0

Actual behaviour

start db

Steps to reproduce

use following docker-compose config

Docker info

24.0

Docker Compose config

postgres:
    container_name: nextcloud.postgres
    image: postgres:12
    restart: always
    expose:
      - 5432
    volumes:
      - $PWD/postgres:/var/lib/postgresql/data
    environment:
      - TZ
      - PUID
      - PGID
      - POSTGRES_DB=${DB_NAME}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}

Logs

PostgreSQL Database directory appears to contain a database; Skipping initialization

2023-09-07 17:37:11.279 UTC [1] LOG:  starting PostgreSQL 12.16 (Debian 12.16-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2023-09-07 17:37:11.279 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-09-07 17:37:11.279 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-09-07 17:37:11.281 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-09-07 17:37:11.288 UTC [27] LOG:  database system was interrupted; last known up at 2023-09-05 15:06:25 UTC
2023-09-07 17:37:11.524 UTC [27] PANIC:  replication checkpoint has wrong magic 4177909209 instead of 307747550
2023-09-07 17:37:11.760 UTC [1] LOG:  startup process (PID 27) was terminated by signal 6: Aborted
2023-09-07 17:37:11.760 UTC [1] LOG:  aborting startup due to startup process failure
2023-09-07 17:37:11.760 UTC [1] LOG:  database system is shut down
aronmgv commented 1 year ago

Deleting pg_logical/replorigin_checkpoint solved the problem! Thanks