Trove-taskamager raises error when nova_compute_url isn't set

Bug #1616344 reported by Mahito OGURA
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
New
Wishlist
Unassigned

Bug Description

I got the error log as follows in trove-taskmanager.

```
2016-08-24 06:57:02.080 ERROR oslo_service.periodic_task [-] Error during Manager.publish_quota_notifications
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task Traceback (most recent call last):
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task File "/usr/local/lib/python2.7/dist-packages/oslo_service/periodic_task.py", line 220, in run_periodic_tasks
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task task(self, context)
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task File "/opt/stack/trove/trove/taskmanager/manager.py", line 410, in publish_quota_notifications
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task nova_client = remote.create_nova_client(self.admin_context)
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task File "/opt/stack/trove/trove/common/remote.py", line 99, in nova_client
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task endpoint_type=CONF.nova_compute_endpoint_type)
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task File "/opt/stack/trove/trove/common/remote.py", line 58, in get_endpoint
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task raise exception.EmptyCatalog()
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task EmptyCatalog: Empty catalog.
2016-08-24 06:57:02.080 TRACE oslo_service.periodic_task
```

This error happens when nova_compute_url isn't set.
I looked source code and found the reason.

trove-taskmanager dosen't set `service_catalog`, when `admin_context` is set.[1]
When `nova_compute_url` isn't set, `nova_client` calls `get_endpoint`.[2]
When there isn't set `service_catalog`, `get_endpoint` raises `exception.EmptyCatalog()`.[3]
There aren't test cases, because`TestCreateNovaClient` already sets `service_catalog`.[4]

[1]: https://github.com/openstack/trove/blob/master/trove/taskmanager/manager.py#L49-L52
[2]: https://github.com/openstack/trove/blob/master/trove/common/remote.py#L90-L103
[3]: https://github.com/openstack/trove/blob/master/trove/common/remote.py#L57-L58
[4]: https://github.com/openstack/trove/blob/master/trove/tests/unittests/common/test_remote.py#L339-L362

I don't have a good fix idea.
please anyone fix this issue.

best regards

Amrith Kumar (amrith)
Changed in trove:
importance: Undecided → Wishlist
Revision history for this message
Liu Yang (ly798) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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