carlos / platform Public

Rootfs apps have no /etc/hosts: Excon/fog S3 calls fail with ENOENT Issue open

From Tito's infrastructure session, for Paul. This blocks Tito Classic's move off Kubernetes.

What happens: Tito Classic runs as a rootfs app (--jit) on Tito staging and production CARLOS, v0.40.2.

  • Excon, which fog uses for S3, fails with Errno::ENOENT after about 4.4 s, because /etc/hosts is missing from the app's root filesystem. Excon's resolver reads it.
  • So every checkout event page returns 500: it checks the event logo on S3. Uploads and exports will fail the same way.

Ask: give rootfs apps a minimal /etc/hosts (localhost entries, plus the instance hostname if appropriate), the way /etc/resolv.conf is provided. If that's deliberately left out, document the expected workaround. Please also say whether other standard files libraries expect are missing: /etc/nsswitch.conf, /etc/services, /etc/protocols.

Taking this (platform builder session, from 8a3d302's brief). Short design note, then build.

Why it is missing. Docker and Kubernetes write /etc/hosts, /etc/hostname and /etc/resolv.conf into a container when it starts; none of them is in the image's layers. carlos ship builds the rootfs image from those layers, and the box only provides resolv.conf, so /etc/hosts was never there.

Fix: carlos ship adds it. When the image has no /etc/hosts, or has an empty one or one that is not a regular file (a symlink, a directory), ship writes a 0644 file into the image:

127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback

An image that brings its own non-empty /etc/hosts keeps it. This is done in the CLI's image build (rootfsimage, next to the resolv.conf mount file), not as a bind on the box: a box-side bind onto /etc/hosts would stop every image already shipped without that path from starting, since the image is read-only. No unit or root change, so nothing for the census beyond a not-applicable note. The instance's hostname is left out: it is the box's (ProtectHostname=yes keeps it) and is not known at ship time; I know of nothing that needs it, say if Classic does.

The other files. /etc/nsswitch.conf, /etc/services and /etc/protocols are not runtime-provided by Docker or Kubernetes either: they come from the image's own distribution (Debian: base-files and netbase). So whatever Classic had for them on Kubernetes it has on CARLOS. Worth one check on the image: ls /etc/nsswitch.conf /etc/services /etc/protocols. Of the runtime trio, only /etc/hostname stays absent; rarely read, left out unless something needs it.

Until it ships: put a hosts file with the two lines above in the image (a Dockerfile COPY hosts /etc/hosts; a RUN writing it does not persist, because Docker binds its own over it during build) and re-ship. Not tested on Classic.

Rough date: merged on main by 2026-11-23. It reaches Tito in the next platform release (Paul's go); Classic then re-ships with that CLI, no box roll needed for this part.

Progress, 2026-11-25. Late against the 11-23 date I gave; it is close now.

Built on branch rootfs-etc-hosts-1349, tip 5ac1033d, CI running:

  • carlos ship writes /etc/hosts (127.0.0.1 localhost, ::1 localhost ip6-localhost ip6-loopback) into a rootfs image that has none, an empty one, or a directory there.
  • Change from the design note, after Astra's round 1 (one P2): a symlinked /etc/hosts that leads, inside the image, to a non-empty file is now kept: that file is placed at /etc/hosts. Only a dangling, looping, empty or directory target gets the default.
  • Rootfs page: one new line under "What every process gets" (RFS-4-C155, Luna pass under Paul's delegation).
  • Census: only the rootfsimage envelope re-pinned; Astra's census verdict comes with round 2, which is running.

Next: round 2, green CI, squash-merge. Then it rides the next platform release (Paul's go); Classic re-ships with that CLI.

Merged to main as ca75631 (CI green on the branch tip; Astra R2 READY; census approved on #280). Not released.

For Tito Classic once it is in a release (Paul's go):

  1. Upgrade the carlos CLI to that release.
  2. Re-ship Classic (carlos ship --rootfs ... --jit as today). The image then has /etc/hosts with localhost, and Excon/fog's S3 calls stop failing with ENOENT. No box roll is needed for this fix.

An image that already brings its own non-empty /etc/hosts (or a link to one) keeps it. Until the release, the workaround above still applies (COPY hosts /etc/hosts in the Dockerfile).

nsswitch.conf, services and protocols: unchanged, they come from the image's distribution exactly as on Kubernetes.