OpenStack Telemetry (Ceilometer)

accessing nova db error in compute agent

Reported by Lianhao Lu on 2012-11-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Undecided
Unassigned

Bug Description

Using the git master branch with commit id: 2a82834fb92b40bdbadb668df4130b1d544db8e1, when launching the compute agent, the following error displayed on screen and the agent crashed:

2012-11-07 11:07:05 13793 ERROR ceilometer.openstack.common.loopingcall [-] in looping call
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall Traceback (most recent call last):
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/ceilometer/ceilometer/openstack/commo
n/loopingcall.py", line 65, in _inner
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall self.f(*self.args, **self.kw)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/ceilometer/ceilometer/compute/manager
.py", line 79, in periodic_tasks
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall for instance in self.resources.instance_get_all_by_h
ost(context):
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/ceilometer/ceilometer/compute/resourc
es.py", line 34, in instance_get_all_by_host
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall return self.db.instance_get_all_by_host(context, cfg
.CONF.host)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/nova/nova/db/api.py", line 626, in instance_get_all_by_host
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall return IMPL.instance_get_all_by_host(context, host)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 105, in wrapper
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall return f(*args, **kwargs)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 1694, in instance_get_all_by_host
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall return _instance_get_all_query(context).filter_by(host=host).all()
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 105, in wrapper
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall return f(*args, **kwargs)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 1685, in _instance_get_all_query
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall return model_query(context, models.Instance, project_only=project_only).\
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 195, in model_query
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall read_deleted = kwargs.get('read_deleted') or context.read_deleted

2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall AttributeError: 'RequestContext' object has no attribute
 'read_deleted'
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.loopingcall
2012-11-07 11:07:05 13793 ERROR ceilometer.openstack.common.threadgroup [-] 'RequestContext' object has no attribute 'read_delet
ed'
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup Traceback (most recent call last):
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/ceilometer/ceilometer/openstack/commo
n/threadgroup.py", line 106, in wait
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup x.wait()
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/ceilometer/ceilometer/openstack/commo
n/loopingcall.py", line 88, in wait
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return self.done.wait()
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/usr/local/lib/python2.7/dist-packages/eventlet/
event.py", line 116, in wait
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return hubs.get_hub().switch()
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/usr/local/lib/python2.7/dist-packages/eventlet/
hubs/hub.py", line 177, in switch
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return self.greenlet.switch()
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/ceilometer/ceilometer/openstack/common/loopingcall.py", line 65, in _inner
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup self.f(*self.args, **self.kw)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/ceilometer/ceilometer/compute/manager.py", line 79, in periodic_tasks
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup for instance in self.resources.instance_get_all_by_host(context):
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/ceilometer/ceilometer/compute/resources.py", line 34, in instance_get_all_by_host
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return self.db.instance_get_all_by_host(context, cfg.CONF.host)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/nova/nova/db/api.py", line 626, in instance_get_all_by_host
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return IMPL.instance_get_all_by_host(context, host)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 105, in wrapper
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return f(*args, **kwargs)

2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 1694, in instance_get_all_by_host
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return _instance_get_all_query(context).filter_by(host=host).all()
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 105, in wrapper
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return f(*args, **kwargs)
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 1685, in _instance_get_all_query
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup return model_query(context, models.Instance, project_only=project_only).\
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 195, in model_query
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup read_deleted = kwargs.get('read_deleted') or context.read_deleted
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup AttributeError: 'RequestContext' object has no attribute 'read_deleted'
2012-11-07 11:07:05 13793 TRACE ceilometer.openstack.common.threadgroup

This is because we call nova.db.instance_get_all_by_host() by passing context parameter with the context defined in ceilometer, which doesn't have the attribute of 'read_deleted'. We might either pass the nova.context object as the parameter or drop nova db access(using python nova_client maybe?).

Lianhao Lu (lianhao-lu) wrote :

I just found that there is a pending patch https://review.openstack.org/#/c/15512/ which drop the nova db access by using nova_client. That should solve this issue.

John Tran (jtran) wrote :

Lianhao Lu,

Are you still having the problem?

Lianhao Lu (lianhao-lu) wrote :

This issue is is fixed by https://review.openstack.org/#/c/15512/.

Changed in ceilometer:
status: New → Fix Committed
Thierry Carrez (ttx) on 2013-01-09
Changed in ceilometer:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-04-04
Changed in ceilometer:
milestone: grizzly-2 → 2013.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers