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

Wait for postgres docker container to be ready before running commands #3876

Closed
1 of 5 tasks
emmyoop opened this issue Sep 13, 2021 · 1 comment · Fixed by #3908
Closed
1 of 5 tasks

Wait for postgres docker container to be ready before running commands #3876

emmyoop opened this issue Sep 13, 2021 · 1 comment · Fixed by #3908
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!

Comments

@emmyoop
Copy link
Member

emmyoop commented Sep 13, 2021

Describe the bug

When running make setup-db during setup, it needs to wait for the database to be running before running commands to get the postgres database in the right state.

Steps To Reproduce

Run through the steps in CONTRIBUTING. The first time you run make setup-db there will be an error that the server connection closed unexpectedly. If you attempt to run make integration the tests will fail as dbtMixedCase database will not exist. Run make setup-db again and everything will work and integration tests will run.

Expected behavior

Be able to run make setup-db a single time and have everything work.

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.21.0-b1

The operating system you're using:

The output of python --version:

Additional context

Wait for pg_isready in setup_db.sh should fix this.

@emmyoop emmyoop added bug Something isn't working triage labels Sep 13, 2021
@jtcohen6
Copy link
Contributor

@emmyoop Thanks for opening! Sounds like there's a straightforward fix here, so, I'm all about it :)

@jtcohen6 jtcohen6 added good_first_issue Straightforward + self-contained changes, good for new contributors! and removed triage labels Sep 14, 2021
jtcohen6 added a commit that referenced this issue Oct 21, 2021
…#3908)

* Fix setup_db.sh by waiting for pg_isready success return. Fixes #3876

* restored noaccess and dbtMixedCase creation and updated changelog and contributing md files

* restored root auth commands

* restored creation of dbt schema, aparently this is needed even if docker compose also creates it...

* pr comments: avoid infinite loop and quote variables

* Update changelog

Co-authored-by: Jeremy Cohen <jeremy@dbtlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants