mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #1085] Can't connect to DB: BadConnection #768
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#768
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @okami-chen on GitHub (Aug 5, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1085
Subject of the issue
Your environment
Steps to reproduce
Expected behaviour
Actual behaviour
Relevant logs
@BobWs commented on GitHub (Aug 10, 2020):
Had the same problem so out of the blue. Update the image to the latest version but that didn’t help. After the update BW wouldn’t start it was repeatedly restarting. Then I decided to restart my docker and that solved the problem.
But I guess this is not a normal behavior as I never had this problem before.
@BlackDex commented on GitHub (Sep 14, 2020):
@BobWs , is MySQL also running as a container?
If that is the case it could be bitwarden is started before the MySQL container which causes this error and would en explain why a restart would work.
@BobWs commented on GitHub (Sep 17, 2020):
Yes Mariadb is also running as a container. I could set BW to
depend-onthe Mariadb container but I don’t know how to set it via CLi (command line)@BlackDex commented on GitHub (Sep 17, 2020):
@BobWs Do you use docker compose?
@BlackDex commented on GitHub (Sep 17, 2020):
Because if so, please checkout this link: https://docs.docker.com/compose/startup-order/
@BobWs commented on GitHub (Sep 17, 2020):
No I don’t I use CLi in combination with the GUI of Docker on a Synology. They have built a GUI for Docker. So most of the settings I can do via the GUI but sometimes I need more and use CLi. I have never tried docker compose.
@BlackDex commented on GitHub (Sep 17, 2020):
@BobWs Then it would be an option to add the following as a pre-start script for the docker.
A while back @jjlin created a way to have stuff done before bitwarden_rs gets started.
See: https://github.com/dani-garcia/bitwarden_rs/wiki/Starting-a-Container#customizing-container-startup
You could add a script which waits for mysql to be started like this (tested this on the testing image, not the alpine one).
@BobWs commented on GitHub (Sep 17, 2020):
Thanks for the suggestion I will give it a try and report back if it works.
@dani-garcia commented on GitHub (Oct 3, 2020):
Commit
729c9cfmight help if you need bitwarden_rs to retry the connection, by default it retries 15 times, one second between each try, then gives up, configurable by DB_CONNECTION_RETRIES (set to 0 for infinite retries).@BlackDex commented on GitHub (Nov 18, 2020):
Closing this ticket because of inactivity.
Feel free to re-open if the issue isn't resolved using the
testing/masterversion.