[SERVER-46960] Corrupted Package file in Ubuntu Bionic 4.0 repository Created: 18/Mar/20  Updated: 19/Mar/20  Resolved: 19/Mar/20

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Simon Szumyłowicz Assignee: Kelsey Schubert
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-46938 mongodb-org debian repo has malformed... Closed
Operating System: ALL
Steps To Reproduce:

Follow the Ubuntu Bionic installation instructions for MongoDB 4.0:

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update

Participants:

 Description   

Hello,

 

It looks like the [Package file|http://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.0/multiverse/binary-amd64/Packages] for the 4.0 Ubuntu Bionic repository in repo.mongodb.org ended up with an extraneous line at the end:

dpkg-scanpackages: info: Wrote 85 entries to output Packages file.

This is causing apt-get to consider the Packages file to be corrupted:

Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/repo.mongodb.org_apt_ubuntu_dists_bionic_mongodb-org_4.0_multiverse_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.

The problem is not present in the 4.1 or 4.2 repositories. We've got some automated tests running daily that pull the packages file so it's most likely this only got broken today, possibly by the script updating repository listings...



 Comments   
Comment by Kelsey Schubert [ 19/Mar/20 ]

Thanks for the report, this should be fixed now. See the conversation on SERVER-46938.

Comment by Simon Szumyłowicz [ 19/Mar/20 ]

Looks to be fixed for Bionic 4.0 now but for Stretch the issue still remains.

Comment by Johannes Schilling [ 19/Mar/20 ]

the problem is that there is trailing status text in the Packages file. the format specifies, that the entries need to start with a line "Package: <name>", and entries are separated by an empty line.

 

if you look at the problematic files, you will see that at the very end, there is an empty line, followed by a dpkg-scanpackages note:

```

dpkg-scanpackages: info: Wrote 90 entries to output Packages file.

```

 

now that doesn't follow apt's expected format of "Package: <name>", so it complains.

 

i'm guessing that output got there because stdout/stderr was mis-handled in any one of the scripts involved here, and would suggest use of reprepro or similar for maintaining the debian/ubuntu packages. at our site, migrating from old Makefile+shell+dpkg-scanpackages to reprepro not only made the repo more reliable, adding new packages and updating the index was a matter of seconds, not minutes with reprepro.

Comment by Christopher Paris [ 18/Mar/20 ]

Also debian stretch.

 

http://repo.mongodb.org/apt/debian/dists/stretch/mongodb-org/4.0/main/binary-amd64/Packages

Generated at Thu Feb 08 05:12:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.