Description of problem: The state machine progresses when it encounters a state that points to a non-existent instance, it incorrectly reports the class is not found, and continues to the next state. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Replace the first state in the VM or service state machine with an non-existent instance name, ensuring the path is valid up to the class. (The log snippet below shows service provisioning with a 'not_there' instance) 0 2. Execute the state machine. 3. Check the automation.log for the " ERROR -- : Class [xxxxxx] not found in MiqAeDatastore" error. 4. Check the automation.log for the state machine continuing to the next state. (See log below) [----] I, [2014-12-18T19:20:30.867206 #94069:3ff20d463be4] INFO -- : Following Relationship [miqaedb:/service/provisioning/statemachines/methods/not_there#create] [----] E, [2014-12-18T19:20:31.201207 #94069:3ff20d463be4] ERROR -- : Class [service/provisioning/statemachines/methods] not found in MiqAeDatastore [----] I, [2014-12-18T19:20:31.201252 #94069:3ff20d463be4] INFO -- : Followed Relationship [miqaedb:/service/provisioning/statemachines/methods/not_there#create] [----] I, [2014-12-18T19:20:31.201323 #94069:3ff20d463be4] INFO -- : Processed State=[pre1] with Result=[ok] [----] I, [2014-12-18T19:20:31.201538 #94069:3ff20d463be4] INFO -- : Next State=[pre2] [----] I, [2014-12-18T19:20:31.201620 #94069:3ff20d463be4] INFO -- : In State=[pre1], invoking [on_exit] method=[update_serviceprovision_status(status => 'Processed Pre1')] [----] I, [2014-12-18T19:20:31.202100 #94069:3ff20d463be4] INFO -- : Updated namespace [service/provisioning/statemachines/serviceprovision_template/update_serviceprovision_s Actual results: The state machine continues. Expected results: The state machine should report the instance is not found and should stop and/or abort the state machine.
New commit detected on manageiq/master: https://github.com/ManageIQ/manageiq/commit/104d657eabc79c8f0b9551970b8a5d172a138134 commit 104d657eabc79c8f0b9551970b8a5d172a138134 Author: Madhu Kanoor <mkanoor> AuthorDate: Mon Feb 2 17:46:35 2015 -0500 Commit: Madhu Kanoor <mkanoor> CommitDate: Mon Feb 2 17:46:35 2015 -0500 During state machine fail if the instance is missing https://bugzilla.redhat.com/show_bug.cgi?id=1176689 If an instance is missing and we are processing a state machine raise a MiqAeDatastoreError and fail the state machine. .../miq_automation_engine/engine/miq_ae_object.rb | 1 + .../miq_ae_state_missing_relation_spec.rb | 83 ++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 vmdb/spec/lib/miq_automation_engine/miq_ae_state_missing_relation_spec.rb
Verified in 5.4.0.0.10.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1100.html