Skip to content

bug: Bundled services' ports always bind to 127.0.0.1 after #1681 #2055

@junhaoliao

Description

@junhaoliao

Bug

After #1681 (feat: support configuration of external third-party services), CLP_DB_HOST,
CLP_QUEUE_HOST, CLP_REDIS_HOST, and CLP_RESULTS_CACHE_HOST are no longer set in
controller.py for bundled services. However, docker-compose-all.yaml still uses them
as the host_ip for port bindings:

ports:
  - host_ip: "${CLP_DB_HOST:-127.0.0.1}"
    published: "${CLP_DB_PORT:-3306}"
    target: 3306

Because the env vars are never set, Docker always falls back to 127.0.0.1, so bundled
services' ports are only reachable from localhost. Users can no longer configure, for
example, database.host: "0.0.0.0" to expose the bundled database on all network
interfaces — which was previously needed for multi-host deployments where workers on other
machines connect to a host running the bundled database.

Expected: Setting database.host: "0.0.0.0" (or a specific IP) in clp-config.yaml
causes the bundled database's port to be published on that address, making it reachable
from other hosts.

Actual: The published port is always bound to 127.0.0.1 regardless of the configured
host, making the service unreachable from other hosts.

CLP version

Any commit after #1681 was merged.

Environment

Any environment running the CLP package (Docker Compose deployment).

Reproduction steps

  1. In etc/clp-config.yaml, set database.host: "0.0.0.0".
  2. Run ./sbin/start-clp.sh.
  3. From another host (or via a network interface other than loopback), attempt to connect
    to the host machine on port 3306.
  4. Observe that the connection is refused — the port is only bound to 127.0.0.1.

Root cause: _set_up_env_for_database(), _set_up_env_for_queue(),
_set_up_env_for_redis(), and _set_up_env_for_results_cache() in controller.py no
longer emit CLP_DB_HOST / CLP_QUEUE_HOST / CLP_REDIS_HOST /
CLP_RESULTS_CACHE_HOST for bundled services. The fix is to restore those assignments
(using _get_ip_from_hostname(self._clp_config.<service>.host)) inside the
if BundledService.<SERVICE> in self._clp_config.bundled branch of each method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions