Postgres: could not find the database system Error

I am on a Docker setup of Metasfresh

I get the following error:

db_1 | postgres: could not find the database system
db_1 | Expected to find it in the directory “/var/lib/postgresql/data”,
db_1 | but could not open file “/var/lib/postgresql/data/global/pg_control”: No such file or directory

Database issue.

Hi @Atul_TK

Looks to me like something changed with the ./volumes/db directory located on your dockerhost.
This is where all /var/lib/postgresql/ files are exposed to.
You can check that in your docker-compose.yml file as well:

    - ./volumes/db/data:/var/lib/postgresql/data
    - ./volumes/db/log:/var/log/postgresql

in section db:.

So I’d check if

  • ./volumes/db/ is existent
  • you have enough diskspace on there

If you don’t care about any data-loss from database (i.e. you didn’t enter anything), I’d suggest to:

  • stop the containers (docker-compose down)
  • remove the ./volumes/db directory on your dockerhost
  • start containers (docker-compose up -d)

When the metasfresh-docker_db_1 container starts up and it can’t find /var/lib/postgresql/data it will automatically be created within the docker container with a vanilla metasfresh database.