sameersbn / docker-postgresql

Dockerfile to build a PostgreSQL container image which can be linked to other containers.
MIT License
1.05k stars 467 forks source link

"Corrupted statistics file" errors #84

Open rspeer opened 8 years ago

rspeer commented 8 years ago

I'm running version 9.5-2 of this container on Docker 1.12.1 on Linux, and eventually it starts outputting lots of errors about files in its data volume.

Here are the kind of errors I get:

db_1             | WARNING:  corrupted statistics file "pg_stat_tmp/global.stat"
db_1             | WARNING:  corrupted statistics file "pg_stat_tmp/global.stat"
db_1             | WARNING:  corrupted statistics file "pg_stat_tmp/global.stat"
db_1             | LOG:  could not rename temporary statistics file "pg_stat_tmp/db_0.tmp" to "pg_stat_tmp/db_0.stat": No such file or directory
db_1             | LOG:  could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat": No such file or directory

Here's the docker-compose configuration that launches it:

db:
    restart: always
    image: sameersbn/postgresql:9.5-2
    expose:
      - "5432"
    environment:
      - DEBUG=false
      - PG_TRUST_LOCALNET=true
      - DB_NAME=conceptnet5
    volumes:
      - /bigdrive/conceptnet5.5/postgresql:/var/lib/postgresql
rspeer commented 8 years ago

Once this happens, if I shut down the container, it never comes back up.

I get this message:

pg_ctl: could not start server
Examine the log output.

...but there is no log output. The container's /var/log/postgresql/postgresql-9.5-main.log is empty.

LongLiveCHIEF commented 7 years ago

This sounds like a permissions error to me, and is likely related to UID/GID mapping. Do you know if there are any other postgres containers, or postgres, running on your host?

Try setting the UID/GID mapping env variables and see what happens.