[arm64][libvirt] fail to load json from firmware metadata files

Bug #1921075 reported by Rico Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Rico Lin

Bug Description

Found error in [3] for libvirt with Ubuntu focal on arm64. We fail to load JSON from QEMU firmware metadata files with error [1][2]:

Instance failed to spawn: TypeError: can't concat str to bytes
Traceback (most recent call last):
  File "/opt/stack/nova/nova/compute/manager.py", line 2620, in _build_resources
    yield resources
  File "/opt/stack/nova/nova/compute/manager.py", line 2389, in _build_and_run_instance
    self.driver.spawn(context, instance, image_meta,
  File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3877, in spawn
    xml = self._get_guest_xml(context, instance, network_info,
  File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 6721, in _get_guest_xml
    conf = self._get_guest_config(instance, network_info, image_meta,
  File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 6334, in _get_guest_config
    self._configure_guest_by_virt_type(guest, instance, image_meta, flavor)
  File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5943, in _configure_guest_by_virt_type
    loader, nvram_template = self._host.get_loader(
  File "/opt/stack/nova/nova/virt/libvirt/host.py", line 1636, in get_loader
    for loader in self.loaders:
  File "/opt/stack/nova/nova/virt/libvirt/host.py", line 1619, in loaders
    self._loaders = _get_loaders()
  File "/opt/stack/nova/nova/virt/libvirt/host.py", line 112, in _get_loaders
    spec = jsonutils.load(fh)
  File "/usr/local/lib/python3.8/dist-packages/oslo_serialization/jsonutils.py", line 261, in load
    return json.load(codecs.getreader(encoding)(fp), **kwargs)
  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.8/codecs.py", line 500, in read
    data = self.bytebuffer + newdata
TypeError: can't concat str to byte

Enviro
[1] http://paste.openstack.org/show/803788/
[2] https://zuul.opendev.org/t/openstack/build/312d8e45b079460496d90f1d940c174c/log/controller/logs/screen-n-cpu.txt#22708
[3] https://review.opendev.org/c/openstack/devstack/+/708317

Rico Lin (rico-lin)
description: updated
Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :
Changed in nova:
assignee: nobody → Rico Lin (rico-lin)
status: New → In Progress
importance: Undecided → Medium
tags: added: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 23.0.0.0rc1

This issue was fixed in the openstack/nova 23.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers