Repository navigation
Description
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.
podman network create nullius-net(it has DNS by default).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)]"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'sapp/.- In the dind, with
PYTHONPATH=app: createUnit("nullius-licence-job", "u0001", "/tmp/rec", image="python:3.12-slim", app="/unused", base="http://unused", key="unused"). Rundocker network create --internal <its names["network"]>, thenu._forward(1, "nullius-licence-server:27001"). - 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))" - 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
unresolvedevent. - 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