[Bug 1876034] Re: apt update crashes with "KeyError: 'suite'" in cnf-update-db if index compression is enabled

Michael Sparmann 1876034 at bugs.launchpad.net
Thu Jul 2 14:27:35 UTC 2020


Actually, upon a closer look, it appears like command-not-found has been entirely unmaintained for more than 2 years now, so efforts to get this fixed upstream, let alone backported to focal, are probably futile.
We should probably just remove this package from our base image and let the end user install some fixed fork of it from a PPA, if they need it. Luckily there's no hard dependency to it from ubuntu-standard.

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

Title:
  apt update crashes with "KeyError: 'suite'" in cnf-update-db if index
  compression is enabled

Status in command-not-found package in Ubuntu:
  Confirmed

Bug description:
  On all Ubuntu releases since at least 19.10, enabling compressed APT
  package list storage with command-not-found installed leads to this
  crash in the cnf-update-db hook called by apt update:

  Traceback (most recent call last):
    File "/usr/lib/cnf-update-db", line 26, in <module>
      col.create(db)
    File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 93, in create
      self._fill_commands(con)
    File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 127, in _fill_commands
      self._parse_single_commands_file(con, fp)
    File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 165, in _parse_single_commands_file
      suite=tagf.section["suite"]
  KeyError: 'suite'

  (To enable compressed APT list storage, add Acquire::GzipIndexes
  "true"; to an apt.conf fragment.)

  This appears to be caused by apt downloading an lz4-compressed command
  list for command-not-found and cnf-update-db passing the
  /var/lib/apt/lists/*Commands-*.lz4 files to db/creator.py, which does
  not know about the compression and attempts to parse them as plain
  text.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/command-not-found/+bug/1876034/+subscriptions



More information about the foundations-bugs mailing list