← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1456871] [NEW] objects.InstanceList.get_all(context, ['metadata', 'system_metadata']) return error can't locate strategy for %s %s" % (cls, key)

 

You have been subscribed to a public bug:

In our code we invoke the code as following:

objects.InstanceList.get_all(context, ['metadata','system_metadata'])

It throw the error said:
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager     strat = self._get_strategy(loader.strategy)
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/interfaces.py", line 452, in _get_strategy
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager     cls = self._strategy_lookup(*key)
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/interfaces.py", line 507, in _strategy_lookup
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager     raise Exception("can't locate strategy for %s %s" % (cls, key))
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager Exception: can't locate strategy for <class 'sqlalchemy.orm.properties.ColumnProperty'> (('lazy', 'joined'),)
2015-05-19 21:52:31.222 22676 TRACE nova.scheduler.ibm.ego.ego_manager

The original used: db.instance_get_all(context,
['metadata','system_metadata'])  can worked well.

Did some investigation and found the nova/objects/instance.py  function
_expected_cols(expected_attrs):

will return list ['metadata','system_metadata', 'extra',
'extra.flavor'], then in the db query it throw the error: can't locate
strategy for <class 'sqlalchemy.orm.properties.ColumnProperty'>
(('lazy', 'joined'),)

Could anyone can help have a look? Thanks!

** Affects: nova
     Importance: Undecided
         Status: New

-- 
objects.InstanceList.get_all(context, ['metadata','system_metadata']) return error can't locate strategy for %s %s" % (cls, key)
https://bugs.launchpad.net/bugs/1456871
You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova).