Public bug reported:

[ Impact ]

- jammy→noble upgrades can abort at the thunderbird/firefox deb-to-snap
  transition, leaving the system partially upgraded.
- The upgrader disables the systemd-resolved stub, but a warm snapd keeps
  querying 127.0.0.53 and cannot reach the snap store.
- This is failing in our CI: the jammy→noble ubuntu-desktop profile fails at
  the thunderbird step.
- The preinst retries for 30 minutes, exits 1, and dpkg aborts.

[ Test Plan ]

- Control: stock noble-updates, no `-p`.
  - Build the image:
    `autopkgtest-buildvm-ubuntu-cloud -a amd64 -r jammy --post-command 'apt-get 
update && apt-get install -y snapd ubuntu-release-upgrader-core thunderbird'`
  - Boot:
    `qemu-system-x86_64 -enable-kvm -m 3G -smp 2 -snapshot -nographic -hda 
autopkgtest-jammy-amd64.img -nic user,model=virtio-net-pci`
  - In the guest, make snapd warm:
    `sudo systemctl enable --now snapd.socket; sudo systemctl restart snapd; 
sudo snap install hello-world;
  - Run:
    `sudo do-release-upgrade -f DistUpgradeViewNonInteractive`
  - Expected after ~5–10 minutes: `1-thunderbird...` prints
    `Unable to contact the store...` and retries.
- Fixed: fresh boot, allow networking, repeat the guest commands.
  - Run:
    `sudo do-release-upgrade -p -f DistUpgradeViewNonInteractive`
  - Expected after ~10–15 minutes: the upgrade exits 0.

[ Where problems could occur ]

- The utime must run only after a successful resolved restart: put it in the
  `else` block of the existing try/except.
- If the uplink file is missing or `/run` is read-only, `os.utime` raises
  `OSError`; catch it, log at debug level, and never abort the upgrade.
- Every successful quirk run now touches the uplink once; other mtime watchers
  may reload once (metadata-only change).
- A later resolved rewrite may race with the touch; this is not stress-tested.

**TLDR:** Main risks are placement, failure handling, and the one extra
metadata change per upgrade.

[ Other Info ]

- Root cause: resolved writes the stub and uplink in one call; on jammy both can
  get the same mtime, and `conservative_rename()` preserves the uplink's mtime
  when the quirk switches `/etc/resolv.conf` to it.
- Snapd's Go resolver compares only mtime, so warm snapd keeps 127.0.0.53. This 
needs
  the pure-Go resolver: Go >= 1.20 with edns0/trust-ad and no cgo-forcing
  nsswitch source; on jammy that means snapd 2.77.1+ debs or 2.68+ snaps.
- QEMU/autopkgtest uses IPv4-only user networking with no RDNSS/DHCPv6 DNS, so
  the mtimes stay equal. LXD sends a late RA RDNSS and the uplink is
  modified, the mtimes differ, and snapd reloads.
- Fix: after a successful resolved restart, call
  `os.utime('/run/systemd/resolve/resolv.conf')`.

TLDR: Same-mtime resolver files (resolv.conf and stub-resolv.conf) plus Go's 
mtime-only check hide the quirk's symlink switch from snapd; the noble upgrader 
fix refreshes the file mtime
after the restart.

** Affects: ubuntu-release-upgrader (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2178399

Title:
  [SRU] jammy→noble: stale snapd DNS cache breaks the thunderbird snap
  transition

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2178399/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to