Package: command-not-found
Version: 20.10.1-1
Severity: grave
Tags: patch
X-Debbugs-Cc: deb...@rocketjump.eu, k...@debian.org

Hi Julian,

(this is somewhat related to #968757 and #954249)
(kibi CCed)

Steps to reproduce (on an bullseye installation)
1) Install command-not-found
2) Edit /etc/apt/sources.list to 
deb http://deb.debian.org/debian/ bookworm main contrib non-free 
non-free-firmware
(note the new component non-free-firmware)
3) run `apt update`
# apt update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://deb.debian.org/debian bullseye-backports InRelease
Hit:5 https://packages.chef.io/repos/apt/stable bullseye InRelease       
Hit:6 http://deb.debian.org/debian bookworm InRelease
Hit:7 http://deb.debian.org/debian sid InRelease
Hit:8 http://deb.debian.org/debian experimental InRelease
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 26, in <module>
    col.create(db)
  File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 95, 
in create
    self._fill_commands(con)
  File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 143, 
in _fill_commands
    self._parse_single_contents_file(con, f, fp.stdout)
  File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 282, 
in _parse_single_contents_file
    priority = component_priorities[component]
KeyError: 'non-free-firmware'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test 
-w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then 
/usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

This is already fixed in unstable, but in it's current form this will break the
upgrade path from bullseye to bookworm. The fix is trivial, adding
`'non-free-firmware': 60,` to CommandNotFound/db/creator.py is enough. I propose
doing a p-u to fix it.

Greets,
Lee

-- System Information:
Debian Release: 11.6
  APT prefers stable-updates
  APT policy: (990, 'stable-updates'), (990, 'stable-security'), (990, 
'stable'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-0.deb11.6-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages command-not-found depends on:
ii  apt-file     3.2.2
ii  lsb-release  11.1.0
ii  python3      3.9.2-3
ii  python3-apt  2.2.1

command-not-found recommends no packages.

Versions of packages command-not-found suggests:
pn  snapd  <none>

-- no debconf information

-- debsums errors found:
debsums: changed file 
/usr/share/command-not-found/CommandNotFound/db/creator.py (from 
command-not-found package)

Reply via email to