Originally created by @sbach89 on GitHub (Jun 12, 2020).
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
[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).
<!--
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
````
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.
@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.
````
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.
@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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @sbach89 on GitHub (Jun 12, 2020).
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
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
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:
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.
Here is log trying to contact Yubico
And here is log for SMTP failure.
@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,
@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.