Trigger issues

Bug #1727672 reported by jiaopengju
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Karbor
Fix Released
Undecided
jiaopengju

Bug Description

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.

jiaopengju (pj-jiao)
Changed in karbor:
assignee: nobody → jiaopengju (pj-jiao)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to karbor (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to karbor (master)

Reviewed: https://review.openstack.org/516073
Committed: https://git.openstack.org/cgit/openstack/karbor/commit/?id=c59f1aff8d893b2151b565c4c63b830ea817eac3
Submitter: Zuul
Branch: master

commit c59f1aff8d893b2151b565c4c63b830ea817eac3
Author: jiaopengju <email address hidden>
Date: Sun Oct 29 17:34:42 2017 +0800

    Add time format check in API

    Change-Id: Idca9266d503caa8096ca8d4265e813b4244be653
    Closes-Bug: #1727672

Changed in karbor:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/karbor 0.6.0

This issue was fixed in the openstack/karbor 0.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/karbor 1.0.0

This issue was fixed in the openstack/karbor 1.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/karbor 1.1.0

This issue was fixed in the openstack/karbor 1.1.0 release.

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.