nova-lxd fails to boot with TypeError: 'filter' object is not subscriptable

Bug #1815325 reported by Michael Johnson on 2019-02-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova-lxd
Status tracked in Trunk
Rocky
High
Alex Kavanagh
Trunk
High
Alex Kavanagh
nova-lxd (Ubuntu)
Undecided
Unassigned

Bug Description

When attempting to boot a xenial image on a bionic devstack host, I get the following error in the devstack@n-cpu log:

Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [None req-f18fc390-d8d1-4bd9-9a3e-2ef029f01add admin admin] [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] Instance failed to spawn: TypeError: 'filter' object is not subscriptable
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] Traceback (most recent call last):
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] File "/opt/stack/nova/nova/compute/manager.py", line 2379, in _build_resources
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] yield resources
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] File "/opt/stack/nova/nova/compute/manager.py", line 2142, in _build_and_run_instance
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] block_device_info=block_device_info)
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] File "/opt/stack/nova-lxd/nova/virt/lxd/driver.py", line 591, in spawn
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] network_info)
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] File "/opt/stack/nova-lxd/nova/virt/lxd/driver.py", line 1280, in _add_configdrive
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] storage_id = uid_map[0].get("Hostid", 0)
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] TypeError: 'filter' object is not subscriptable
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: ERROR nova.compute.manager [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5]
Feb 09 17:32:43 b-lxc-devstack nova-compute[12553]: INFO nova.compute.manager [None req-f18fc390-d8d1-4bd9-9a3e-2ef029f01add admin admin] [instance: 08c9f6ce-ff96-47ba-adb3-34cbe27b93a5] Terminating instance

Alex Kavanagh (ajkavanagh) wrote :

Hi Michael

Some of the stack trace seems missing. Also, please could you provide information for:

* Host OS
* LXD version
* OpenStack version of nova and nova-lxd (e.g. queens, rocky, or version numbers)
* The nova.conf for the LXD compute host

I suspect, but I'm not sure, that the bug is because it's running in Python3 (which it should be able to do!), and the code in question from driver.py is trying to use the [] operator on the filter object (Python3) rather than a list returned from filter (Python2). If you can confirm the versions, I can get the bug fixed and backported (as needed).

Changed in nova-lxd:
status: New → Incomplete
importance: Undecided → High
Alex Kavanagh (ajkavanagh) wrote :

Michael, I see you already have added a fix for this:

https://review.openstack.org/#/c/636067/

I missed the "devstack" in the original bug report above; was it on bionic or xenial? I'll need to work out the backports for this, if necessary.

Changed in nova-lxd:
status: Incomplete → In Progress
Alex Kavanagh (ajkavanagh) wrote :

I've verified it and cherry-picked it over to stable/rocky:

https://review.openstack.org/#/c/640067/

Reviewed: https://review.openstack.org/636067
Committed: https://git.openstack.org/cgit/openstack/nova-lxd/commit/?id=15cdfc071b86160020edc1bbef5b77acab78d06e
Submitter: Zuul
Branch: master

commit 15cdfc071b86160020edc1bbef5b77acab78d06e
Author: Michael Johnson <email address hidden>
Date: Sun Feb 10 10:23:38 2019 -0800

    Fix 'filter' object is not subscriptable

    nova-lxd has a python3 compatibility issue where it will fail with:
    TypeError: 'filter' object is not subscriptable

    This patch corrects that problem.

    Change-Id: Ib2208fdc2289b6a52e5ad41ca540c75e9d1d94b4
    Closes-Bug: #1815325

Changed in nova-lxd:
status: In Progress → Fix Committed
Changed in nova-lxd (Ubuntu):
status: New → In Progress
status: In Progress → New

Reviewed: https://review.openstack.org/640067
Committed: https://git.openstack.org/cgit/openstack/nova-lxd/commit/?id=8ee2979084ab79fcef26fa6db01671e79a7b6be9
Submitter: Zuul
Branch: stable/rocky

commit 8ee2979084ab79fcef26fa6db01671e79a7b6be9
Author: Michael Johnson <email address hidden>
Date: Sun Feb 10 10:23:38 2019 -0800

    Fix 'filter' object is not subscriptable

    nova-lxd has a python3 compatibility issue where it will fail with:
    TypeError: 'filter' object is not subscriptable

    This patch corrects that problem.

    Change-Id: Iaa275eb770bca53fac2aae201cc5597e660c64df
    Related-Bug: #1815325

tags: added: in-stable-rocky
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers