[Bug 2147202] Re: unattended-upgrades hangs indefinitely at apt.Cache.__init__() after systemd-networkd-wait-online timeout and ESM DNS failure (Ubuntu 24.04 VPS)

Ferenc Collins 2147202 at bugs.launchpad.net
Fri Apr 3 13:37:51 UTC 2026


*** This bug is a duplicate of bug 2147201 ***
    https://bugs.launchpad.net/bugs/2147201


** Attachment added: "LAUNCHPAD_BUG_REPORT.md"
   https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/2147202/+attachment/5958215/+files/LAUNCHPAD_BUG_REPORT.md

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

Title:
  unattended-upgrades hangs indefinitely at apt.Cache.__init__() after
  systemd-networkd-wait-online timeout and ESM DNS failure (Ubuntu 24.04
  VPS)

Status in unattended-upgrades package in Ubuntu:
  New

Bug description:
  ### Problem
  unattended-upgrades starts but hangs indefinitely inside `apt.Cache.__init__()` with no CPU usage. The system becomes almost         
  completely unresponsive in userspace (soft lockup) while the kernel still responds to ACPI power button events. This led to a 4+ hour
   hang requiring a manual power button shutdown.                                                                                      
                                                                  
  **Environment:** Ubuntu 24.04 (Noble) on VPS (QEMU/KVM), unattended-upgrades 2.9.1+nmu4ubuntu1, NOT subscribed to Ubuntu Pro.

  ### Steps to Reproduce / Timeline
  1. systemd-networkd-wait-online timed out (default 120s timeout exceeds VPS interface bringup time)
  2. ESM cache step failed with DNS errors for esm.ubuntu.com (Ubuntu Pro/ESM hooks active despite no subscription)                    
  3. unattended-upgrades started at 08:01:23 → hung at `apt.Cache(rootdir=...)` after "Initial whitelist..." log line
                                                                                                                                       
  Exact timeline from logs:                                       
  - 06:13 & 08:01: systemd-networkd-wait-online timeout
  - 08:01:21: ESM DNS failure ("Temporary failure resolving 'esm.ubuntu.com'")
  - 08:01:23: unattended-upgrades starts → hangs at apt.Cache.__init__()
                                                                                                                                       
  ### Workaround that resolved it
  1. Disabled ESM lines in /etc/apt/apt.conf.d/50unattended-upgrades (Ubuntu Pro not subscribed)                                       
  2. Overrode systemd-networkd-wait-online with `--any --timeout=10` (VPS-friendly)
  3. Added hardening options (Mail on error, Remove-Unused-Dependencies, Debug logging)

  After these changes, `unattended-upgrades --dry-run` completes
  successfully and `apt update` no longer shows ESM DNS errors.

  ### Expected Behaviour
  unattended-upgrades should either succeed, fail gracefully with clear error messages, or have a reasonable timeout instead of hanging
   indefinitely and causing system unresponsiveness.                                                                                   
   
  ### Additional Info                                                                                                                  
  - This appears specific to VPS/cloud environments where systemd-networkd-wait-online timeout occurs
  - The hang occurs in apt.Cache.__init__() when it tries to initialize package cache with ESM repositories that have DNS resolution
  failures
  - No OOM or resource exhaustion - system had 28% memory usage at crash
  - Affects systems WITHOUT Ubuntu Pro subscription where ESM is still enabled in unattended-upgrades

  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: unattended-upgrades 2.9.1+nmu4ubuntu1
  ProcVersionSignature: Ubuntu 6.8.0-106.106-generic 6.8.12
  Uname: Linux 6.8.0-106-generic x86_64
  ApportVersion: 2.28.1-0ubuntu3.8
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CloudArchitecture: x86_64
  CloudBuildName: server
  CloudID: nocloud
  CloudName: unknown
  CloudPlatform: nocloud
  CloudSerial: 20260307
  CloudSubPlatform: seed-dir (/var/lib/cloud/seed/nocloud)
  Date: Fri Apr  3 12:56:25 2026
  PackageArchitecture: all
  ProcEnviron:
   LANG=C.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=tmux-256color
   XDG_RUNTIME_DIR=<set>
  SourcePackage: unattended-upgrades
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/2147202/+subscriptions




More information about the foundations-bugs mailing list