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

The database is running in a loop with errors #1156

Open
miltuss opened this issue Jan 13, 2025 · 0 comments
Open

The database is running in a loop with errors #1156

miltuss opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@miltuss
Copy link

miltuss commented Jan 13, 2025

I launched Mediacms with dockge, but mediacms-db-1 produces errors!

How to solve this problem?

There are these two lines of logs which are displayed at the very beginning

WARN[0000] The "POSTGRES_DB" variable is not set. Defaulting to a blank string. 
WARN[0000] The "POSTGRES_USER" variable is not set. Defaulting to a blank string. 

Here are the mediacms-db-1 logs, these logs loop and the healthcheck indicates that there was a connection rejection

PostgreSQL Database directory appears to contain a database; Skipping initialization


2025-01-13 22:17:38.191 CET [1] LOG:  starting PostgreSQL 15.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit

2025-01-13 22:17:38.191 CET [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432

2025-01-13 22:17:38.191 CET [1] LOG:  listening on IPv6 address "::", port 5432

2025-01-13 22:17:38.199 CET [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2025-01-13 22:17:38.212 CET [20] LOG:  database system was interrupted while in recovery at 2025-01-13 22:17:37 CET

2025-01-13 22:17:38.212 CET [20] HINT:  This probably means that some data is corrupted and you will have to use the last backup for recovery.

2025-01-13 22:17:39.765 CET [20] LOG:  database system was not properly shut down; automatic recovery in progress

2025-01-13 22:17:39.790 CET [20] LOG:  redo starts at 0/1501598

2025-01-13 22:17:39.951 CET [20] FATAL:  could not create file "base/16384/2615_fsm": File exists

2025-01-13 22:17:39.951 CET [20] CONTEXT:  WAL redo at 0/18C7DF0 for Storage/CREATE: base/16384/2615_fsm

2025-01-13 22:17:39.960 CET [1] LOG:  startup process (PID 20) exited with exit code 1

2025-01-13 22:17:39.960 CET [1] LOG:  terminating any other active server processes

2025-01-13 22:17:39.961 CET [1] LOG:  shutting down due to startup process failure

2025-01-13 22:17:39.964 CET [1] LOG:  database system is shut down


PostgreSQL Database directory appears to contain a database; Skipping initialization

Here is the docker-compose file

version: "3"
services:
  migrations:
    image: mediacms/mediacms:latest
    volumes:
      - /Apps/mediacms/git/mediacms:/home/mediacms.io/mediacms/
    environment:
      ENABLE_UWSGI: no
      ENABLE_NGINX: no
      ENABLE_CELERY_SHORT: no
      ENABLE_CELERY_LONG: no
      ENABLE_CELERY_BEAT: no
      ADMIN_USER: admin
      ADMIN_EMAIL: admin@localhost
      ADMIN_PASSWORD: passwordtestmediacms
    command: ./deploy/docker/prestart.sh
    restart: on-failure
    depends_on:
      redis:
        condition: service_healthy
      db:
        condition: service_healthy
  web:
    image: mediacms/mediacms:latest
    deploy:
      replicas: 1
    ports:
      - 8220:80
    volumes:
      - /Apps/mediacms/git/mediacms:/home/mediacms.io/mediacms/
    environment:
      ENABLE_CELERY_BEAT: no
      ENABLE_CELERY_SHORT: no
      ENABLE_CELERY_LONG: no
      ENABLE_MIGRATIONS: no
    depends_on:
      - migrations
  celery_beat:
    image: mediacms/mediacms:latest
    volumes:
      - /Apps/mediacms/git/mediacms:/home/mediacms.io/mediacms/
    environment:
      ENABLE_UWSGI: no
      ENABLE_NGINX: no
      ENABLE_CELERY_SHORT: no
      ENABLE_CELERY_LONG: no
      ENABLE_MIGRATIONS: no
    depends_on:
      - redis
  celery_worker:
    image: mediacms/mediacms:latest
    deploy:
      replicas: 1
    volumes:
      - /Apps/mediacms/git/mediacms:/home/mediacms.io/mediacms/
    environment:
      ENABLE_UWSGI: no
      ENABLE_NGINX: no
      ENABLE_CELERY_BEAT: no
      ENABLE_MIGRATIONS: no
    depends_on:
      - migrations
  db:
    image: postgres:15.2-alpine
    volumes:
      - /Apps/mediacms/postgres_data:/var/lib/postgresql/data/
    restart: always
    environment:
      POSTGRES_USER: mediacms
      POSTGRES_PASSWORD: mediacms
      POSTGRES_DB: mediacms
      PGUSER: mediacms
      TZ: Europe/Berlin
    healthcheck:
      test:
        - CMD-SHELL
        - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
        - --host=db
        - --dbname=$POSTGRES_DB
        - --username=$POSTGRES_USER
      interval: 10s
      timeout: 5s
      retries: 5
  redis:
    image: redis:alpine
    restart: always
    healthcheck:
      test:
        - CMD
        - redis-cli
        - ping
      interval: 30s
      timeout: 10s
      retries: 3
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

2 participants