OverFlow error when using cnf-extractor

Bug #1998265 reported by Brian Murray
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Undecided
Julian Andres Klode
Bionic
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Large files can't be downloaded as we use a 32-bit integer in AcquireFile constructor, this breaks e.g. command-not-found generator:

I'm trying to update the command-not-found indexes (bin/cnf-extract.py $MIRROR $suite $component $arch) on the production cnf extractor system (running bionic) and have encountered Tracebacks when generating them for Jammy and Lunar. This is causing the command not found indexes to be out of date for all(?) releases of Ubuntu.

The lunar failure:

Get:1 dotnet-sdk-6.0_6.0.111-0ubuntu3_amd64.deb [79.1 MB]
Fetched 79.1 MB in 0s (0 B/s)
Traceback (most recent call last):64... 7%
  File "./bin/cnf-extract.py", line 54, in <module>
    mirror_root, suite, component, arch)
  File "/srv/cnf-extractor/extractor/extractor.py", line 174, in command_not_found_extract
    debpath = pkg.candidate.fetch_binary(destdir=tmpdir)
  File "/usr/lib/python3/dist-packages/apt/package.py", line 883, in fetch_binary
    self.size, base, destfile=destfile)
OverflowError: signed integer is greater than maximum

I'll get more context for the Jammy failure but it wouldn't surprise me if it was the same package.

[Test plan]
I have included a test for the AcquireFile constructor to accept a large file size, and then a test that ensures it can read the file size.

Run the autopkgtest suite.

[Where problems could occur]
It could fail in other places now.

For kinetic, the package was copied in from lunar without changes. This upload is actually built in kinetic and hence there is additional regression potential from toolchain changes.

[Other info]
Also including some auxiliary changes as we move back to proper upstream releases to enable testing, mostly around

d/gbp.conf, .gitlab-ci.yml - being updated to point at right places
d/t/control - adding a missing test dependency
data/ - updated mirror lists

The mirror lists are standard updates; the debian/tests/control change
is needed to enable testing on more minimal autopkgtest images (our images
accidentally include binutils); the other changes have zero impact on the Ubuntu infra or end user side as they only run during development.

Revision history for this message
Brian Murray (brian-murray) wrote :

Well the context for the Jammy traceback isn't as useful:

Traceback (most recent call last):verse/amd64... 8%
  File "./bin/cnf-extract.py", line 54, in <module>
    mirror_root, suite, component, arch)
  File "/srv/cnf-extractor/extractor/extractor.py", line 174, in command_not_found_extract
    debpath = pkg.candidate.fetch_binary(destdir=tmpdir)
  File "/usr/lib/python3/dist-packages/apt/package.py", line 883, in fetch_binary
    self.size, base, destfile=destfile)
OverflowError: signed integer is greater than maximum

description: updated
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Here's my guess:

$ echo "l(2875204834)/l(2)" | bc -ql
31.42101759351087610555

Package: dotnet-sdk-6.0-source-built-artifacts
Architecture: amd64
Version: 6.0.111-0ubuntu3
Priority: optional
Section: universe/devel
Source: dotnet6
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 2846146
Filename: pool/universe/d/dotnet6/dotnet-sdk-6.0-source-built-artifacts_6.0.111-0ubuntu3_amd64.deb
Size: 2875204834
MD5sum: 8f245b799d02fc637a871183d161273a
SHA1: 29728e493a97811bd1f6a25d93dd9a76bc3c95e5
SHA256: 1429baab871dfb2ba2717c99ccd55379c1a41eb75f0eb311faf18b23475f9938
SHA512: 20e5ae0ff1427ccfdf930a64aac419c66d4567420e31de6367d9d7e2aef1e6f0e47f0980fc6d5f44e70f1c1be20e56fb8a034d2022405281eaa9ca520b361d73
Homepage: https://dot.net/core
Description: Internal package for building dotNet 6.0 Software Development Kit
Description-md5: c5f0dc17274bcdd68c9a9d09b85e6a60

Revision history for this message
Brian Murray (brian-murray) wrote :

And it also failed with dotnet-sdk-6.0 for Kinetic:

Get:1 dotnet-sdk-6.0_6.0.111-0ubuntu1~22.10.1_amd64.deb [79.1 MB]
Fetched 79.1 MB in 0s (0 B/s)
Traceback (most recent call last):niverse/amd64... 11%
  File "./bin/cnf-extract.py", line 54, in <module>
    mirror_root, suite, component, arch)
  File "/srv/cnf-extractor/extractor/extractor.py", line 174, in command_not_found_extract
    debpath = pkg.candidate.fetch_binary(destdir=tmpdir)
  File "/usr/lib/python3/dist-packages/apt/package.py", line 883, in fetch_binary
    self.size, base, destfile=destfile)
OverflowError: signed integer is greater than maximum

affects: apt (Ubuntu) → python-apt (Ubuntu)
Revision history for this message
Julian Andres Klode (juliank) wrote :

>>> acq=apt.apt_pkg.Acquire()
>>> apt.apt_pkg.AcquireFile(acq,"http://foo", "foo", size=2875204834)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: signed integer is greater than maximum

Changed in python-apt (Ubuntu):
status: New → In Progress
assignee: nobody → Julian Andres Klode (juliank)
Changed in python-apt (Ubuntu Bionic):
status: New → In Progress
description: updated
Changed in python-apt (Ubuntu Focal):
status: New → In Progress
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted python-apt into kinetic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-apt/2.4.0+22.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-kinetic to verification-done-kinetic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-kinetic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in python-apt (Ubuntu Kinetic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-kinetic
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted python-apt into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-apt/2.4.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in python-apt (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed-jammy
Changed in python-apt (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted python-apt into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-apt/2.0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in python-apt (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted python-apt into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-apt/1.6.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Brian Murray (brian-murray) wrote :

I removed the try / except OverflowError handling in the production command-not-found-extractor and was able to run the job successfully with the new version of python-apt.

ubuntu@juju-8cacac-prod-cnf-extractor-0:/srv/cnf-extractor$ apt-cache policy python3-apt
python3-apt:
  Installed: 1.6.6
  Candidate: 1.6.6
  Version table:
 *** 1.6.6 500
        500 http://prodstack-zone-1.clouds.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1.6.5ubuntu0.7 500
        500 http://prodstack-zone-1.clouds.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     1.6.5ubuntu0.5 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     1.6.0 500
        500 http://prodstack-zone-1.clouds.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 2.5.0

---------------
python-apt (2.5.0) unstable; urgency=medium

  [ Jelmer Vernooij ]
  * Fix attribute name in indexfile.py.
  * Expose MetaIndex.type.

  [ Michael Vogt ]
  * debian: remove `python3-*-dbg` packages (Closes: #994348)
  * apt: fix mypy in apt.progress.text.AcquireProgress

  [ Julian Andres Klode ]
  * AcquireFile: Handle large files (LP: #1998265)
  * apt/progress/base.py: Return False in default cdrom change
  * Code style fixes
  * Mirror list updates
  * d/t/control: Depend on binutils for ar
  * Untrack all GC tracked objects before freeing them (LP: #1997036)

  [ Steve Langasek ]
  * Drop references to archive.canonical.com (LP: #1959343)

 -- Julian Andres Klode <email address hidden> Wed, 30 Nov 2022 17:35:59 +0100

Changed in python-apt (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 1.6.6

---------------
python-apt (1.6.6) bionic; urgency=medium

  * The "It's an upstream release again" release. Ran all the usual
    upstream CI and release bits :)
  * AcquireFile: Handle large files (LP: #1998265)
  * Get Debian mirrors from mirror-master.debian.org, the previous location
    stopped working
  * Update mirror lists
  * d/t/control: Add missing binutils test dependency

 -- Julian Andres Klode <email address hidden> Thu, 01 Dec 2022 13:36:29 +0100

Changed in python-apt (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for python-apt has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Robie Basak (racb) wrote :

Since the SRU team -approved Test Plan was to rely on autopkgtest, and autopkgtests are showing all passed, we can consider this bug verified for those releases.

tags: added: verification-done verification-done-focal verification-done-jammy verification-done-kinetic
removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-kinetic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 2.4.0+22.10

---------------
python-apt (2.4.0+22.10) kinetic; urgency=medium

  [ Julian Andres Klode ]
  * 2.4.0 marks this as a stable upstream release series.
  * AcquireFile: Handle large files (LP: #1998265)
  * .gitlab-ci.yml: Test in jammy and fix mypy version to jammy
  * Update mirror lists
  * debian/gbp.conf: Point at 2.4.y branch
  * d/t/control: Add missing binutils test dependency

  [ Michael Vogt ]
  * apt: fix mypy in apt.progress.text.AcquireProgress (LP: #1998488)

 -- Julian Andres Klode <email address hidden> Thu, 01 Dec 2022 17:30:57 +0100

Changed in python-apt (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 2.4.0

---------------
python-apt (2.4.0) jammy; urgency=medium

  [ Julian Andres Klode ]
  * 2.4.0 marks this as a stable upstream release series.
  * AcquireFile: Handle large files (LP: #1998265)
  * .gitlab-ci.yml: Test in jammy and fix mypy version to jammy
  * Update mirror lists
  * debian/gbp.conf: Point at 2.4.y branch
  * d/t/control: Add missing binutils test dependency

  [ Michael Vogt ]
  * apt: fix mypy in apt.progress.text.AcquireProgress (LP: #1998488)

 -- Julian Andres Klode <email address hidden> Thu, 01 Dec 2022 17:30:57 +0100

Changed in python-apt (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 2.0.1

---------------
python-apt (2.0.1) focal; urgency=medium

  * We're back to a proper upstream release with CI and all
  * AcquireFile: Handle large files (LP: #1998265)
  * Update mirror list
  * debian/gbp.conf: Point at 2.0.y branch
  * d/t/control: Add missing binutils test dependency

 -- Julian Andres Klode <email address hidden> Thu, 01 Dec 2022 13:33:42 +0100

Changed in python-apt (Ubuntu Focal):
status: Fix Committed → Fix Released
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.