AttributeError: module 'apt_pkg' has no attribute 'rewrite_section'

Bug #1850205 reported by Simon Poirier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Committed
High
Simon Poirier
landscape-client (Ubuntu)
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Medium
Simon Poirier
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Regression when applying a package profile through landscape on
   ubuntu-19.10. Process will stack-trace.

 * The issue is caused by removal of some obsolete methods from
   python-apt.

 * The backported patch replaces old rewrite_section() by
   TagSection.write()

[Test Case]

 * On ubuntu 19.10 (eoan) install landscape-client, run landscape-config,
   and create a package profile on the account.

 * check /var/log/landscape/package-changer.log for exceptions.

[Regression Potential]

 * The change has already been published for ubuntu 20.04 and is verified.

 * Patched callsites are only used by package profiles, which would limit
   the effect of regressions.

 * One possible regression could be in encoding errors,
   as the new methods handle binary files directly instead of receiving
   strings. This would imply an issue with python-apt.

[original description]
There has been an API change in focal/eoan for python3-apt >= 1.9, and the package changer now raises exceptions:

AttributeError: module 'apt_pkg' has no attribute 'rewrite_section'

Simon Poirier (simpoir)
Changed in landscape-client:
importance: Undecided → High
status: New → Triaged
Simon Poirier (simpoir)
Changed in landscape-client:
status: Triaged → In Progress
assignee: nobody → Simon Poirier (simpoir)
description: updated
Simon Poirier (simpoir)
Changed in landscape-client:
status: In Progress → Fix Committed
Simon Poirier (simpoir)
description: updated
Changed in landscape-client (Ubuntu):
milestone: none → eoan-updates
Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu Focal):
milestone: eoan-updates → none
status: New → Fix Released
Eric Desrochers (slashd)
Changed in landscape-client (Ubuntu Eoan):
status: New → In Progress
assignee: nobody → Simon Poirier (simpoir)
importance: Undecided → Medium
tags: added: sts
tags: added: sts-sponsor-slashd
Revision history for this message
Eric Desrochers (slashd) wrote :

Sponsored in Eoan

Thanks Simon !

tags: removed: sts-sponsor-slashd
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Simon, or anyone else affected,

Accepted landscape-client into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/18.01-0ubuntu9.3 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-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. 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 landscape-client (Ubuntu Eoan):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Simon Poirier (simpoir) wrote :

I've verified the proposed package by upgrading a client to the eoan-proposed package and applying a new package profile though the Landscape web UI.
Profile applied as expected with the proposed version.

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

This bug was fixed in the package landscape-client - 18.01-0ubuntu9.3

---------------
landscape-client (18.01-0ubuntu9.3) eoan; urgency=medium

  * d/p/removed-apt-functions.patch:
    Replace removed calls from python-apt 1.9 (LP: #1850205)

 -- Simon Poirier <email address hidden> Tue, 24 Mar 2020 16:49:26 +0000

Changed in landscape-client (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for landscape-client 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.

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.