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

Timescale Docker Issue PG14 #222

Open
shaharzoo93 opened this issue Nov 6, 2023 · 4 comments
Open

Timescale Docker Issue PG14 #222

shaharzoo93 opened this issue Nov 6, 2023 · 4 comments

Comments

@shaharzoo93
Copy link

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

@shaharzoo93 shaharzoo93 changed the title Timescale Docker Image Issue Timescale Docker Image Issue PG14 Nov 6, 2023
@shaharzoo93 shaharzoo93 changed the title Timescale Docker Image Issue PG14 Timescale Docker Issue PG14 Nov 6, 2023
@akuzm
Copy link
Member

akuzm commented Nov 6, 2023

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
Copy link
Author

Ok

@shaharzoo93
Copy link
Author

Same error with postgres:14

@jnidzwetzki
Copy link
Contributor

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.

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

3 participants