timescale / timescaledb-docker

Release Docker builds of TimescaleDB
Apache License 2.0
290 stars 128 forks source link

Timescale Docker Issue PG14 #222

Open shaharzoo93 opened 11 months ago

shaharzoo93 commented 11 months ago

Docker File -

FROM timescale/timescaledb-ha:pg14

USER root

Docker Compose -

hot_raw_db:
    build:
      context: ./core_framework/db/hot_raw_db
      dockerfile: Dockerfile
    container_name: hot_raw_db
    stop_grace_period: 1m
    environment:
      - POSTGRES_DB=hot_raw_db
      - POSTGRES_USER=hot_raw_db
      - POSTGRES_PASSWORD=hot_raw_db
      - PGDATA=/var/lib/postgresql/data/pgdata
    command: postgres -c 'max_connections=1000'
    ports:
      - '7001:5432'
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'hot_raw_db']
      interval: 5s
      timeout: 5s
      retries: 5
    volumes:
      - './opt/volume/data/db/postgresql/hot_raw_db:/var/lib/postgresql/data'
    restart: always
    networks:
      - analytics_core_network

We used the above docker configuration for the container but we are facing the below error continuously

image

akuzm commented 11 months ago

Can you please check if this also happens with FROM postgres:14? This way we'll be able to tell if it's something Timescale-specific.

shaharzoo93 commented 11 months ago

Ok

shaharzoo93 commented 10 months ago

Same error with postgres:14

jnidzwetzki commented 9 months ago

Hello @shaharzoo93,

Thank you for getting back. It seems you are mounting an existing data directory into the container:

volumes:
  - './opt/volume/data/db/postgresql/hot_raw_db:/var/lib/postgresql/data'

This is known to be a problematic configuration (see this post and this post) since PostgreSQL can not modify permissions on this mount point.

Could you remove the volume from your docker compose file and try to start the container? Since you ran into the same problem with the PostgreSQL container postgres:14 without any TimescaleDB installation, the chances are high that you are affected by this Docker behavior.

There are some workarounds provided in the postings (e.g., moving the PostgreSQL tmp directory to another location or adding a proper username mapping). Please check if these workarounds help to resolve the problem in your environment.