apt update: Can not add an empty (zero-length) key to the cache

Bug #1982198 reported by Luís Infante da Câmara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
appstream (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
New
Undecided
Unassigned

Bug Description

When running sudo apt update, I get the following warning after the "Fetched" message:

Can not add an empty (zero-length) key to the cache

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: apt 2.0.9
ProcVersionSignature: Ubuntu 5.15.0-41.44~20.04.1-generic 5.15.39
Uname: Linux 5.15.0-41-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.24
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Tue Jul 19 16:44:36 2022
InstallationDate: Installed on 2022-04-26 (84 days ago)
InstallationMedia: Ubuntu 20.04.4 LTS "Focal Fossa" - Release amd64 (20220223)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Luís Infante da Câmara (luis220413) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

This string does not exist in apt or any of the other Ubuntu code I have checked out. If you can reproduce it, do check where it is coming from and reassign it there.

affects: apt (Ubuntu) → ubuntu
Changed in ubuntu:
status: New → Incomplete
Revision history for this message
Luís Infante da Câmara (luis220413) wrote (last edit ):

It is coming from the appstream source package.

Steps to reproduce:
1. Create a minimal Ubuntu 20.04 chroot with all packages that install files in /etc/apt/apt.conf.d on my Ubuntu 20.04 VM installed (that is, update-notifier-common, debconf, aptdaemon, apt-config-icons, apt-config-icons-hidpi, packagekit, appstream, apt, unattended-upgrades, ubuntu-advantage-tools, snapd and command-not-found).
2. Get the source code for all packages in the chroot with apt source SOURCE_PACKAGE_NAMES.
3. Run the following command:

$ grep -Fr 'Can not add an empty (zero-length) key to the cache'
appstream-0.12.10/.pc/01_less-long-token-noise.patch/src/as-cache.c: "Can not add an empty (zero-length) key to the cache");
appstream-0.12.10/src/as-cache.c: "Can not add an empty (zero-length) key to the cache");

Changed in ubuntu:
status: Incomplete → New
affects: ubuntu → appstream (Ubuntu)
Revision history for this message
Matthias Klumpp (ximion) wrote :

This issue does not longer exist in appstream since jammy - so the quickest fix is to simply upgrade to that release.

Changed in appstream (Ubuntu):
status: New → Fix Released
Revision history for this message
Luís Infante da Câmara (luis220413) wrote :

This just happened again.

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.