apt doesn't detect file corruption in /var/lib/apt/lists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
The Problem
=======
/var/lib/apt/lists contains the repository index caches or similar; I'm not sure what the correct apt-terminology is.
I've installed Chrome on my laptop, so I have:
smacdonald@
-rw-r--r-- 1 root root 943 Dec 19 14:02 dl.google.
-rw-r--r-- 1 root root 819 Dec 19 14:02 dl.google.
-rw-r--r-- 1 root root 4457 Dec 19 14:02 dl.google.
for example.
dl.google.
smacdonald@
Origin: Google LLC
Label: Google
Suite: stable
Codename: stable
Version: 1.0
Date: Wed, 19 Dec 2018 18:51:54 UTC
Architectures: amd64
Components: main
Description: Google chrome-linux software repository
MD5Sum:
9e0d0ad6a4f5cc
a17f6de0ef487b
156e5ea7a0c6be
SHA1:
4c2cde4f71476d
e002924c9ddfe4
0f4348c2d4d7cc
SHA256:
fb0e586c2b5ec5
2462cff7327656
c1e3c931838186
If the dl.google.
The Context
=======
Our IoT devices run Ubuntu 16.04, and their main storage is eMMC. Sometimes there are catastrophic power cuts, and, despite other precautions, files are occasionally corrupted in the manner of becoming 0 bytes in length. We're not sure exactly why or how.
Today a deployed device suffered the above scenario. We maintain a debian package repository for updating our devices in the field, and we suddenly couldn't install packages from it. A bit of investigation turned up the 0 byte *_Packages file for our repo, and we worked around the problem.
Part of the situation is our debian repository doesn't have updates very often, so 'sudo apt-get update' was giving a Hit: instead of a Get: result all the time, and everything from the "normal user command line" side of things looked okay. There were no logs in /var/log/syslog either. We just could not see our packages from our repo, despite 'apt-get update' looking good.
What I Expected to Happen
=======
Given that the the *_Release file contains checksums for the *_Package file, I would expect that apt verifies the checksum, and if it fails, refetches the repository information even if there hasn't been an update, during any given 'apt update' operation.
Further Information
=======
I checked apt's project in Debian at https:/
The situation occurred on an Ubuntu 16.04 system, but is 100% reproducible with Google's chrome repository on my Ubuntu 18.04.1 laptop. I can provide a set of reproduction steps if needed, but it's fairly straight-forward.
The fact that this corruption appears to be "everything working okay" to the end user, except that apt doesn't know about packages it says it knows about, and there is no error logging for any sort, is partly why I'm filing this.
Note the "if one of two things happens" case a) above: if the repository has updates, apt re-fetches the repository information, and overwrites/removes the existing. This has the effect of accidentally fixing the problem without any data indicating the problem occurred in the first place. So it is probable that the problem is under-reported because it's not visible. Especially for frequently updated repositories like the core Ubuntu repos.
System Details
=======
smacdonald@
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
smacdonald@
apt:
Installed: 1.6.6
Candidate: 1.6.6
Version table:
*** 1.6.6 500
500 http://
100 /var/lib/
1.6.3ubuntu0.1 500
500 http://
1.6.1 500
500 http://
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: apt 1.6.6
ProcVersionSign
Uname: Linux 4.15.0-42-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Dec 19 16:21:16 2018
InstallationDate: Installed on 2018-05-11 (222 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
I'm just curious, but what filesystem are those filesystems on? My understanding is that 0 byte files should not happen on ext4 at least.