Health check failing when IPv6 enabled #749

Closed
opened 2025-10-09 16:49:55 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Caros2017 on GitHub.

I think I messed up with my pull request, so now I am making an issue for it.

Subject of the issue

When I enabled IPv6 I later realized that the healthcheck of the container was failing.

Setting ROCKET_ADDRESS=:: in docker-compose gives the error:

$ docker-compose up -d --build
services.vaultwarden.environment.13 must be a string

So to be able to use IPv6 ROCKET_ADDRESS needs to be set to ::0
ROCKET_ADDRESS=::0

In bash :: doesn't equal ::0 and hence my healthcheck is failing, since it isn't rewritten to localhost

Solution

In docker/healtcheck.sh change this:

if [ -z "${addr}" ] || [ "${addr}" = '0.0.0.0' ] || [ "${addr}" = '::' ]; then
    addr='localhost'
fi

To this:

if [ -z "${addr}" ] || [ "${addr}" = '0.0.0.0' ] || [ "${addr}" = '::0' ]; then
    addr='localhost'
fi
Originally created by @Caros2017 on GitHub. I think I messed up with my pull request, so now I am making an issue for it. ### Subject of the issue When I enabled IPv6 I later realized that the healthcheck of the container was failing. Setting `ROCKET_ADDRESS=::` in docker-compose gives the error: ``` $ docker-compose up -d --build services.vaultwarden.environment.13 must be a string ``` So to be able to use IPv6 `ROCKET_ADDRESS` needs to be set to `::0` `ROCKET_ADDRESS=::0` In bash `::` doesn't equal `::0` and hence my healthcheck is failing, since it isn't rewritten to localhost ### Solution In `docker/healtcheck.sh` change this: ``` if [ -z "${addr}" ] || [ "${addr}" = '0.0.0.0' ] || [ "${addr}" = '::' ]; then addr='localhost' fi ``` To this: ``` if [ -z "${addr}" ] || [ "${addr}" = '0.0.0.0' ] || [ "${addr}" = '::0' ]; then addr='localhost' fi ```
Author
Owner

@stefan0xC commented on GitHub:

You could also escape the string. I.e. if you use a YAML list, you can quote the whole line in your docker-compose.yml:

    environment:
      - 'ROCKET_ADDRESS=::'

Alternatively you could also specify the environment variables as a dictionary like this:

    environment:
      ROCKET_ADDRESS: "::"

Just be aware that docker-compose will interpret them differently, which is why I suggest you check your config with: docker-compose config.

@stefan0xC commented on GitHub: You could also escape the string. I.e. if you use a YAML list, you can quote the whole line in your `docker-compose.yml`: ```yaml environment: - 'ROCKET_ADDRESS=::' ``` Alternatively you could also specify the environment variables as a dictionary like this: ``` environment: ROCKET_ADDRESS: "::" ``` Just be aware that `docker-compose` [will interpret them differently](https://docs.docker.com/compose/compose-file/05-services/#environment), which is why I suggest you check your config with: `docker-compose config`.
Author
Owner

@Caros2017 commented on GitHub:

You could also escape the string. I.e. if you use a YAML list, you can quote the whole line in your docker-compose.yml:

    environment:
      - 'ROCKET_ADDRESS=::'

Alternatively you could also specify the environment variables as a dictionary like this:

    environment:
      ROCKET_ADDRESS: "::"

Just be aware that docker-compose will interpret them differently, which is why I suggest you check your config with: docker-compose config.

Thanks! Will use this instead!

@Caros2017 commented on GitHub: > You could also escape the string. I.e. if you use a YAML list, you can quote the whole line in your `docker-compose.yml`: > > ```yaml > environment: > - 'ROCKET_ADDRESS=::' > ``` > > Alternatively you could also specify the environment variables as a dictionary like this: > > ``` > environment: > ROCKET_ADDRESS: "::" > ``` > > Just be aware that `docker-compose` [will interpret them differently](https://docs.docker.com/compose/compose-file/05-services/#environment), which is why I suggest you check your config with: `docker-compose config`. Thanks! Will use this instead!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#749