Skip to content

Logs flooded with WARN: Container is not in same network as caddy #759

@accforgithubtest

Description

@accforgithubtest

I have

  • A single shared network: default (resulting in <stack_name>_default).
  • ipv4_address is manually assigned to every single container.
  • Caddy attached to this network ipv4_address: 10.10.1.100.
  • Multiple applications attached to ipv4_address: 10.10.1.xxx.
  • Multiple Applications attached to ipv4_address: 10.10.5.xxx.
  • Working reverse proxy: Caddy can route to the applications in both 10.10.1.xxx and 10.10.5.xxx.
  • CADDY_INGRESS_NETWORKS is set to - CADDY_INGRESS_NETWORKS=<stack_name>_default.

Issue - Persistent warning which is flooding the logs : Container is not in same network as caddy, even though the reverse proxy is working and able to route to the applications in both 10.10.1.xxx and 10.10.5.xxx.

Important bits of the docker compose files -

Parent (stack) docker compose

networks:
  default:
    driver: bridge
    enable_ipv6: false
    ipam:
      config:
        - subnet: 10.10.0.0/16

...
...

include:
  - path: 'docker/caddy-docker-proxy/docker-compose.yaml'
  - path: 'docker/application_abc/docker-compose.yaml'
  - path: 'docker/application_def/docker-compose.yaml'
  - path: 'docker/application_xyz/docker-compose.yaml'

Caddy docker proxy compose file -

services:
  caddy:
    image:  ....
    ...
    networks:
      default:
        ipv4_address: 10.10.1.100

Many other application use this docker compose file, one for each application

services:
  application_abc:
    image:  ....
    ...
    networks:
      default:
        ipv4_address: 10.10.1.xxx
services:
  application_xyz:
    image:  ....
    ...
    networks:
      default:
        ipv4_address: 10.10.5.xxx

LLM suggests -

This confirms that the issue is not the missing configuration, but a subtle behavior or strict check within the caddy-docker-proxy source code itself, likely related to the manual static IP assignments falling into different subnets (10.10.1.x vs 10.10.5.x) within the larger $10.10.0.0/16$ supernet.

Since the configuration is correct and the routing works, the only remaining option to silence a persistent, but harmless, warning is to use the specific environment variable designed to disable all network checks when necessary.

For scenarios where the proxy incorrectly determines reachability (like yours), the documentation suggests using CADDY_DOCKER_INSECURE_NETWORKS.

I do not see a CADDY_DOCKER_INSECURE_NETWORKS in the readme. I assume LLM is not right here.

But is but a subtle behavior or strict check within the caddy-docker-proxy source code itself, the issue ?

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