AttributeError: 'Client' object has no attribute 'tenants' errors in trove-taskmanager.log.

Bug #1600485 reported by Shaik Apsar
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Incomplete
Undecided
Unassigned
openstack-trove (Ubuntu)
Expired
Medium
Unassigned

Bug Description

AttributeError: 'Client' object has no attribute 'tenants' errors in trove-taskmanager.log.

==> /var/log/trove/trove-taskmanager.log <==
2016-07-24 11:22:57.251 18551 DEBUG oslo_service.periodic_task [-] Running periodic task Manager.publish_quota_notifications run_periodic_tasks /usr/lib/python2.7/dist-packages/oslo_service/periodic_task.py:215
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task [-] Error during Manager.publish_quota_notifications
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task Traceback (most recent call last):
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/dist-packages/oslo_service/periodic_task.py", line 220, in run_periodic_tasks
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task task(self, context)
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task File "/usr/lib/python2.7/dist-packages/trove/taskmanager/manager.py", line 412, in publish_quota_notifications
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task for tenant in nova_client.tenants.list():
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task AttributeError: 'Client' object has no attribute 'tenants'
2016-07-24 11:22:57.253 18551 ERROR oslo_service.periodic_task

Shaik Apsar (sa709c)
Changed in trove:
assignee: nobody → Shaik Apsar (sa709c)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/340022

Changed in trove:
status: New → In Progress
Amrith Kumar (amrith)
Changed in trove:
importance: Undecided → Medium
milestone: none → newton-2
milestone: newton-2 → newton-3
Shaik Apsar (sa709c)
description: updated
Shaik Apsar (sa709c)
summary: - EmptyCatalog errors in trove-taskmanager in devstack setup.
+ AttributeError: 'Client' object has no attribute 'tenants' errors in
+ trove-taskmanager.log.
description: updated
Revision history for this message
Shaik Apsar (sa709c) wrote :

publish_quota_notifications method was implemented in trove/taskmanager/manager.py
as implementation part of 'Ceilometer Integration' blueprint[1] in mitaka with the
patch[2].

The dbaas.quotas notification will be periodically emitted to reflect the current
state of utilization of the Trove quotas.The frequency of notification events will
be defined by the quota_notification_interval configuration value.

Each time Trove failing to prepare dbaas.quotas notification with an error
'Client object has no attribute tenants' and the root cause for the failure is
publish_quota_notifications method is trying to get tenant list using 'novaclient'
instead of using 'keystoneclient'.

class DBaaSQuotas in trove/common/notification.py is missing to add tenant_id to the
dbaas.quotas notification payload.

I removed the token_id from admin_context for security concern.

There meight be a change in trove-specs[4] to include tenant_id in traits for event_type: trove.quota.

[1] https://specs.openstack.org/openstack/trove-specs/specs/mitaka/ceilometer-integration.html
[2] https://review.openstack.org/#/c/227870
[3] https://github.com/openstack/trove/blob/master/trove/common/notification.py#L269
[4] https://specs.openstack.org/openstack/trove-specs/specs/mitaka/ceilometer-integration.html#dbaas-quotas
Please review the bug fix https://review.openstack.org/#/c/340022/.

Amrith Kumar (amrith)
Changed in trove:
milestone: newton-3 → ongoing
Revision history for this message
Trevor McCasland (twm2016) wrote :

It is important to note, in order to reproduce this bug you must enable the ceilometer plugin.
    I also enabled the python-ceilometerclient, not sure what difference that made.
Lastly change the quota_notifcaiton_interval to 30 seconds so you don't have to wait 3600 seconds: https://github.com/openstack/trove/blob/master/trove/common/cfg.py#L321

Then you should see the errors appear in the task manager logs.

Revision history for this message
Shaik Apsar (sa709c) wrote :

I'm done with all the changes for the bug and please review the changes.

We can see the 'dbaas.quota' notifications with tenant_id in trove-taskmanager.log file
http://logs.openstack.org/22/340022/46/check/gate-trove-functional-dsvm-mysql/217c551/logs/screen-tr-tmgr.txt.gz#_2016-10-16_18_48_01_904.

Revision history for this message
Trevor McCasland (twm2016) wrote :

I no longer get the AttributeError posted in this bug. Instead I received the EmptyCatalog error. From the logs, it still looks like it is tied to using the nova_client instead of the keystone_client.

2016-10-20 12:35:36.999 DEBUG oslo_service.periodic_task [-] Runnin
g periodic task Manager.publish_quota_notifications from (pid=3936) run_periodic_tasks /usr
/local/lib/python2.7/dist-packages/oslo_service/periodic_task.py:215
2016-10-20 12:35:36.999 ERROR oslo_service.periodic_task [-] Error
during Manager.publish_quota_notifications
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task Traceback (most recent call
 last):
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task File "/usr/local/lib/pyth
on2.7/dist-packages/oslo_service/periodic_task.py", line 220, in run_periodic_tasks
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task task(self, context)
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task File "/opt/stack/trove/tr
ove/taskmanager/manager.py", line 433, in publish_quota_notifications
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task nova_client = remote.cr
eate_nova_client(self.admin_context)
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task File "/opt/stack/trove/tr
ove/common/remote.py", line 99, in nova_client
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task endpoint_type=CONF.nova
_compute_endpoint_type)
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task File "/opt/stack/trove/tr
ove/common/remote.py", line 58, in get_endpoint
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task raise exception.EmptyCa
talog()
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task EmptyCatalog: Empty catalog
.
2016-10-20 12:35:36.999 TRACE oslo_service.periodic_task

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openstack-trove (Ubuntu):
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on trove (master)

Change abandoned by amrith (<email address hidden>) on branch: master
Review: https://review.openstack.org/340022
Reason: "abandoned for inactivity, currently over 2 weeks old, and not currently mergeable"

Changed in openstack-trove (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Amrith Kumar (amrith)
Changed in trove:
status: In Progress → Incomplete
Changed in openstack-trove (Ubuntu):
status: Triaged → Incomplete
Changed in trove:
importance: Medium → Undecided
assignee: Shaik Apsar (sa709c) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for openstack-trove (Ubuntu) because there has been no activity for 60 days.]

Changed in openstack-trove (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.