python3-libmaas not compatible with python3.10

Bug #1989118 reported by Nathaniel W. Turner
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
Invalid
Undecided
Unassigned
python-libmaas (Ubuntu)
Fix Released
High
Unassigned
Jammy
Fix Released
High
Unassigned
Kinetic
Fix Released
High
Unassigned
Lunar
Fix Released
High
Unassigned

Bug Description

[ Impact ]
python-libmaas is not currently usable in any release where the Python version is >= 3.10.

[ Test Plan ]

Standalone tests:

sudo apt install python3-libmaas
python3 -c "import maas.client"

Error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/maas/client/__init__.py", line 8, in <module>
    from .utils.maas_async import asynchronous
  File "/usr/lib/python3/dist-packages/maas/client/utils/__init__.py", line 29, in <module>
    from collections import (
ImportError: cannot import name 'Iterable' from 'collections'
(/usr/lib/python3.11/collections/__init__.py)

This also impact the use of the libmaas API from the hacluster charm - this will be used to validate the updates as well by following the deployment guide for masakari:

https://docs.openstack.org/charm-guide/latest/admin/instance-ha.html

[ Where problems could occur ]

The proposed resolution for this issue is to update to the latest patch release for libmaas - this brings the potential for other regressions however the package is completely unusable in its current form and 0.6.8 is the current recommended version from the MAAS project (and is used via PPA by most users).

The proposed update will also enable test execution as part of the package
build to reduce the risk of a breaking change.

[ Other Info ]

The latest libmaas release is 0.6.8 - the changelog between 0.6.4 and 0.6.8 is mainly bug fixes and enablement of snaps:

babd97f5ff7c5cec8750d3bdb37283bd10e0f515 (HEAD -> master, tag: 0.6.8, origin/master, origin/HEAD) Release 0.6.8 (#283)
a0673683cf42120852bb8213da6fe5757faf5012 More Python 3.10 fixes (#282)
fb06cab6227a5dd1979551a2e92739424200ad10 Fix typo in test configuration
69c51b5e64e7ffa09ad35cf14cbaa1bd27e77bbc prevent expand() iterating through string value #277 (#278)
4dc66b5dfaf9fb2f65413d64db37f3e3771d87fa (tag: 0.6.7) Release 0.6.7 (#279)
e0211170b9f92470b2ab4f22067cecf4107f6a63 add python3.10 to tests (#272)
fc44f195e5c15ccea5dcb99ad1854f527df59426 Fix Python 3.10 Collections package import error (#271)
ae3e321924b231ae5b765cd70cdd074cc2a9929e fix black warnings; update for yaml issue; bump version; add 3.9 to ci (#268)
1f6378049e8f3cc8a43941ae0e4a02b5f8afc3c7 Update index.md (#254)
94fe03efec5470b1192dcabed51b811e74801b78 switch to Github actions (#250)
575d3f762afc69ae91349aa75a893a53826d6f22 (tag: 0.6.6) Release 0.6.6
bc1d76ae5fbb550924d63ec2655759d1eb130ca3 Iterate over a copy of items in ActionAPI.__call__. (#247)
069e75885aaaf17964d5820e32554c39d0e9c7ac Fix machine details for a machine with tags (#236)
6822d838f470fe6e88fca5cd09e6f2db696cfd0d (tag: 0.6.5) Release 0.6.5.
27faf84e3870b0d4ea39c071618e72fb66a59275 Add libffi-dev and libssl-dev as build packages for building the snap on arm64, armhf, ppc64el.
647065b4112d4bbdfbe4a6e056854bdc23e157d2 Snap packaging (#232)
e33e1afab5c60d83e2987a70c7e7baee2cc1f374 Remove python 3.8 from travis CI, not supported yet.
1ebf61279b66625367f1c460433d43b37411d8cc Remove python 3.5 from travis as python black doesn't support 3.5. Add python 3.7 and 3.8.
7005096b006eaa1c60a69bd4d59052d2000e7648 Set Django tests_requires version greater than 2.2.4 so no CVE warnings.
474f756f485dae7d6711d7102d55c0295a13b29d Add format make target to use python black. Update lint target to use black in check mode.
b5518780ec5e9c10859ef1489835b92004f36493 Fix issue with django tests_require pulling in Django 3.0 alpha. Keep django between 1.11 and 2.2.
7641ce8a757833d3e41524e7f86f26fd4ffbe236 Support install_kvm when deploying (#231)
a870202dd4e78949542673330c4c81a618664342 Adds locked attribute of Machine objects (#229)

[ Original Bug Report ]
The python3-libmaas package in Ubuntu 22.04 does not work:

$ python3
Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import maas.client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/maas/client/__init__.py", line 8, in <module>
    from .utils.maas_async import asynchronous
  File "/usr/lib/python3/dist-packages/maas/client/utils/__init__.py", line 29, in <module>
    from collections import (
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
>>>

It looks like upstream has fixed several Python 3.10 compatibility issues in the master branch recently:

https://github.com/maas/python-libmaas/pull/271
https://github.com/maas/python-libmaas/pull/282

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: python3-libmaas 0.6.4-0ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-47.51-generic 5.15.46
Uname: Linux 5.15.0-47-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Thu Sep 8 09:54:01 2022
InstallationDate: Installed on 2021-06-09 (455 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
PackageArchitecture: all
SourcePackage: python-libmaas
UpgradeStatus: Upgraded to jammy on 2022-09-07 (0 days ago)

Revision history for this message
Nathaniel W. Turner (nturner) wrote :
Revision history for this message
Camille Rodriguez (camille.rodriguez) wrote :

The correct package to use is the upstream python-libmaas: https://launchpad.net/~maas/+archive/ubuntu/python-libmaas

The one in the ubuntu archive is unmaintained.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-libmaas (Ubuntu):
status: New → Confirmed
James Page (james-page)
Changed in charm-hacluster:
status: New → Invalid
Changed in python-libmaas (Ubuntu Jammy):
importance: Undecided → High
Changed in python-libmaas (Ubuntu Kinetic):
importance: Undecided → High
Changed in python-libmaas (Ubuntu Lunar):
importance: Undecided → High
Changed in python-libmaas (Ubuntu Kinetic):
status: New → Triaged
Changed in python-libmaas (Ubuntu Jammy):
status: New → Triaged
Revision history for this message
Adam Collard (adam-collard) wrote :

I wonder if charm-hacluster can be changed to install python-libmaas from pypi[0]?

[0] https://pypi.org/project/python-libmaas/#history

James Page (james-page)
description: updated
James Page (james-page)
description: updated
description: updated
James Page (james-page)
description: updated
Revision history for this message
James Page (james-page) wrote :

I've uploaded a full refresh for Lunar and updates for Jammy and Kinetic that bump the version 0.6.8 and update the packaging to run the test suite for the module during the package build.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-libmaas - 0.6.8-0ubuntu1

---------------
python-libmaas (0.6.8-0ubuntu1) lunar; urgency=medium

  * New upstream release (LP: #1989118).
  * d/control: Drop use of X-Python3-Version.
  * d/control: Bumped Standards-Version to 4.6.2, no changes.
  * d/control,compat: Upgrade to debhelper-compat 13.
  * d/*: wrap-and-sort -bast
  * d/rules,control: Enable tests during package build.
  * d/p/drop-django-upperbound.patch: Drop upper bound on django for
    testing.

 -- James Page <email address hidden> Fri, 17 Feb 2023 09:28:28 +0000

Changed in python-libmaas (Ubuntu Lunar):
status: Confirmed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Nathaniel, or anyone else affected,

Accepted python-libmaas into kinetic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-libmaas/0.6.8-0ubuntu0.22.10.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-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-libmaas (Ubuntu Kinetic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-kinetic
Changed in python-libmaas (Ubuntu Jammy):
status: Triaged → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Nathaniel, or anyone else affected,

Accepted python-libmaas into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-libmaas/0.6.8-0ubuntu0.22.04.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-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.

Revision history for this message
Nathaniel W. Turner (nturner) wrote :

Thank you for uploading this update!

I can confirm that the update in jammy-proposed fixes my use case (a custom Python script that queries, deploys, and monitors machines from maas).

$ apt-cache policy python3-libmaas
python3-libmaas:
  Installed: 0.6.8-0ubuntu0.22.04.1
  Candidate: 0.6.8-0ubuntu0.22.04.1
  Version table:
 *** 0.6.8-0ubuntu0.22.04.1 400
        400 http://archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 Packages
        400 http://archive.ubuntu.com/ubuntu jammy-proposed/universe i386 Packages
        100 /var/lib/dpkg/status
     0.6.4-0ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe i386 Packages

Revision history for this message
James Page (james-page) wrote :

Verification completed with jammy/proposed:

root@lasting-barnacle:~# python3 -c "import maas.client"

<no errors>

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
James Page (james-page) wrote :

Verification completed with kinetic/propsoed:

root@loyal-beetle:~# python3 -c "import maas.client"

<no errors>

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

This bug was fixed in the package python-libmaas - 0.6.8-0ubuntu0.22.10.1

---------------
python-libmaas (0.6.8-0ubuntu0.22.10.1) kinetic; urgency=medium

  * New upstream release (LP: #1989118) resolving compatibility
    issues with Python >= 3.10.
  * d/rules,control: Enable tests during package build.
  * d/p/drop-django-upperbound.patch: Drop upper bound on django for
    testing.

 -- James Page <email address hidden> Fri, 17 Feb 2023 09:28:28 +0000

Changed in python-libmaas (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for python-libmaas 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
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-libmaas - 0.6.8-0ubuntu0.22.04.1

---------------
python-libmaas (0.6.8-0ubuntu0.22.04.1) jammy; urgency=medium

  * New upstream release (LP: #1989118) resolving compatibility
    issues with Python >= 3.10.
  * d/rules,control: Enable tests during package build.
  * d/p/drop-django-upperbound.patch: Drop upper bound on django for
    testing.

 -- James Page <email address hidden> Fri, 17 Feb 2023 10:12:45 +0000

Changed in python-libmaas (Ubuntu Jammy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.