** Description changed:

  [ Impact ]
  
- The Noble-to-Resolute upgrade fails in our CI during calculation on most 
desktop flavors
+ The Noble-to-Resolute upgrade fails in our CI during calculation on desktop 
flavors
  that have `lintian` installed. The failure occurs before package downloads:
  
    ERROR Could not calculate the upgrade. An unresolvable problem occurred 
while
    calculating the upgrade.
    ERROR Dist-upgrade failed: 'E:Error, pkgProblemResolver::Resolve generated
    breaks, this may be caused by held packages.'
  
- `lintian` is not installed by default, but `ubuntu-unity-desktop` recommends
- `gdebi`, which in turn recommends `lintian`. This explains why the regression
- appears in some desktop upgrade tests but not in the standard `ubuntu-desktop`
- CI path.
- 
- Proposed fix:
- 
- Do not run the strict resolver while marking the base metapackages for
- installation:
- 
-   - self[pkg].mark_install()
-   + self[pkg].mark_install(auto_fix=False)
- 
- This defers the resolution till we have a full set of packages marked, which
- causes APT to not hold back packages unnecessarily. 
- 
- 
  [ Test Plan ]
  
+ Set up a fresh container
+ ```bash
  lxc launch ubuntu:24.04 test
- 
- # wait...
- 
  lxc shell test
  cloud-init status --wait
  apt update && apt upgrade -y
  apt install ubuntu-desktop -y
  apt install lintian -y
+ ```
  
- mkdir upgrader && cd upgrader
- curl -4fL -o resolute.tar.gz 
http://archive.ubuntu.com/ubuntu/dists/resolute-updates/main/dist-upgrader-all/current/resolute.tar.gz
- tar xzf resolute.tar.gz
+ Reproduce the issue:
  
- -- Attempt 1: Without the patch:
- python3 dist-upgrade.py --frontend=DistUpgradeViewText --disable-gnu-screen
+ ```bash
+ do-release-upgrade
+ ```
  (Expected to fail,  less /var/log/dist-upgrade/apt.log to see the deadlock)
  
- -- Attempt 2: Patching _installMetaPkg in DistUpgradeCache.py
- - self[pkg].mark_install()
- + self[pkg].mark_install(auto_fix=False)
+ Confirm the fix:
  
- then rerunning python3 dist-upgrade.py --frontend=DistUpgradeViewText 
--disable-gnu-screen
+ ```bash
+ do-release-upgrade -p
+ ```
  (It proceeds normally)
  
  [ Where problems could occur ]
  
- I suggest not to start resolving until we marked the full destkop
- metapackage in the sense that it would give APT the whole story to
- resolve correctly. However, it might be the intended behavior, and in
- that case, we would need to actually address the main problem which is
- the heuristic that APT uses to upgrade or hold back packages.
+ One problem that I could see happening is that the early resolution
+ helps the upgrade fail faster without having to go through the full
+ marked set, this needs to be discussed with U-R-U maintainers before
+ proceeding.
  
  [ Other Info ]
  
- 1. The quirk added for LP: #2150319 marks `libfile-libmagic-perl` for install
-    (`DistUpgradeQuirks.py:387`). Although the quirk passes `auto_fix=False`,
-    python-apt still marks the package's dependencies recursively.
+ 1. The quirk added for LP: #2150319 marks libfile-libmagic-perl for
+ install (DistUpgradeQuirks.py:387).
  
- 2. The Resolute version, `libfile-libmagic-perl 1.23-2build2`, depends on
-    `perl (>= 5.40.0-6)`. Marking it pulls `perl 5.40.1-7ubuntu0.4` and related
-    Perl upgrades into the Noble cache, leaving the cache broken.
+ 2. In resolute, libfile-libmagic-perl 1.23-2build2 depends on perl (>=
+ 5.40.0-6), so marking it pulls perl 5.40.1-7ubuntu0.4 and related Perl
+ upgrades.
  
- 3. The cache is already broken when `BaseMetaPkgs` is processed
-    (`DistUpgradeCache.py:587`). That loop calls `mark_install()` with its
-    default `auto_fix=True` (`DistUpgradeCache.py:832-833`), invoking the 
strict
-    resolver over the cache.
+ 3. BaseMetaPkgs is then processed (DistUpgradeCache.py:587); its
+ mark_install() call uses the default auto_fix=True
+ (DistUpgradeCache.py:832-833), running the strict resolver over the
+ broken marked set.
  
- 4. The resolver encounters a conflict involving `lintian`:
-    `libyaml-libyaml-perl 0.904.0+ds-1` breaks the installed `lintian` version,
-    so the resolver tries to upgrade `lintian` to `2.129.0ubuntu2.2`. The new
-    `lintian` requires `libdistro-info-perl >= 1.15ubuntu0.1~`, but the 
resolver
-    holds `lintian` back rather than upgrading `libdistro-info-perl` from
-    `1.7ubuntu0.1`. The resulting unresolved state aborts the upgrade
-    calculation (`DistUpgradeCache.py:861`).
+ 4. The resolver hits a conflict with lintian: a newer libyaml-libyaml-
+ perl (0.904.0+ds-1) breaks the installed lintian, so it tries upgrading
+ lintian to 2.129.0ubuntu2.2. That version needs libdistro-info-perl >=
+ 1.15ubuntu0.1~, but the resolver chooses not to upgrade it and holds
+ lintian back, leaving the state unresolved and aborting
+ (DistUpgradeCache.py:861).
  
- 5. The `BaseMetaPkgs` loop does not catch `SystemError`, so the exception
-    escapes `distUpgrade()` and `self.upgrade(True)` is never reached.
- 
- 6. Ubuntu server is unaffected because he server path skips  
`_installMetaPkgs()`; the desktop path runs it after the
-  pre-upgrade quirks and before the full upgrade calculation:
- 
- 7. In addition, the standard `ubuntu-desktop` metapackage does not pull in
-  `lintian`. These two facts explain why server upgrades and the standard 
desktop
-   CI path are unaffected.
+ 5. Ubuntu server upgrades skip _installMetaPkgs()
+ (DistUpgradeCache.py:595), and the standard ubuntu-desktop metapackage
+ doesn't pull in lintian; together these explain why the usual server and
+ desktop CI paths don't reproduce the bug.
  
  [ References ]
  
  LP: #2150319 - https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-
  upgrader/+bug/2150319

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

Title:
  [SRU] noble→resolute: lintian quirk triggers early resolver failures

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


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

Reply via email to