Skip to content

Standard: a licence server reached by name gives the agent a closed connection #41

Closed

Description

@harenome

Priority

extreme

Components

  • app/nullius (backend)
  • app/web (routes)
  • templates and static files
  • docs and the site
  • catalogue (benchmarks, agents, capabilities)
  • the standard (ports, kits, relay, runs)
  • CI, workflows and skills

Evidence

A unit gets one forwarder per licence server (container.Unit._forward, running app/nullius/standard/forward.py). The forwarder starts on the default bridge, then joins the unit's internal network with the server's name as its network alias. It resolved the server's name for each connection. On the unit's network, the engine's DNS answers that name with the forwarder's own address, so the forwarder connected to itself.

Observed on rootful Docker 29.9.3 (the docker:dind image), with Unit._forward run from main (22140a6). A greeting server (LICENSE-OK) runs at nullius-licence-server:27001:

forwarder log: {"event": "listening", "port": 27001}
in the forwarder, the name now resolves to 172.18.0.2 ; its own addresses: 172.17.0.2 172.18.0.2
agent: nullius-licence-server -> closed, no greeting

172.17.0.2 is the forwarder on the default bridge and 172.18.0.2 is the forwarder on the unit's network. A server given as host.docker.internal or as an IPv4 address is not affected: --add-host pins the first, and the second gets the alias licence-server-<i>. The docker tier only uses host.docker.internal, so it does not catch this.

Screenshot

No response

Reproduction

The server must have a name that the forwarder can resolve on the default bridge. Docker's default bridge has no embedded DNS, and its containers use the engine host's resolver. Here, the engine runs in a podman container, and the resolver of podman's network gives the server's name.

  1. podman network create nullius-net (it has DNS by default).
  2. podman run -d --name nullius-licence-server --network nullius-net python:3.12-slim python3 -c "import socket; s = socket.create_server(('0.0.0.0', 27001)); [(c.sendall(b'LICENSE-OK'), c.close()) for c in iter(lambda: s.accept()[0], None)]"
  3. podman run -d --name nullius-licence-dind --network nullius-net --privileged docker:dind dockerd --host=unix:///var/run/docker.sock. In it: apk add python3, docker pull python:3.12-slim, and copy in the repository's app/.
  4. In the dind, with PYTHONPATH=app: create Unit("nullius-licence-job", "u0001", "/tmp/rec", image="python:3.12-slim", app="/unused", base="http://unused", key="unused"). Run docker network create --internal <its names["network"]>, then u._forward(1, "nullius-licence-server:27001").
  5. In the dind: docker run --rm --network <that network> python:3.12-slim python3 -c "import socket; print(socket.create_connection(('nullius-licence-server', 27001), timeout=10).recv(64))"
  6. The connection closes with no greeting.

Expected

The agent reads LICENSE-OK: the forwarder passes the connection to the server, not to itself.

Acceptance

  • The forwarder resolves the server's name once, before it listens, and does not resolve it again per connection.
  • The unit connects the forwarder to its network only after the forwarder says listening.
  • Each connection tries every resolved address in order, and skips an address family that the machine does not have.
  • A name that does not resolve ends the forwarder with an unresolved event.
  • Tests cover the single lookup, the order of start and network connect, the address order, the missing family, and the unresolved name.

Dependencies and related

none

Activity

  1. added
    bug
    on Nov 10, 2026
  2. added theissue type on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions