How to reproduce:
1. Set servicegroup_driver=mc in and enable_new_services=False in nova.conf
2. Add new compute host, start nova-compute service. Service becomes disabled, and field updated_at is NULL in nova.services table in DB.
3. Execute nova service-list:
Trace in the nova-api-os-compute logs:
ERROR nova.api.openstack.extensions [req-6034517c-bc29-4ebe-931e-8726fd934bee e05fb82b34cd4265a839f2482debb973 b5d263d6d7c24b84b335f4f00ae6d7c9] Unexpected exception in API method: TypeError: can't compare datetime.datetime to NoneType
TRACE nova.api.openstack.extensions Traceback (most recent call last):
TRACE nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/api/openstack/extensions.py", line 336, in wrapped
TRACE nova.api.openstack.extensions return f(*args, **kwargs)
TRACE nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/services.py", line 261, in index
TRACE nova.api.openstack.extensions _services = self._get_services_list(req, ['forced_down'])
TRACE nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/services.py", line 115, in _get_services_list
TRACE nova.api.openstack.extensions for svc in _services]
TRACE nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/services.py", line 83, in _get_service_detail
TRACE nova.api.openstack.extensions updated_time = self.servicegroup_api.get_updated_time(svc)
TRACE nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/servicegroup/api.py", line 84, in get_updated_time
TRACE nova.api.openstack.extensions return self._driver.updated_time(member)
TRACE nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/nova/servicegroup/drivers/mc.py", line 81, in updated_time
TRACE nova.api.openstack.extensions if updated_time_in_db <= updated_time_in_mc:
TRACE nova.api.openstack.extensions TypeError: can't compare datetime.datetime to NoneType
TRACE nova.api.openstack.extensions
2018-07-16 11:40:16,437.437 2096 INFO nova.api.openstack.wsgi [req-6034517c-bc29-4ebe-931e-8726fd934bee e05fb82b34cd4265a839f2482debb973 b5d263d6d7c24b84b335f4f00ae6d7c9] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.TypeError'>
Affected version: Pike+ /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=0df91a7f799 060cd2e9b8a0ada c1efacb974bcb3
Related commit: https:/
How to reproduce: driver= mc in and enable_ new_services= False in nova.conf
1. Set servicegroup_
2. Add new compute host, start nova-compute service. Service becomes disabled, and field updated_at is NULL in nova.services table in DB.
3. Execute nova service-list:
Trace in the nova-api-os-compute logs:
ERROR nova.api. openstack. extensions [req-6034517c- bc29-4ebe- 931e-8726fd934b ee e05fb82b34cd426 5a839f2482debb9 73 b5d263d6d7c24b8 4b335f4f00ae6d7 c9] Unexpected exception in API method: TypeError: can't compare datetime.datetime to NoneType openstack. extensions Traceback (most recent call last): openstack. extensions File "/usr/lib/ python2. 7/dist- packages/ nova/api/ openstack/ extensions. py", line 336, in wrapped openstack. extensions return f(*args, **kwargs) openstack. extensions File "/usr/lib/ python2. 7/dist- packages/ nova/api/ openstack/ compute/ services. py", line 261, in index openstack. extensions _services = self._get_ services_ list(req, ['forced_down']) openstack. extensions File "/usr/lib/ python2. 7/dist- packages/ nova/api/ openstack/ compute/ services. py", line 115, in _get_services_list openstack. extensions for svc in _services] openstack. extensions File "/usr/lib/ python2. 7/dist- packages/ nova/api/ openstack/ compute/ services. py", line 83, in _get_service_detail openstack. extensions updated_time = self.servicegro up_api. get_updated_ time(svc) openstack. extensions File "/usr/lib/ python2. 7/dist- packages/ nova/servicegro up/api. py", line 84, in get_updated_time openstack. extensions return self._driver. updated_ time(member) openstack. extensions File "/usr/lib/ python2. 7/dist- packages/ nova/servicegro up/drivers/ mc.py", line 81, in updated_time openstack. extensions if updated_time_in_db <= updated_time_in_mc: openstack. extensions TypeError: can't compare datetime.datetime to NoneType openstack. extensions openstack. wsgi [req-6034517c- bc29-4ebe- 931e-8726fd934b ee e05fb82b34cd426 5a839f2482debb9 73 b5d263d6d7c24b8 4b335f4f00ae6d7 c9] HTTP exception thrown: Unexpected API Error. Please report this at http:// bugs.launchpad. net/nova/ and attach the Nova API log if possible. TypeError' >
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
TRACE nova.api.
2018-07-16 11:40:16,437.437 2096 INFO nova.api.
<type 'exceptions.