Skip to content

[BUG] MONGO_HOST variable do not works #153

@amigthea

Description

@amigthea

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I already have a production environment, with a mongo database. I need to change the database host and I need to pinpoint it to a ipv4 address, but when I try to change the docker MONGO_HOST variable value, application fails to start because it tries to reach the old value, the container hostname unifi_db, instead of the new ip address

Caused by: com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=unifi_db:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: unifi_db}, caused by {java.net.UnknownHostException: unifi_db}}]

how can I fix that?

Expected Behavior

changing variable should reflect the changes in the application configuration

Steps To Reproduce

  1. change docker compose MONGO_HOST variable

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

as above

Container logs

as above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions