Harbor: initdb: directory "/var/lib/postgresql/data" exists but is not empty

Created on 6 Sep 2018  路  3Comments  路  Source: goharbor/harbor

Expected behavior and actual behavior:
When installing harbor on Debian 9 some of the related containers (harbor-db, harbor-ui, clair) are restarting constantly with exit state Exit 137, I was expecting them to start only once without any problem. When checking logs of postgresql service I can see initdb: directory "/var/lib/postgresql/data" exists but is not empty message.

Steps to reproduce the problem:
Install harbor on Debian 9 and check the status of the containers with docker-compose ps

Versions:
Please specify the versions of following systems.

  • harbor version: [v1.6.0-rc2]
  • docker engine version: [18.06.1-ce, build e68fc7a]
  • docker-compose version: [1.22.0, build f46880fe]

Additional context:

  • Workarround: Everything seems to work fine if I add PGDATA=/tmp as environment variable for postgresql service
  • Log files: Only redis log file is created and doesn't seems to be significative.
  • Installation command: ./install.sh --with-notary --with-clair --with-chartmuseum

Most helpful comment

Have you tried cleanup the directory mounted to /var/lib/postgresql/data and reinstall, it's /data/database by default.

All 3 comments

Have you tried cleanup the directory mounted to /var/lib/postgresql/data and reinstall, it's /data/database by default.

That did the trick thanks @cd1989

that workaround worked fine, thanks @adomenech73

Was this page helpful?
0 / 5 - 0 ratings