[GH-ISSUE #1032] DNS client on container not working #729

Closed
opened 2026-03-03 02:02:37 +03:00 by kerem · 2 comments
Owner

Originally created by @sbach89 on GitHub (Jun 12, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1032

Subject of the issue

DNS client on container not working, container unable to resolve hostnames to send email, connect to Yubico validations servers and pull in Website Icons,

Your environment

  • Bitwarden_rs version: 1.14.2-08077833
  • Install method: Docker/Podman
  • Other relevant information:

Steps to reproduce

CentOS 8 host.
SELinux is disabled on host.
FirewallD is disabled on host.
Container has correct internal DNS servers in /etc/resolv.conf

podman create --name bitwarden -e ROCKET_PORT=8080 -e DOMAIN=https://vault.DOMAIN/ -e ADMIN_TOKEN= -e LOG_FILE=/data/bitwarden.log -e LOG_LEVEL=debug -v /bw-data/:/data/ -p 8080:8080 bitwardenrs/server:latest

I then generate a systemd file with podman and enable and run it.

Attempting to see if there was some type of issue with Podman, I installed Docker and ran the following:

docker run -d --name bitwarden -e ROCKET_PORT=8080 -e DOMAIN=https://vault.DOMAIN/ -e ADMIN_TOKEN= -e LOG_FILE=/data/bitwarden.log -e LOG_LEVEL=debug -v /bw-data/:/data/ --restart always -p 8080:8080 bitwardenrs/server:latest

Same results, not able to resolve hostnames. The host is able to ping and resolve via hostnames.

Expected behaviour

Be able to resolve hostnames.

Actual behaviour

Not resolving hostnames effectively no longer allowing users with 2FA able to login

Relevant logs

Here is a snippet from trying to pull website icons, this is happening for my entire vault.


[2020-06-12 12:55:20][reqwest::connect][DEBUG] starting new connection: http://www.pcs401k.com/
[2020-06-12 12:55:20][hyper::client::connect::dns][DEBUG] resolving host="www.pcs401k.com"
[2020-06-12 12:55:30][bitwarden_rs::api::icons][INFO] Download failed for http://www.pcs401k.com/favicon.ico
[2020-06-12 12:55:30][bitwarden_rs::api::icons][ERROR] Error downloading icon: Empty response

Here is log trying to contact Yubico

[2020-06-12 13:22:50][request][INFO] POST /api/two-factor/get-yubikey
[2020-06-12 13:22:50][response][INFO] POST /api/two-factor/get-yubikey (generate_yubikey) => 200 OK
[2020-06-12 13:22:56][request][INFO] PUT /api/two-factor/yubikey
[2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api.yubico.com/
[2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api2.yubico.com/
[2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api.yubico.com"
[2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api3.yubico.com/
[2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api2.yubico.com"
[2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api4.yubico.com/
[2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api5.yubico.com/
[2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api3.yubico.com"
[2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api4.yubico.com"
[2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api5.yubico.com"
[2020-06-12 13:23:25][request][INFO] GET /alive
[2020-06-12 13:23:25][response][INFO] GET /alive (alive) => 200 OK
[2020-06-12 13:23:26][error][ERROR] Invalid Yubikey OTP provided.
[CAUSE] Network(
    reqwest::Error {
        kind: Request,
        url: "https://api5.yubico.com/wsapi/2.0/verify?id=55569&nonce=RBsytofVfGnzdskykujlkVvwtEeEhjD9FakkhIUH&otp=xxxxxxxxxxxxxxx&sl=100&h%3D3STMwGULYKi5DWG22bcGljVAf0o%3D",
        source: TimedOut,
    },
)
[2020-06-12 13:23:26][response][INFO] PUT /api/two-factor/yubikey (activate_yubikey_put) => 400 Bad Request

And here is log for SMTP failure.

[2020-06-12 12:52:22][error][ERROR] SmtpError.
[CAUSE] Client(
    "Could not connect",
)
[2020-06-12 12:52:22][response][INFO] POST /api/two-factor/send-email (send_email) => 400 Bad Request
Originally created by @sbach89 on GitHub (Jun 12, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1032 <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unneccessary for your issue, feel free to remove them. Remember to hide/obfuscate personal and confidential information, such as names, global IP/DNS adresses and especially passwords, if neccessary. --> ### Subject of the issue DNS client on container not working, container unable to resolve hostnames to send email, connect to Yubico validations servers and pull in Website Icons, ### Your environment <!-- The version number, obtained from the logs or the admin page --> * Bitwarden_rs version: 1.14.2-08077833 <!-- How the server was installed: Docker image / package / built from source --> * Install method: Docker/Podman * Other relevant information: ### Steps to reproduce CentOS 8 host. SELinux is disabled on host. FirewallD is disabled on host. Container has correct internal DNS servers in /etc/resolv.conf ```` podman create --name bitwarden -e ROCKET_PORT=8080 -e DOMAIN=https://vault.DOMAIN/ -e ADMIN_TOKEN= -e LOG_FILE=/data/bitwarden.log -e LOG_LEVEL=debug -v /bw-data/:/data/ -p 8080:8080 bitwardenrs/server:latest ```` I then generate a systemd file with podman and enable and run it. Attempting to see if there was some type of issue with Podman, I installed Docker and ran the following: ```` docker run -d --name bitwarden -e ROCKET_PORT=8080 -e DOMAIN=https://vault.DOMAIN/ -e ADMIN_TOKEN= -e LOG_FILE=/data/bitwarden.log -e LOG_LEVEL=debug -v /bw-data/:/data/ --restart always -p 8080:8080 bitwardenrs/server:latest ```` Same results, not able to resolve hostnames. The host is able to ping and resolve via hostnames. ### Expected behaviour Be able to resolve hostnames. ### Actual behaviour Not resolving hostnames effectively no longer allowing users with 2FA able to login ### Relevant logs Here is a snippet from trying to pull website icons, this is happening for my entire vault. ``` [2020-06-12 12:55:20][reqwest::connect][DEBUG] starting new connection: http://www.pcs401k.com/ [2020-06-12 12:55:20][hyper::client::connect::dns][DEBUG] resolving host="www.pcs401k.com" [2020-06-12 12:55:30][bitwarden_rs::api::icons][INFO] Download failed for http://www.pcs401k.com/favicon.ico [2020-06-12 12:55:30][bitwarden_rs::api::icons][ERROR] Error downloading icon: Empty response ``` Here is log trying to contact Yubico ```` [2020-06-12 13:22:50][request][INFO] POST /api/two-factor/get-yubikey [2020-06-12 13:22:50][response][INFO] POST /api/two-factor/get-yubikey (generate_yubikey) => 200 OK [2020-06-12 13:22:56][request][INFO] PUT /api/two-factor/yubikey [2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api.yubico.com/ [2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api2.yubico.com/ [2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api.yubico.com" [2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api3.yubico.com/ [2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api2.yubico.com" [2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api4.yubico.com/ [2020-06-12 13:22:56][reqwest::connect][DEBUG] starting new connection: https://api5.yubico.com/ [2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api3.yubico.com" [2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api4.yubico.com" [2020-06-12 13:22:56][hyper::client::connect::dns][DEBUG] resolving host="api5.yubico.com" [2020-06-12 13:23:25][request][INFO] GET /alive [2020-06-12 13:23:25][response][INFO] GET /alive (alive) => 200 OK [2020-06-12 13:23:26][error][ERROR] Invalid Yubikey OTP provided. [CAUSE] Network( reqwest::Error { kind: Request, url: "https://api5.yubico.com/wsapi/2.0/verify?id=55569&nonce=RBsytofVfGnzdskykujlkVvwtEeEhjD9FakkhIUH&otp=xxxxxxxxxxxxxxx&sl=100&h%3D3STMwGULYKi5DWG22bcGljVAf0o%3D", source: TimedOut, }, ) [2020-06-12 13:23:26][response][INFO] PUT /api/two-factor/yubikey (activate_yubikey_put) => 400 Bad Request ```` And here is log for SMTP failure. ```` [2020-06-12 12:52:22][error][ERROR] SmtpError. [CAUSE] Client( "Could not connect", ) [2020-06-12 12:52:22][response][INFO] POST /api/two-factor/send-email (send_email) => 400 Bad Request ````
kerem closed this issue 2026-03-03 02:02:37 +03:00
Author
Owner

@sbach89 commented on GitHub (Jun 12, 2020):

I just realized I was running an old version, I'm now on 1.15.0-52ed8e4d, and under Diagnostics > DNS check,

DNS (github.com) ERROR Could not resolve domain name.
<!-- gh-comment-id:643443323 --> @sbach89 commented on GitHub (Jun 12, 2020): I just realized I was running an old version, I'm now on 1.15.0-52ed8e4d, and under Diagnostics > DNS check, ```` DNS (github.com) ERROR Could not resolve domain name. ````
Author
Owner

@sbach89 commented on GitHub (Jun 12, 2020):

Ok this is resolved now. I updated Podman to 1.9.3 and everything is working now, so it was not related to Bitwarden_rs.

<!-- gh-comment-id:643452747 --> @sbach89 commented on GitHub (Jun 12, 2020): Ok this is resolved now. I updated Podman to 1.9.3 and everything is working now, so it was not related to Bitwarden_rs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#729
No description provided.