charm installs outdated python3-libmaas on Jammy

Bug #1998069 reported by Samuel Allan
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
Confirmed
Undecided
Unassigned
python-libmaas (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

To support jammy, we need the latest version of python3-libmaas, which is available from the python-libmaas ppa[0]. The charm however doesn't install the ppa, so it ends up installing the older version from the main repositories.

This results in the following error as seen from juju logs:

```
2022-11-28 02:24:36 WARNING unit.hacluster-masakari/0.hanode-relation-changed logger.go:60 File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
2022-11-28 02:24:36 WARNING unit.hacluster-masakari/0.hanode-relation-changed logger.go:60 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
2022-11-28 02:24:36 WARNING unit.hacluster-masakari/0.hanode-relation-changed logger.go:60 File "/usr/lib/python3.10/subprocess.py", line 524, in run
2022-11-28 02:24:36 WARNING unit.hacluster-masakari/0.hanode-relation-changed logger.go:60 raise CalledProcessError(retcode, process.args,
2022-11-28 02:24:36 WARNING unit.hacluster-masakari/0.hanode-relation-changed logger.go:60 subprocess.CalledProcessError: Command '['crm', 'configure', 'primitive', 'st-maas', 'stonith:external/maas', 'params', "url='http://10.123.45.6/MAAS/'", "apikey='...'", "hostnames='cloud01", 'cloud01.maas', 'cloud02', 'cloud02.maas', 'cloud03', 'cloud03.maas', 'cloud04', 'cloud04.maas', 'cloud05', 'cloud05.maas', 'cloud07', 'cloud07.maas', 'cloud08', 'cloud08.maas', 'cloud09', 'cloud09.maas', 'cloud10', 'cloud10.maas', 'cloud11', 'cloud11.maas', 'cloud12', "cloud12.maas'", 'op', 'monitor', 'interval=25', 'start-delay=25', 'timeout=25']' returned non-zero exit status 1.
2022-11-28 02:24:37 ERROR juju.worker.uniter.operation runhook.go:140 hook "hanode-relation-changed" (via explicit, bespoke hook script) failed: exit status 1
```

Running the command manually to see the actual issue:

```
ubuntu@juju-0330ba-3-lxd-17:~$ sudo crm configure primitive st-maas stonith:external/maas params url='http://10.123.45.6/MAAS/' apikey='...' hostnames="cloud01 cloud01.maas ... cloud12 cloud12.maas" op monitor interval=25 start-delay=25 timeout=25
WARNING: (unpack_config) warning: Blind faith: not fencing unseen nodes
ERROR: st-maas: parameter "url" is not known
ERROR: st-maas: parameter "apikey" is not known
ERROR: st-maas: parameter "hostnames" is not known
```

Installing the python-libmaas ppa and upgrading the python3-libmaas package fixes the issue.

[0]: https://launchpad.net/~maas/+archive/ubuntu/python-libmaas

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-hacluster (master)
Changed in charm-hacluster:
status: New → In Progress
Changed in charm-hacluster:
assignee: nobody → Samuel Walladge (swalladge)
Revision history for this message
Samuel Allan (samuelallan) wrote : Re: charm installs outdated python3-libmaas

https://review.opendev.org/c/openstack/charm-hacluster/+/865785 is a tentative untested proof of concept for consideration. :)

description: updated
description: updated
description: updated
Revision history for this message
DUFOUR Olivier (odufourc) wrote :

To add more context about why the crm action fail with it not recognizing the options for the stonith plugin installed by hacluster-charm on Jammy :

Corosync/pacemeker would try to run the command "getinfo-xml" to retrieve the parameters on the python script in "/usr/lib/stonith/plugins/external/maas"

But running anything on it will fail because of maas.client not working by default on Jammy
ubuntu@juju-a-3-lxd-17:/usr/lib/stonith/plugins/external$ ./maas getinfo-xml
Traceback (most recent call last):
  File "/usr/lib/stonith/plugins/external/./maas", line 25, in <module>
    import maas.client
  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)

To reproduce the issue :
* have a machine running on Jammy
* install python3-libmaas package
* run python3
* import maas.client
\--> see it fail with exactly the same error

ubuntu@jammy-lxd:~$ python3
Python 3.10.6 (main, Nov 2 2022, 18:53:38) [GCC 11.3.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)

summary: - charm installs outdated python3-libmaas
+ charm installs outdated python3-libmaas on Jammy
Revision history for this message
Billy Olsen (billy-olsen) wrote (last edit ):

This appears to ultimately be the same as bug 1989118

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-hacluster (master)

Change abandoned by "Samuel Walladge <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/charm-hacluster/+/865785
Reason: abandoning in hope that an SRU is approaching

Revision history for this message
Samuel Allan (samuelallan) wrote :

Agreed

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
Nobuto Murata (nobuto)
Changed in charm-hacluster:
assignee: Samuel Walladge (swalladge) → nobody
status: In Progress → Confirmed
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.