Closed MasinAD closed 1 year ago
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 ;-).
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 getent
to try and resolve the host within your nspawn container? Or any other resolving tool?
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 db
and host db
but I paste it here:
root@vaultwarden:~# getent ahosts db
169.254.102.26 STREAM db
169.254.102.26 DGRAM
169.254.102.26 RAW
192.168.104.15 STREAM
192.168.104.15 DGRAM
192.168.104.15 RAW
fe80::f836:5aff:fe6c:d3fd STREAM
fe80::f836:5aff:fe6c:d3fd DGRAM
fe80::f836:5aff:fe6c:d3fd RAW
root@vaultwarden:~# host db
db has address 169.254.102.26
db has address 192.168.104.15
db has IPv6 address fe80::f836:5aff:fe6c:d3fd
Resolving actually works. But Diesel does not like it.
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
db
and 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
vaultwarden
Expected 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