omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy dns: a bridge/bond port profile aborts the run, leaving the remaining connections on the old DNS

Open Yannick-Pinta opened this issue 2 months ago • 4 comments

What happens

omarchy dns <provider> aborts with exit 2 as soon as its loop reaches a NetworkManager port profile (a bridge or bond member). Every connection processed before the abort is updated; every connection after it keeps its previous DNS. Nothing surfaces the failure when the command is triggered from the menu, so the switch silently applies to only part of the system.

$ omarchy dns DHCP
Error: invalid or not allowed setting 'ipv4': port connections cannot have IP configuration.
$ echo $?
2

Steps to reproduce

No special hardware needed — two throwaway profiles are enough (the loop iterates over profiles, not devices, so the interface need not exist):

nmcli connection add type bridge con-name br-test ifname br-test
nmcli connection add type ethernet con-name br-test-port ifname eth-nonexistent controller br-test

omarchy dns DHCP     # -> Error: ... port connections cannot have IP configuration ; exit 2

nmcli connection delete br-test br-test-port

Anyone running a bridged setup hits this permanently: libvirt bridges, Docker/br0 setups, USB-NIC bridges.

Expected

Port profiles are skipped, the remaining connections are updated, and the command reports what it did.

Root cause

bin/omarchy-dns filters candidates on connection type only:

networkmanager_dns_connection() {
  case "$1" in
    802-11-wireless|802-3-ethernet) return 0 ;;
    *) return 1 ;;
  esac
}

A bridge port is 802-3-ethernet, so it passes the filter — but NetworkManager rejects any IP setting on it:

$ nmcli -t -f connection.type,connection.controller,connection.port-type connection show br0-port-XXXX
connection.type:802-3-ethernet
connection.controller:br0
connection.port-type:bridge

$ nmcli connection modify br0-port-XXXX ipv4.ignore-auto-dns no ipv4.dns "" ipv6.ignore-auto-dns no ipv6.dns ""
Error: invalid or not allowed setting 'ipv4': port connections cannot have IP configuration.
$ echo $?
2

With set -euo pipefail (line 7), that single failure kills the whole run inside set_connection_dns() / clear_connection_dns().

Why it goes unnoticed

current_dns_provider() reads only /etc/NetworkManager/conf.d/20-omarchy-dns.conf and DNS= in /etc/systemd/resolved.conf — never the per-connection settings. After a partial run it reports DHCP while most connections still pin 1.1.1.1 via ipv4.dns + ipv4.ignore-auto-dns=yes. On my machine the indicator said DHCP for weeks while three of four saved networks forced Cloudflare.

That has a real consequence: a captive portal redirects by hijacking the network's own DNS. With connections pinned to 1.1.1.1, the portal's resolver is never queried, the login page never loads, and the Wi-Fi just looks dead — which is exactly the experience described in #9610. resolvectl dns is the reliable check:

before:  Link 2 (wlp0s20f3): 1.1.1.1 1.0.0.1      <- pinned, portal cannot redirect
after :  Link 2 (wlp0s20f3): 10.x.x.x             <- DHCP-provided, portal works

Suggested fix

  1. In networkmanager_dns_connection(), also skip profiles where connection.controller / connection.port-type (or the legacy connection.master / connection.slave-type) is set.
  2. Do not let one nmcli connection modify failure abort the loop — report the skipped profile and continue.
  3. Make current_dns_provider() take the per-connection settings into account, so a partial state is visible rather than reported as DHCP. (Related to #10245, which reports a different inaccuracy in the same function.)

System

  • Omarchy 4.0.3-1 (bin/omarchy-dns on the default branch is byte-identical to the installed copy, so this is current)
  • NetworkManager 1.58.1-1, systemd 261.2-1, kernel 7.2.3-arch1-3

Related: #9610 (captive portal detection), #10245 (omarchy dns misreporting the provider).

Yannick-Pinta avatar Sep 12 '26 11:09 Yannick-Pinta

Confirmed in source on quattro (e71a816e). networkmanager_dns_connection() (bin/omarchy-dns:168) filters saved profiles only by type, so a bridge or bond port, which is 802-3-ethernet, gets through. The nmcli connection modify in set_connection_dns() (line 184) or clear_connection_dns() (line 200) then fails on it. Under set -euo pipefail (line 7) that one failure stops the run: later profiles are skipped, and resolved.conf and reload_dns_stack are never reached. This is the abort you describe.

#11476 is the open fix for it. It skips profiles that have a connection.controller (bridge, bond and team ports), and it no longer lets a rejected modify abort the loop. That second change also covers the link-local / disabled IPv6 profiles raised in that pull request's thread. Earlier, on a disposable Omarchy worker running NetworkManager 1.58.1, omarchy dns DHCP on quattro exited 2 at a bridge port profile, the branch completed, and reverting the fix brought the failure back. That pull request is being reviewed as its own item, and merging it is the maintainer's call. It does not yet close this issue on merge: its description says "Addresses #11448", and omabot declined to add the link because the branch has changed since it was last classified. The link waits on that review.

Your third point is not covered by #11476 or any other open pull request: current_dns_provider() (line 100) reads only the global drop-in and resolved.conf, never per-connection DNS, so a partially applied switch still reports DHCP. Deciding what the indicator should say for a mixed state is a behaviour choice, so it is left to the maintainer rather than fixed here. #10245 / #10259 change how the same function classifies servers, but not this. #8908 takes a different approach: it rewrites omarchy-dns to stop editing saved profiles at all.

Only Claude Opus 5.5 reviewed this. No second opinion ran: the reviewer (Codex Medium) is reachable, but today's review budget is spent. Waiting on the maintainer to decide on #11476.

omarchybot avatar Oct 11 '26 14:10 omarchybot

Fix is open as #11476. Once that lands this can close.

jandrusk avatar Oct 13 '26 16:10 jandrusk

Second opinion, now that one could run: Codex Medium reviewed this issue against quattro (ecf0eb36) and #11476 (ba37d091). The bug as reported is unchanged on quattro; bin/omarchy-dns has not been touched since the last comment. Codex agrees with the earlier finding. The abort is real: a bridge, bond or team port passes the type filter at bin/omarchy-dns:168, and the unguarded nmcli connection modify stops the run under set -euo pipefail. #11476 removes that abort, because it skips any profile that has a connection.controller, so later profiles, resolved.conf and the reload are all reached. Independence is not guaranteed, since the reviewer can read earlier write-ups.

Codex also found two things about #11476 that were not raised before, and I checked both in the source:

  • The new nmcli -g connection.controller lookup ends in || continue. On a NetworkManager too old to know that property (it arrived in 1.46), every profile would be skipped and the command would still exit 0. Arch ships 1.58, so this does not affect a current Omarchy install.
  • When setting a provider, a rejected nmcli connection modify now prints a warning and the run carries on to exit 0. The network panel sets its provider indicator whenever the command exits 0 (shell/plugins/panels/network/Panel.qml:931). So a profile that refused the change is now reported in the panel as switched, where before the run failed. Only a DHCP reset that fails exits 1.

Both points go to #11476's own review. Your third point, current_dns_provider() ignoring per-connection DNS, is still not addressed by any open pull request, and what it should report for a mixed state is the maintainer's decision.

#11476 still does not close this issue when it merges. Its description says "Addresses #11448", and omabot again declined to add Fixes #11448 because the branch has had new commits since it was last classified. The link waits on that review. Waiting on the maintainer to decide on #11476.

omarchybot avatar Oct 14 '26 00:10 omarchybot

The missing-link finding in the earlier comments is resolved: #11476 now contains Fixes #11448, and GitHub lists this issue among those it closes on merge. #14350 also includes the port-profile fix and links this issue for closure. Both remain open, so no additional fix PR was filed.

I checked quattro at 2ebf5971 and both diffs. The original type-only filter and unguarded profile modifications remain on quattro. Both PRs skip controller-backed ports and continue past rejected modifications. Neither implements your third request to show mixed per-profile DNS in the provider indicator, so merging either would close this issue with that question still undecided.

Codex High reviewed this with Opus 5.5 High and muse-wonder via pi, thinking high. Both reviewers agreed with waiting on the existing fixes and the maintainer's decision about the indicator; independence is not guaranteed. This round checked source only; no new worker reproduction was run. Nothing further is needed from you for the reported abort.

omarchybot avatar Nov 27 '26 00:11 omarchybot