kartoza / docker-postgis

Dockerfile for postgis
GNU General Public License v2.0
648 stars 317 forks source link

Not accepting environment from docker-compsoe file #462

Closed egistic closed 5 months ago

egistic commented 10 months ago

What is the bug or the crash?

db_default_kartoza_1 | 2023-11-06 10:39:26.291 UTC [72] FATAL: "min_wal_size" must be at least twice "wal_segment_size" db_default_kartoza_1 | 2023-11-06 10:39:26.291 UTC [72] LOG: database system is shut down

Steps to reproduce the issue

Docker-compose file:

version: "3"
services:
  db_default_kartoza:
    image: "kartoza/postgis:latest"
    volumes:
      - "postgis_kartoza:/var/lib/postgresql"
      - "./dbbackups:/backups"
    expose:
      - "5432"
    ports:
      - "5432:5432"
    env_file:
      - parameters.env
    command: echo  $TEST
volumes:
  postgis_kartoza:
    external: true

parameters.env file:

POSTGRES_DBNAME=test POSTGRES_USER=docker POSTGRES_PASS=123456 ALLOW_IP_RANGE=0.0.0.0/0 POSTGRES_MULTIPLE_EXTENSIONS=hstore,postgis_topology,postgis_raster,pgrouting EXTRA_CONF=max_connections=500 WAL_SIZE=4GB MIN_WAL_SIZE=2GB WAL_SEGSIZE=128 MAINTAINANCE_WORK_MEM=1GB SHARED_BUFFERS=2GB WORK_MEM=32MB WAL_BUFFERS=4MB RUN_AS_ROOT=true TEST= TEST1

Versions

Postgresql 16

Additional context

No response

eriktelepovsky commented 6 months ago

I have same issue:

version: '3.9'

services:
  db:
    image: kartoza/postgis:15-3.4
    environment:
      WAL_SIZE: '4GB'
      MIN_WAL_SIZE: '2048MB'
      WAL_SEGSIZE: '1024'

Logs:

2024-03-02 21:56:41.037 UTC [125] FATAL:  "min_wal_size" must be at least twice "wal_segment_size"
2024-03-02 21:56:41.038 UTC [125] LOG:  database system is shut down
NyakudyaA commented 6 months ago

Are you using replication all, you should skip setting those values, and run without

eriktelepovsky commented 6 months ago

Sorry, I don’t understand you. We need to set those values, why should we run container without them?

NyakudyaA commented 6 months ago

Sorry, I don’t understand you. We need to set those values, why should we run container without them?

Those values are meant to be used for replication. If you don't intent to use them just not set them and the contianer will use default settings. Otherwise for accurate value please use the following https://pgtune.leopard.in.ua/

egistic commented 6 months ago

This works for me:

environment:
  - "POSTGRES_DBNAME=123"
  - "POSTGRES_USER=123"
  - "POSTGRES_PASS=123"
  - "ALLOW_IP_RANGE=0.0.0.0/0"
  - "POSTGRES_MULTIPLE_EXTENSIONS=hstore,postgis_topology,postgis_raster,pgrouting"
  - "EXTRA_CONF=max_connections=500"
  - "WAL_SIZE=8GB"
  - "MIN_WAL_SIZE=4096MB"
  - "WAL_SEGSIZE=2048"
  - "MAINTAINANCE_WORK_MEM=1024MB"
  - "SHARED_BUFFERS=40GB"
  - "WORK_MEM=512MB"
  - "WAL_BUFFERS=258MB"
  - "RUN_AS_ROOT=true"
  - "max_worker_processes=24"
  - "max_parallel_workers_per_gather=24"
eriktelepovsky commented 6 months ago

Thx @egistic btw. you have typo in MAINTAINANCE_WORK_MEM. Should be MAINTENANCE_WORK_MEM.

egistic commented 6 months ago

@eriktelepovsky I also confused with this typo, but it's how it is, was taken from readme file. You can do search in repo=)

eriktelepovsky commented 6 months ago

Oh, @egistic you are actually right! Maybe we should point this typo to @NyakudyaA

NyakudyaA commented 6 months ago

Oh, @egistic you are actually right! Maybe we should point this typo to @NyakudyaA

Thanks for picking this up. Can you do a PR to fix this otherwise will check if when I have a moment

NyakudyaA commented 5 months ago

resolved