[Bug 1924604] Re: do-release-upgrade crashed with KeyError in __getitem__(): "The cache has no package named 'python-is-python2'"

Launchpad Bug Tracker 1924604 at bugs.launchpad.net
Thu Jul 15 17:31:41 UTC 2021


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

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

  * tests/test_sources_list.py: remove a port architecture test as the code
    change has not been SRU'ed to 20.04.

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

  * DistUpgrade/DistUpgradeQuirks.py: If universe is not enabled and the
    upgrader is trying to transition from python to python2 produce an error
    message and exit the upgrade process. (LP: #1924604)
  * DistUpgrade/DistUpgradeCache.py: switch to using finally in distUpgrade so
    that error messages in the above quirk will be visible.
  * tests/test_sources_list.py: use distro_info to set releases when
    performing some upgrade tests which fixes test failures when precise
    was moved to old-releases.
  * Update mirrors, demotions, and translations.

 -- Brian Murray <brian at ubuntu.com>  Fri, 02 Jul 2021 16:51:29 -0700

** Changed in: ubuntu-release-upgrader (Ubuntu Focal)
       Status: Fix Committed => Fix Released

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

Title:
  do-release-upgrade crashed with KeyError in __getitem__(): "The cache
  has no package named 'python-is-python2'"

Status in ubuntu-release-upgrader package in Ubuntu:
  Fix Released
Status in ubuntu-release-upgrader source package in Focal:
  Fix Released

Bug description:
  [Impact]
  Users with universe not enabled and python2 packages installed are unable to upgrade from Ubuntu 18.04 to Ubuntu 20.04.

  [Test Plan]
  -----------
  On an Ubuntu 18.04 system with universe and multiverse disabled
  1) apt-get install duplicity (it depends on python2.7)
  2) run do-release-upgrade

  Observe the upgrader hang at Calculating the changes (in text mode)
  kill it and observe a Traceback in /var/log/dist-upgrade/main.log.

  ...
    File "/usr/lib/python3/dist-packages/apt/cache.py", line 303, in __getitem__
      raise KeyError('The cache has no package named %r' % key)
  KeyError: "The cache has no package named 'python-is-python2'"

  With the version of the release-upgrader from -proposed (do-release-
  upgrade -p) you'll instead receive a message regarding universe not
  being enabled and the need to either remove python2 packages or enable
  universe.

  [Where problems could occur]
  The switch to using the finally clause in DistUpgradeCache.py is a significant (albeit safe) change but it is necessary for the error message to actually be displayed. So it'd make sense to run through a whole release upgrade to ensure that the gui behaves normally.

  [Original Description]
  This is because python-minimal was installed and universe was not enabled on the system being upgraded.

  Error Tracker buckets:
  https://errors.ubuntu.com/problem/f92900f3c057db7600d88857e7c05434b69d2496
  https://errors.ubuntu.com/problem/23e6edb38993cb74331d30beeadccdfffe1d557a

  ProblemType: CrashDistroRelease: Ubuntu 20.04
  Package: ubuntu-release-upgrader-core 1:20.04.31
  ProcVersionSignature: Ubuntu 5.4.0-71.79~18.04.1-generic 5.4.101
  Uname: Linux 5.4.0-71-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.23
  Architecture: amd64
  CrashDB: ubuntu
  Date: Thu Apr 15 10:59:53 2021
  ExecutablePath: /usr/bin/do-release-upgrade
  ExecutableTimestamp: 1606763386
  InstallationDate: Installed on 2021-04-13 (1 days ago)
  InstallationMedia: Ubuntu 18.04.5 LTS "Bionic Beaver" - Release amd64 (20200806.1)
  InterpreterPath: /usr/bin/python3.6
  PackageArchitecture: all
  ProcCmdline: /usr/bin/python3 -s ./focal --frontend DistUpgradeViewText
  ProcCwd: /tmp/ubuntu-release-upgrader-e397n4sn
  ProcEnviron:
   TERM=screen
   SHELL=/bin/bash
   LANG=en_US.UTF-8
   LC_CTYPE=en_US.UTF-8
   PATH=(custom, no user)
  Python3Details: /usr/bin/python3.6, Python 3.6.9, python3-minimal, 3.6.7-1~18.04
  PythonArgs: ['/usr/bin/do-release-upgrade', '--frontend', 'DistUpgradeViewText']
  PythonDetails: /usr/bin/python2.7, Python 2.7.17, python-minimal, 2.7.15~rc1-1SourcePackage: ubuntu-release-upgrader
  Title: do-release-upgrade crashed with KeyError in __getitem__(): "The cache has no package named 'python-is-python2'"
  UpgradeStatus: Upgraded to bionic on 2021-04-15 (0 days ago)

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




More information about the foundations-bugs mailing list