[GH-ISSUE #2841] Using a custom ROCKET_ADDRESS value results in erroneously reporting container as "Unhealthy" (healthcheck.sh) #1395

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

Originally created by @ghost on GitHub (Oct 19, 2022).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2841

Subject of the issue

healthcheck.sh ignores ROCKET_HOST value (if different from "localhost") and erroneously reports container as Unhealthy

Deployment environment

Docker installation of vaultwarden with a little customization (set ROCKET_HOST and ROCKET_PORT in the environment section of docker-compose).

  • vaultwarden version:
    vaultwarden:latest

  • Install method:
    docker / docker-compose

Steps to reproduce

Set ROCKET_HOST in docker-compose environment section for the container to a real local IP address (e.g. 192.168.1.1).
Set "network_mode: host" in docker-compose.
Start up the container.
After a few minutes, check container status with "docker ps".

Expected behaviour

"docker ps" reports container as "Healthy" if healthy, regardless of whether ROCKET_HOST is "localhost" or a different value.

Actual behaviour

"docker ps" reports container as "Unhealthy" if ROCKET_HOST value is different from "localhost".

Troubleshooting data

Issue stems from the very last line of /healthcheck.sh, which hardcodes "localhost" as the destination host for the curl call.

Is:

curl --insecure --fail --silent --show-error \
     "http${s}://localhost:${ROCKET_PORT}${base_path}/alive" || exit 1

Should be (with the proper initialization of ROCKET_HOST earlier, of course):

curl --insecure --fail --silent --show-error \
     "http${s}://${ROCKET_HOST}:${ROCKET_PORT}${base_path}/alive" || exit 1

Consequently, if Rocket doesn't listen on localhost:$ROCKET_PORT, but on (e.g.) 192.168.1.1:$ROCKET_PORT, the healthcheck will fail and the container will be reported as Unhealthy.

Originally created by @ghost on GitHub (Oct 19, 2022). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2841 ### Subject of the issue healthcheck.sh ignores ROCKET_HOST value (if different from "localhost") and erroneously reports container as Unhealthy ### Deployment environment Docker installation of vaultwarden with a little customization (set ROCKET_HOST and ROCKET_PORT in the environment section of docker-compose). * vaultwarden version: vaultwarden:latest * Install method: docker / docker-compose ### Steps to reproduce Set ROCKET_HOST in docker-compose environment section for the container to a real local IP address (e.g. 192.168.1.1). Set "network_mode: host" in docker-compose. Start up the container. After a few minutes, check container status with "docker ps". ### Expected behaviour "docker ps" reports container as "Healthy" if healthy, regardless of whether ROCKET_HOST is "localhost" or a different value. ### Actual behaviour "docker ps" reports container as "Unhealthy" if ROCKET_HOST value is different from "localhost". ### Troubleshooting data Issue stems from the very last line of /healthcheck.sh, which hardcodes "localhost" as the destination host for the curl call. Is: ``` curl --insecure --fail --silent --show-error \ "http${s}://localhost:${ROCKET_PORT}${base_path}/alive" || exit 1 ``` Should be (with the proper initialization of ROCKET_HOST earlier, of course): ``` curl --insecure --fail --silent --show-error \ "http${s}://${ROCKET_HOST}:${ROCKET_PORT}${base_path}/alive" || exit 1 ``` Consequently, if Rocket doesn't listen on localhost:$ROCKET_PORT, but on (e.g.) 192.168.1.1:$ROCKET_PORT, the healthcheck will fail and the container will be reported as Unhealthy.
kerem 2026-03-03 02:08:48 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jjlin commented on GitHub (Oct 20, 2022):

I assume you meant ROCKET_ADDRESS, not ROCKET_HOST? The latter isn't a thing, AFAIK. Anyway, #2844 should fix this.

<!-- gh-comment-id:1285144508 --> @jjlin commented on GitHub (Oct 20, 2022): I assume you meant `ROCKET_ADDRESS`, not `ROCKET_HOST`? The latter isn't a thing, AFAIK. Anyway, #2844 should fix this.
Author
Owner

@ghost commented on GitHub (Oct 20, 2022):

Correct, ROCKET_ADDRESS. Tired when writing that. Love the super-quick fix.

<!-- gh-comment-id:1285303595 --> @ghost commented on GitHub (Oct 20, 2022): Correct, ROCKET_ADDRESS. Tired when writing that. Love the super-quick fix.
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#1395
No description provided.