Openstack Pike
Nova ver 16.1.0
I'm having a problem with no way to fix it. Looking forward to being instructed.
While I click on Overview on the Dashboard. On CONTROLLER NODE the error appears:
At /var/log/httpd/error_log
[root @ controller01 ~] # tail -f /var/log/httpd/error_log
[Tue Jul 24 20:30:31.849925 2018] [:error] [pid 23501] WARNING horizon.exceptions Recoverable error: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
[Tue Jul 24 20:30:31.849959 2018] [:error] [pid 23501] <type 'exceptions.ValueError'> (HTTP 500) (Request-ID: req-a09d7dde-82c4-44e2-93e3-0f30d4cf76d5)
At /var/log/nova/nova-api.log
[root@controller01 ~]# tail -f /var/log/nova/nova-api.log
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions [req-a09d7dde-82c4-44e2-93e3-0f30d4cf76d5 405a2d24984a4571b63c1d89fd27acc1 80a8f88b532f4cefbc1cffd377045a7a - default default] Unexpected exception in API method: ValueError: year is out of range
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions Traceback (most recent call last):
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/extensions.py", line 336, in wrapped
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions return f(*args, **kwargs)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/simple_tenant_usage.py", line 267, in index
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions return self._index(req, links=True)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/simple_tenant_usage.py", line 310, in _index
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions limit=limit, marker=marker)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/simple_tenant_usage.py", line 143, in _tenant_usages_for_period
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions limit, marker)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/simple_tenant_usage.py", line 118, in _get_instances_all_cells
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions marker=marker))
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/objects/instance.py", line 1347, in get_active_by_window_joined
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions limit=limit, marker=marker)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions result = fn(cls, context, *args, **kwargs)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/objects/instance.py", line 1317, in _get_active_by_window_joined
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions expected_attrs)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/objects/instance.py", line 1198, in _make_instance_list
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions expected_attrs=expected_attrs)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/nova/objects/instance.py", line 355, in _from_db_object
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions instance[field] = db_inst[field]
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 765, in __setitem__
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions setattr(self, name, value)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 72, in setter
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions field_value = field.coerce(self, name, value)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/fields.py", line 195, in coerce
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions return self._type.coerce(obj, attr, value)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_versionedobjects/fields.py", line 461, in coerce
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions value = timeutils.parse_isotime(value)
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/site-packages/oslo_utils/timeutils.py", line 67, in parse_isotime
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions raise ValueError(six.text_type(e))
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions ValueError: year is out of range
2018-07-24 20:30:31.843 7428 ERROR nova.api.openstack.extensions
It seems input start and end dates are not iso8601 format But i cannot tell why we horizon should send date in those format.
Below is code flow for this error. One things we should surly do is to catch the value error on API side and return 400 for any unformulated dates.
- _get_instances_ all_cells( ) method call the objects. InstanceList. get_active_ by_window_ joined( ) with period_start, period_stop which are start and end date from request. - https:/ /github. com/openstack/ nova/blob/ e8a73c400846b5b e0f12a2eea32bd2 c5c5aeb370/ nova/api/ openstack/ compute/ simple_ tenant_ usage.py# L116
- objects. InstanceList. get_active_ by_window_ joined( ) will parse those dates with parse_isotime() - https:/ /github. com/openstack/ nova/blob/ b58c7f033771e3e a228e4b40c796d1 bc95a087f5/ nova/objects/ instance. py#L1347
- then oslo.utils throw value error as dates are not in iso8601 format- https:/ /github. com/openstack/ oslo.utils/ blob/e43edb19d4 c8c11ef6fccc08a 37cf88b97d46731 /oslo_utils/ timeutils. py#L68