mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
No Internet in Diagnostics and Outgoing connections fail #1724
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 @knightian on GitHub (Oct 1, 2023).
Websockets are working fine, everything seems to work except for anything that vaultwarden needs to reach out to like version checks, NTP and push notifications.
In the log there is error setting up push:
I can curl https://identity.bitwarden.com/connect/token from the server and it reaches it without issue. This all used to work fine it is just the last few Bitwarden versions this seems to happen, never had any issues in the past.
SMTP reaches out no worries to send emails through Microsoft 365.
Using nginx as reverse proxy, was using my own config but I have switched to the nginx config provided by @BlackDex in the proxy examples.
FWIW I also see this in the vaultwarden log:
[2023-10-02 00:59:53.441][trust_dns_resolver::system_conf::unix][WARN] no nameservers found in configBut DNS is working fine on the server.
I suspect this is going to be a DNS issue within Vaultwarden, but why does it only pop up in current versions did something change?
Here is the debug string:
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden:
@knightian commented on GitHub (Oct 1, 2023):
I solved this problem.
I looked at the code and I see that vaultwarden is using a package called
trust-dns-resolverI found this article: https://crates.io/crates/trust-dns-resolver and I noticed that trust-dns-resolver package is parsing
/etc/resolv.conflooking for nameserver entries. Because I am receiving my DNS via DNS options, I didn't have any nameserver entries in this file and so it was causing Bitwarden to not be able to do any DNS lookups.I added:
nameserver 127.0.0.1into /etc/resolv.conf because my server also runs a local unbound instance that can be used. Once I did this, it fixed the issues (but now push notifications with iOS are not working still).So long story short
If you do not have any nameserver listed in
/etc/resolv.confit will break vaultwarden for some things (mostly outgoing requests)@knightian commented on GitHub (Oct 1, 2023):
I would like to NOT have to have a nameserver entry in
/etc/resolv.conf, is it possible to force trust-dns-resolver to use a particular DNS server instead? Maybe through an ENV var in Vaultwarden?@stefan0xC commented on GitHub (Oct 1, 2023):
@knightian I don't think so. This also seems rather esoteric to me. And I'm not sure if we want to add another configuration option. But you should probably ask in the trust-dns repository if this is possible or something they'd consider adding, if it's not.
@knightian commented on GitHub (Oct 1, 2023):
I see, but if someone is using a VPS and the cloud provider is using Netplan to configure the network and DNS is coming from DHCP options and is not resident in resolv.conf then they are going to have the same bad time.
How to get around it? Or just allow people who install into VPS with these setups to fail?
@BlackDex commented on GitHub (Oct 1, 2023):
Well, by default docker takes the
resolv.conffrom the host, if that isn't ok, you should usedocker run --dns=1.1.1.1or it's equivalent for docker-compose.