# GenieACS 1.1.3 preset\_loop

**URL:** <https://forum.genieacs.com/t/genieacs-1-1-3-preset-loop/383>\
**Category:** Uncategorized\
**Created:** [October 23, 2019, 7:04am UTC](https://forum.genieacs.com/t/genieacs-1-1-3-preset-loop/383 "2019-10-23T07:04:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jozefrebjak](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/jozefrebjak/32/23_2.png) [@jozefrebjak](https://forum.genieacs.com/u/jozefrebjak)\
**Post date:** [October 23, 2019, 7:04am UTC](https://forum.genieacs.com/t/genieacs-1-1-3-preset-loop/383/1 "2019-10-23T07:04:18Z")

</div>

hello,

why I am getting this message for preset?

faultCode=“preset\_loop” faultMessage=“The presets are stuck in an endless configuration loop”

 ![22](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/c49ee0ab08917836b701933a846c5d88ea99d59e.png)

---

<div class="post-metadata">

**Author:** ![ianbmacdonald](https://avatars.discourse-cdn.com/v4/letter/i/b2d939/32.png) [@ianbmacdonald](https://forum.genieacs.com/u/ianbmacdonald)\
**Post date:** [October 23, 2019, 6:06pm UTC](https://forum.genieacs.com/t/genieacs-1-1-3-preset-loop/383/2 "2019-10-23T18:06:01Z")

</div>

Maybe too simple an answer, but if something is changing during your preset, maybe in a linked provision, it is going to iterate again until nothing changes.

As an example, for illustrative purposes, not that I can think of a reason to do so

So if you had some code in your provision that sets a tag, with a name that includes the timestamp it was run (i.e. it would be a different tag name set each time it is executed) the script would end up in the “endless configuration loop” because, it would iterate until nothing changed … which would never happen because the tag name is based on when the script runs, changing with each iteration.

Perhaps you have something like this in your preset … creating a new change each time, rather than landing in a static state where no more changes occur.

We find that when calling external scripts, or a set of scripts acting like a state machine, we only want a signle iteration of each provision.

I will explain how we do this, in hopes that it is an opportunity for more experienced users to chime in and let us know what sort of other best practice might or should be used in lieu of our method.

Our method is to use the tags to prevent a provision from iterating more than once. Take for instance the example in suedocode below, where we want to execute Provision A only once per device. Script B will iterate until there are no more tag changes.

Provision A:  
Launched from Preset triggers on “2 PERIODIC” inform and TAG is NOT ScriptAExecuting  
Sets Tag ScriptAExecuting  
Does some stuff  
Sets Tag ScriptAExecuted  
returns

Provision B:  
Launched from Preset triggers on “2 PERIODIC” inform AND when TAG is ScriptAExecuted and TAG is NOT ScriptBExecuting  
Sets Tag ScriptBExecuting  
Clears Tag ScriptAExecuting  
Does some stuff  
Sets Tag ScriptBExecuted  
Clears Tag ScriptBExecuting  
returns

---

<div class="post-metadata">

**Author:** ![jozefrebjak](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/jozefrebjak/32/23_2.png) [@jozefrebjak](https://forum.genieacs.com/u/jozefrebjak)\
**Post date:** [November 4, 2019, 7:35am UTC](https://forum.genieacs.com/t/genieacs-1-1-3-preset-loop/383/3 "2019-11-04T07:35:24Z")

</div>

Thank you. This helped me a lot . I did it like you said and it’s ok now. I am not getting fault messages after tag was added

---

<div class="post-metadata">

**Author:** ![zhangqiang](https://avatars.discourse-cdn.com/v4/letter/z/f14d63/32.png) [@zhangqiang](https://forum.genieacs.com/u/zhangqiang)\
**Post date:** [December 21, 2020, 12:21pm UTC](https://forum.genieacs.com/t/genieacs-1-1-3-preset-loop/383/4 "2020-12-21T12:21:04Z")

</div>

Hello, I also encountered the same problem, please ask, in which specific place to add labels?
