How to reproduce the issue:
Before: Keep all configuration files as default.
1. Create a trigger with using dashboard (A trigger with crontab format will be created), it will success, no error logs found in karbor-api and karbor-operationengine
Note: Actually, it should not be successful here, because the configuration of time format is calendar, but dashboard use crontab.
2. Systemctl restart karbor-operationengine
3. Error log of karbor-operationengine:
10月 26 17:33:44 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:44.512 DEBUG oslo_db.sqlalchemy.engines [req-679f0de9-d9ba-409c-a940-55951adff1f3 None None] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_
10月 26 17:33:44 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:44.546 DEBUG karbor.services.operationengine.engine.triggers.timetrigger.time_trigger [req-1cf9e5e6-988d-4829-98d4-0ef3303398d7 None None] first_run_time: 2017-10-26 09:37:19 from
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 ERROR oslo_service.service [req-d2e7e917-ab77-4e7c-80b5-5e62beb5bb8d None None] Error starting thread.: InvalidInput: The trigger pattern(0 0 * * *) is invalid
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service Traceback (most recent call last):
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 721, in run_service
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service service.start()
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/service.py", line 114, in start
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service self.manager.init_host(service_id=self.service_id)
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/manager.py", line 94, in init_host
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service self._restore()
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/manager.py", line 102, in _restore
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service self._restore_triggers()
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/manager.py", line 118, in _restore_triggers
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service trigger.properties)
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/engine/triggers/trigger_manager.py", line 70, in add_trigger
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service trigger = trigger_cls(trigger_id, trigger_property, self._executor)
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/engine/triggers/timetrigger/time_trigger.py", line 67, in __init__
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service trigger_property)
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/engine/triggers/timetrigger/time_trigger.py", line 273, in check_trigger_definition
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service tf_cls.check_time_format(pattern)
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service File "/opt/stack/karbor/karbor/services/operationengine/engine/triggers/timetrigger/timeformats/calendar_time.py", line 92, in check_time_format
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service raise exception.InvalidInput(msg)
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service InvalidInput: The trigger pattern(0 0 * * *) is invalid
10月 26 17:33:48 jpjdevstack.novalocal karbor-operationengine[14407]: 2017-10-26 17:33:48.618 TRACE oslo_service.service
4. karbor-operationengine will exit.
I found that we change call to cast in multi node support patch, so when creating a new trigger, it will not wait for the response from karbor-operationengine. In this case, karbor-operationengine will not check the format of the trigger, and karbor-api will return success to client. Seems it is not right.
Fix proposed to branch: master /review. openstack. org/516073
Review: https:/