Modifying a stage disables event handlers referencing that stage

Hi Guys,

I’ve cloned a configuration in one of our projects, and the next day noticed the event handlers of the cloned configuration were not correctly configured - they were disabled and not set for the stage I originally set them up for.
I tried over and over again to reproduce the issue but couldn’t - I finally fixed the differences manually.
Later on, while exploring the UI - I found the Event Log and in it there were a couple of events that seem to be related:

I tested a bit and found that if I modify a stage (add an action to it for example)
then any event handlers related to that stage are disabled by the system.
The error shown in the event log is:
Issue with build event handler while updating stages for configuration ‘Clone Test’: Build event handler ‘PrevGitCommitId Persist Event Handler’ has been disabled as it references a stage which no longer exists.
Build event handler ‘PrevRevision Persist Event Handler’ has been disabled as it references a stage which no longer exists.

Is this a bug?
If a stage was modified I would still like the event handlers related to it to remain enabled/active.
In my case and as far as I know this is only related to event handlers, but this possibly could be effecting other sections which I’m not aware of / not using at the moment.
Also - when cloning the configuration obviously this mistake (disabled event handlers) comes along to the clone.

Plus, for some reason although I am subscribed to “Admin event log private message” under User Preference - Subscriptions via Groups (this subscription can’t be edited or disabled) -
I did not receive any private message (and as can be seen in the screenshot there were few events in the event log)

Continua 1.9.1.511

Hi @ktopaz,

Thank you for reporting this issue. It has previously been reported but we couldn’t reproduce it at the time.

After a lot of investigation today, we have discovered that cloning the configuration does not update the stage references in build event handlers to point to the relevent stages in the new configuration. That means that event handlers in a newly cloned configuration still reference stages in the old configuration. When the stages are subsequently edited, a check runs, identifies that the event handler points to an invalid stage and therefore disables it.

We are currently working on a fix for this behaviour. As far as we can see this issue only occurs when cloning the configuration and then subsequently modifiying the stage. Can you confirm this?

We can confirm that there are issues with private messages and are currently investigating. Note that group subscriptions can be edited in the administration section.

Actually it seems to me (according to the event log messages order) that the issue first started when editing a stage, regardless of having the configuration cloned later or not -
Simply editing a stage (Add an action to it) in an existing configuration - causes the event handlers referencing that stage - to become disabled.
If we later clone that entire configuration - then the disabled event handlers are cloned along with it of course.
So it could be 2 separate issues here:

  1. Editing a stage disables any event handlers referencing that stage.
  2. As you mentioned (I did not know this) - Cloning a configuration does not update the stage references in build event handlers to point to the relevant stages in the new configuration
    (I was under the impression that due to #1 - the new configuration has disabled build event handlers due to them being already disabled in the source config which is being cloned)

Thank you! I modified the publisher to email and tested it by editing a stage (:smile: )…
When I saved the configuration - I immediately received an email with the event log message:

A new event has been added to the event log:
Stages Issue with build event handler while updating stages for configuration ‘@link(2001, f724388a-41c2-450a-9ff8-ab1a0077218a)[test test test]’: Build event handler ‘PrevGitCommitId Persist Event Handler’ has been disabled as it references a stage which no longer exists.
Build event handler ‘PrevRevision Persist Event Handler’ has been disabled as it references a stage which no longer exists.

So the subscription is working ok via email, which is even better than private messages imho for event log type of messages.

We haven’t been able to reproduce this scenario, but will investigate further.

Hi @ktopaz,

Version 1.9.1.528 includes a fix for the issue we were seeing where stage links in build event handlers were lost when cloning a configuration causing them to subsequently be disabled. Hopefully, this also fixes the issue you were seeing.