Docker-Compose postgres upgrade initdb: error: directory "/var/lib ...

stackoverflow.com/questions/62697071/docker-compose-postgres-upgrade-initdb-error-directory-var-lib-postgresql-da
Docker-Compose postgres upgrade initdb: error: directory "/var/lib/postgresql/data" exists but is not empty Ask Question Asked 6 years, 1 month ago Modified 1 year, 8 months ago

initdb: error: directory "/var/lib/postgresql/data/pgdata" exists but ...

stackoverflow.com/questions/78048091/initdb-error-directory-var-lib-postgresql-data-pgdata-exists-but-is-not-emp
The error is saying you are trying to create a new Postgres cluster via initdb in a directory that already contains files. Those files could be anything, but initdb will not create a new cluster in that case.

Postgres refuses to launch, directory is empty - General - Docker ...

forums.docker.com/t/postgres-refuses-to-launch-directory-is-empty/46234
Hello guys I have tried to mount the persistent volume to the PostgreSQL, but Postgres just screws me over saying postgres_1 | initdb: directory "/var/lib/postgresql/data" exists but is not empty postgres_1 | If you want to create a new database system, either remove or empty postgres_1 | the directory "/var/lib/postgresql/data" or run initdb postgres_1 | with an argument other than "/var/lib ...

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

www.reddit.com/r/PostgreSQL/comments/10yj8dl/initdb_error_directory_varlibpostgresqldata/
You are writing to /var/lib/postgresql/data/ and then attempting to mount database_volume on a non-empty directory.

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

community.blackduck.com/s/article/initdb-error-directory-var-lib-postgresql-data-exists-but-is-not-empty
Disclaimer: The information in this knowledge base article is believed to be accurate as of the date of this publication but is subject to change without notice. You understand and agree that use of this content is at your own discretion and risk and that you will be solely responsible for any damage that results from your use of it. The information is subject to the confidentiality provisions ...

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

github.com/immich-app/immich/issues/16915     2025-03-17T00:00:00.0000000
So if I make DB_DATA_LOCATION local, this works just fine. But if DB_DATA_LOCATION is on an SMB mount (in this case my UNAS pro), it fails. Not sure why.
Feedback