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

Encore daemon doesn't detect restarted database container #49

Closed
eandre opened this issue Aug 3, 2021 · 2 comments
Closed

Encore daemon doesn't detect restarted database container #49

eandre opened this issue Aug 3, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@eandre
Copy link
Member

eandre commented Aug 3, 2021

The Encore daemon caches information about the running database container. This works fine most of the time but causes problems when the Docker container (or Docker itself) is restarted outside of Encore's control, leading to Encore trying to connect to the wrong (ephemeral) container port.

It leads to errors like:

error: could not connect to the database for service foo/: create db mapping: failed to connect to admin database: failed to connect to `host=0.0.0.0 user=encore database=postgres`: dial error (dial tcp 0.0.0.0:49153: connect: connection refused)

A workaround is to restart the encore daemon (by running encore daemon) to clear the cache, but the daemon should detect this by itself instead.

@eandre eandre added the bug Something isn't working label Aug 3, 2021
@eandre eandre closed this as completed in a7f3185 Dec 6, 2021
horiajurcut added a commit to eandre/encore that referenced this issue Dec 14, 2021
@scastrec
Copy link

Thanks to this, It solve this error too:
❌ Running database migrations... Failed: create db notes: failed to connect to admin database: failed to connect tohost=0.0.0.0 user=encore database=postgres: dial error (dial tcp 0.0.0.0:61483: connect: connection refused)

@eandre
Copy link
Member Author

eandre commented Dec 17, 2021

Yes, the bugfix in #113 should fix that. Before we tag a new release with that bugfix you can work around the issue by running encore daemon from your terminal to restart the daemon (which clears the cache). Hope that helps :)

horiajurcut added a commit to horiajurcut/encore that referenced this issue Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants