Skip to content

Global defaults for Docker host/container ignored when creating Docker monitors for Uptime Kuma 2.x #158

@ronschaeffer

Description

@ronschaeffer

Describe the bug

When using AutoKuma with Uptime Kuma v2.x and specifying global defaults via AUTOKUMA__DEFAULT_SETTINGS, the global values for Docker host and Docker container (i.e., "docker":{"host":...,"container":"..."}) are not applied to monitors created from Docker containers.

Fields like parent are applied correctly from global defaults, but docker.host and docker.container are not populated in Kuma, causing monitors to have empty Docker Host / Container mapping and resulting in errors like:

Failed to load docker host config

This occurs even though AutoKuma logs show that containers are discovered, and the global defaults JSON is correctly formed.

Reproduction steps

  1. Run Uptime Kuma v2.x
  2. Run AutoKuma with:
    AUTOKUMA__DEFAULT_SETTINGS={"parent":100,"docker":{"host":1,"container":"{{container_name}}"}}
    AUTOKUMA__DOCKER__LABEL_PREFIX=kuma
  3. Run a container with labels like:
    -l kuma.enable=true
    -l kuma.type=docker
  4. Observe that monitors are created, and parent is applied, but the Docker host and container fields are blank.

Expected behavior

Global defaults should apply Docker host and container fields so that Docker monitors are correctly created without requiring defining those fields on every container via labels.

Workaround

Using per-container Docker labels (e.g., kuma.<id>.docker.host and kuma.<id>.docker.container) does work as expected, but this defeats the purpose of global defaults.

Environment

  • AutoKuma image: ghcr.io/bigboot/autokuma:master or latest
  • Uptime Kuma: version 2.x
  • AUTOKUMA__DEFAULT_SETTINGS used

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions