Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add a check for existing docker db volume #518

Merged
merged 1 commit into from
Oct 18, 2021
Merged

fix: Add a check for existing docker db volume #518

merged 1 commit into from
Oct 18, 2021

Conversation

mr-karan
Copy link
Collaborator

Fixes #517

PostgreSQL DB container uses initdb to initialize the DB data directory. The password/username/DB name is set during this time. If any of these values change, these don't get updated automagically since initdb runs only once on an absence of data directory.

So, if the install-prod.sh script is cancelled midway, the listmonk-data docker DB volume is already created. If the script is run again, it will generate a new password and set this in docker-compose and config.toml. However, this password is wrong, since the listmonk-data DB directory was initialized with the script's previous run's password.

This script simply checks for an existence of listmonk_listmonk-data volume and if it exists, errors out immediately. It is upto the user to continue (by manually changing password in config.toml/docker-compose.yml) or remove the volume (by docker-compose down -v

➜ ./install-prod.sh

>  checking for an existing docker db volume
x listmonk-data volume already exists. Please use docker-compose down -v to remove old volumes for a fresh setup of PostgreSQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error connecting to DB: pq: password authentication failed for user "listmonk"
2 participants