Skip to content

Inject /etc/resolv.conf into VM rootfs to fix DNS failure cycling#11

Merged
guifranchi merged 1 commit into
mainfrom
fix/inject-resolv-conf
May 21, 2026
Merged

Inject /etc/resolv.conf into VM rootfs to fix DNS failure cycling#11
guifranchi merged 1 commit into
mainfrom
fix/inject-resolv-conf

Conversation

@guifranchi

@guifranchi guifranchi commented May 21, 2026

Copy link
Copy Markdown
Contributor

Problem

VMs on ci-hel3 were cycling every ~3 seconds. Diagnostic testing confirmed the root cause:

resolv.conf: [EMPTY]
ping 1.1.1.1: SUCCESS
DNS: FAILED

systemd-networkd clears /etc/resolv.conf when it takes over the interface. With systemd-resolved masked in the base image, networkd never writes DNS entries back to the file — even when DNS= is set in the .network unit. The result is an empty resolv.conf inside every VM.

config.sh tries to reach api.github.com on startup, gets a DNS failure, exits non-zero, and the ExecStopPost=+/usr/sbin/reboot in runner.service triggers an immediate reboot — producing the 3-second cycle.

Fix

  • Overwrite /etc/resolv.conf in inject_config() right after writing eth.network, so nameserver 1.1.1.1 is always present regardless of what networkd does during boot.
  • Also add DNS=1.1.1.1 to the eth.network template as a belt-and-suspenders measure.

Test plan

  • Deploy new binary to ci-hel3
  • Restart actions-runner.service
  • Confirm runners appear in GitHub org settings (Settings → Actions → Runners)
  • Confirm no more 3-second cycling in journalctl -u actions-runner

systemd-networkd clears /etc/resolv.conf when it takes over the
interface, and with systemd-resolved masked the DNS entries from
eth.network are never written back. The result is an empty resolv.conf
inside the VM, causing config.sh to fail immediately when it tries to
reach api.github.com, which triggers the ExecStopPost reboot and the
3-second cycling we observed on ci-hel3.

Fix: overwrite /etc/resolv.conf from inject_config() right after writing
eth.network, so the file is always present regardless of what networkd
does during boot. Also add DNS=1.1.1.1 to the eth.network template as a
belt-and-suspenders measure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@guifranchi guifranchi self-assigned this May 21, 2026
@guifranchi guifranchi added the bug label May 21, 2026
@backlog-helper

Copy link
Copy Markdown

Hi @guifranchi,

We've found some issues with your Pull Request.

  • This Pull Request is missing reviewers. Either convert this Pull Request into a draft or ignore this rule by adding [skip review] to your Pull Request body. - (More info)

New issue guide | Backlog management | Rules | Feedback

@guifranchi
guifranchi merged commit 0d4de48 into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant