mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Database connection fails because of failed name resolution #1455
Reference in New Issue
Block a user
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 @MasinAD on GitHub (Dec 28, 2022).
Subject of the issue
I configured the MariaDB connection in the environment file.
On startup I get
Deployment environment
The db nspawn container has a similar config. This setup works.
Steps to reproduce
Setup two systemd-nspawn containers by bootstrapping Debian Bullseye. Name one
dband the othervaultwarden. Install MariaDB in the first and the vaultwarden binary in the second (together with the web-vault).Create a systemd service unit file:
Create a system user and a system group, both named
vaultwardenExpected behaviour
Vaultwarden connects to the database by simply resolving the database name using system standards
Actual behaviour
Vaultwarden fails to connect because Diesel seems to not resolve the name correctly.
Troubleshooting data
@MasinAD commented on GitHub (Dec 28, 2022):
For the record, my workaround is providing the db host's IP address. But I'd like to resolve names in case of rebooting everything and the host then getting a different IP address. DHCP and DNS are cool if they work and are properly applied ;-).
@BlackDex commented on GitHub (Dec 28, 2022):
Not sure that we can help here. Resolving normally goes via the resolving provided by system it self. If this is a diesel issue, then a issue report there would be better.
What happens if you use
getentto try and resolve the host within your nspawn container? Or any other resolving tool?@MasinAD commented on GitHub (Dec 28, 2022):
I agree I should report this to Diesel. Done here: https://github.com/diesel-rs/diesel/issues/3463
I already posted the output of
getent ahosts dbandhost dbbut I paste it here:Resolving actually works. But Diesel does not like it.