This bug still can happen if instance transitioned into the ERROR state after TooManyInstances exception in nova-conductor [1] with quota.recheck_quota=True being set, because in this case instance isn't buried in the cell0 database and instance_bdms isn't created in the nova cell database. So _local_cleanup_bdm_volumes() doesn't have bdm to cleanup.
This bug still can happen if instance transitioned into the ERROR state after TooManyInstances exception in nova-conductor [1] with quota.recheck_ quota=True being set, because in this case instance isn't buried in the cell0 database and instance_bdms isn't created in the nova cell database. So _local_ cleanup_ bdm_volumes( ) doesn't have bdm to cleanup.
[1] https:/ /github. com/openstack/ nova/blob/ stable/ rocky/nova/ conductor/ manager. py#L1308