check_allocations doesn't work on Bionic

Bug #1992992 reported by Paul Goins
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
charm-openstack-service-checks
Fix Released
Undecided
JamesLin

Bug Description

Affects: Bionic

Workaround: Upgrade to Focal

Description:
The /usr/local/bin/run_allocation_checks.py script, run by /etc/cron.d/osc_allocations, fails on Bionic, giving this traceback:

# sudo -u nagios /usr/local/bin/run_allocation_checks.py
Traceback (most recent call last):
  File "/usr/local/bin/run_allocation_checks.py", line 220, in <module>
    main()
  File "/usr/local/bin/run_allocation_checks.py", line 214, in main
    alerts = check_allocations(connection, placement_client)
  File "/usr/local/bin/run_allocation_checks.py", line 99, in check_allocations
    instances = get_instances(connection, placement_client)
  File "/usr/local/bin/run_allocation_checks.py", line 71, in get_instances
    nova_instances = get_nova_instances(connection)
  File "/usr/local/bin/run_allocation_checks.py", line 41, in get_nova_instances
    for vm in compute.servers(details=True, all_projects=True):
  File "/usr/lib/python3/dist-packages/openstack/resource.py", line 883, in list
    cls._query_mapping._validate(params, base_path=cls.base_path)
  File "/usr/lib/python3/dist-packages/openstack/resource.py", line 252, in _validate
    extra_data=invalid_keys)
openstack.exceptions.InvalidResourceQuery: Invalid query params: all_projects

This appears to be an artifact related to the version of python3-openstacksdk which ships with Bionic, which I presently see as 0.11.3+repack-0ubuntu1.

As the o-s-c charm doesn't appear to have a charmed way of pulling packages from UCA, the workaround is to upgrade to Focal, which currently has version 0.46.0-0ubuntu1 of python3-openstacksdk and should not be affected by the issue.

Suggestion for fix: consider only rendering this check on Focal or newer, and adding an appropriate note in config.yaml re: this restriction.

Tags: bseng-497

Related branches

Eric Chen (eric-chen)
tags: added: bseng-497
Revision history for this message
JamesLin (jneo8) wrote :
JamesLin (jneo8)
Changed in charm-openstack-service-checks:
status: New → Fix Committed
JamesLin (jneo8)
Changed in charm-openstack-service-checks:
assignee: nobody → JamesLin (jneo8)
Changed in charm-openstack-service-checks:
milestone: none → 23.01
Changed in charm-openstack-service-checks:
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.