apt update crashes with "KeyError: 'suite'" in cnf-update-db if index compression is enabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
command-not-found (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned | ||
Hirsute |
Fix Released
|
Medium
|
Unassigned | ||
Impish |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
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/
col.create(db)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
suite=
KeyError: 'suite'
(To enable compressed APT list storage, add Acquire:
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/
[Test plan]
Enable the option, purge old lists, and update to populate lists directory with compressed files; this will run cnf-update-db for you.
[Where problems could occur]
Replacing the open() call with subprocess.Popen for apt-helper seems like a minimal change. If apt-helper has problems, we check the return code and fail, keeping the old db in place.
Changed in command-not-found (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: rls-ii-incoming |
tags: | added: fr-1673 |
Changed in command-not-found (Ubuntu Impish): | |
status: | Confirmed → Triaged |
tags: | removed: rls-ii-incoming |
description: | updated |
Changed in command-not-found (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in command-not-found (Ubuntu Hirsute): | |
importance: | Undecided → Medium |
tags: |
added: verification-done-focal removed: verification-needed-focal |
tags: |
added: verification-done verification-done-hirsute removed: verification-needed verification-needed-hirsute |
Status changed to 'Confirmed' because the bug affects multiple users.