Upgrade to focal fails with AttributeError: 'NoneType' object has no attribute 'section' in in DistUpgradeCache.py line 942 when default snap packages are not installed

Bug #1856862 reported by Jean-Baptiste Lallement
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Fix Released
High
Jean-Baptiste Lallement
Focal
Fix Released
High
Jean-Baptiste Lallement

Bug Description

TESTCASE
1. Branch auto-upgrade-testing and the upgrade profiles and run the command:

sudo python3 -m upgrade_testing.command_line --adt-args -d -s -c <<PATH_TO_PROFILES>>/ubuntu-eoan-focal-desktop-amd64_qemu.yaml --provision --results-dir <<RESULT_DIR>>

TESTCASE 2
1. Install eoan
2. Remove all the snap pacakges but core and core18
3. run in a terminal: do-release-upgrade -d

Error from main.log
2019-12-18 14:57:50,363 DEBUG Start checking for obsolete pkgs
2019-12-18 14:57:50,524 ERROR got exception '<class 'AttributeError'>': 'NoneType' object has no attribute 'section'
NoneType: None
2019-12-18 14:57:50,532 ERROR not handled exception:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/focal", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/DistUpgrade/DistUpgradeMain.py", line 238, in main
    if app.run():
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/DistUpgrade/DistUpgradeController.py", line 2082, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/DistUpgrade/DistUpgradeController.py", line 2059, in fullUpgrade
    self.doPostUpgrade()
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/DistUpgrade/DistUpgradeController.py", line 1485, in doPostUpgrade
    if not self.cache.tryMarkObsoleteForRemoval(pkgname, remove_candidates, self.foreign_pkgs):
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/DistUpgrade/DistUpgradeCache.py", line 241, in wrapper
    res = f(*args, **kwargs)
  File "/tmp/ubuntu-release-upgrader-oq9n6a1n/DistUpgrade/DistUpgradeCache.py", line 942, in tryMarkObsoleteForRemoval
    if pkgname in self and self[pkgname].installed.section == section:
AttributeError: 'NoneType' object has no attribute 'section'

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: ubuntu-release-upgrader-core 1:20.04.7
ProcVersionSignature: User Name 5.3.0-24.26-generic 5.3.10
Uname: Linux 5.3.0-24-generic x86_64
ApportVersion: 2.20.11-0ubuntu14
Architecture: amd64
CrashDB: ubuntu
Date: Wed Dec 18 16:17:08 2019
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: ubuntu-release-upgrader
UpgradeStatus: Upgraded to focal on 2019-12-18 (0 days ago)
VarLogDistupgradeAptclonesystemstate.tar.gz:
 Error: command ['pkexec', 'cat', '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'] failed with exit code 127: polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
 Error executing command as another user: Not authorized

 This incident has been reported.

Related branches

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
summary: - automated upgrade tests with AttributeError: 'NoneType' object has no
- attribute 'section' in in DistUpgradeCache.py line 942 in
+ automated upgrade tests fail with AttributeError: 'NoneType' object has
+ no attribute 'section' in in DistUpgradeCache.py line 942 in
tryMarkObsoleteForRemoval
tags: added: rls-ff-incoming
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
importance: Undecided → High
summary: - automated upgrade tests fail with AttributeError: 'NoneType' object has
- no attribute 'section' in in DistUpgradeCache.py line 942 in
- tryMarkObsoleteForRemoval
+ Upgrade to focal fails with AttributeError: 'NoneType' object has no
+ attribute 'section' in in DistUpgradeCache.py line 942 when default
+ snap packages are not installed
Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Triaged
description: updated
Changed in ubuntu-release-upgrader (Ubuntu):
assignee: nobody → Jean-Baptiste Lallement (jibel)
Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → In Progress
Changed in ubuntu-release-upgrader (Ubuntu):
status: In Progress → Fix Committed
tags: removed: rls-ff-incoming
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-release-upgrader - 1:20.04.8

---------------
ubuntu-release-upgrader (1:20.04.8) focal; urgency=medium

  [ Jean-Baptiste Lallement ]
  * Do not install a snap package if the corresponding debian package is not
    installed (LP: #1856996)
  * Fixed crash when checking a section of a package when the package is a
    snap (LP: #1856862)
  * Update release to 20.04 in UI (LP: #1856948)

  [ Brian Murray ]
  * Translations, demotions and mirror updates.

 -- Brian Murray <email address hidden> Fri, 20 Dec 2019 13:14:26 -0800

Changed in ubuntu-release-upgrader (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.