# Timezone Declaration creating Endless Configuration Loop

**URL:** <https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945>\
**Category:** Uncategorized\
**Created:** [September 13, 2022, 4:52pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945 "2022-09-13T16:52:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cingelj16](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cingelj16](https://forum.genieacs.com/u/cingelj16)\
**Post date:** [September 13, 2022, 4:52pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945/1 "2022-09-13T16:52:05Z")

</div>

Hi all,

I’ve been trying to add some values that get set during the inform script, by starting with the timezone. I check the current time zone value of the device, and if it is not what I want, then I change it. I use the same structure in other scripts and it works just fine.

Here is my script:

```auto
log("Inform Script");

const now = Date.now();
let timeZone = declare("InternetGatewayDevice.Time.LocalTimeZone", {value: now});
timeZone = timeZone.value[0];
log(timeZone)
const easternTime = "-04:00"

if (timeZone != easternTime) {
  log("time zone not -04:00")
  declare("InternetGatewayDevice.Time.LocalTimeZone", {path: 1, value: easternTime});
}
else
{
  log("time zone == -04:00")
}

```

And the output in the cwmp-access log:

2022-09-13T16:40:38.429Z [INFO] : Inform; cpeRequestId=“1716269165” informEvent=“2 PERIODIC” informRetryCount=0  
2022-09-13T16:40:38.442Z [INFO] : Script: Inform Script  
2022-09-13T16:40:38.451Z [INFO] : ACS request; acsRequestId=“18337b95cf10000” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.459Z [INFO] : Script: -06:00  
2022-09-13T16:40:38.459Z [INFO] : Script: time zone not -04:00  
2022-09-13T16:40:38.474Z [INFO] : ACS request; acsRequestId=“18337b95cf10001” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.494Z [INFO] : ACS request; acsRequestId=“18337b95cf10002” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.513Z [INFO] : ACS request; acsRequestId=“18337b95cf10003” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.522Z [INFO] : Script: Inform Script  
2022-09-13T16:40:38.535Z [INFO] : Script: -06:00  
2022-09-13T16:40:38.535Z [INFO] : Script: time zone not -04:00  
2022-09-13T16:40:38.545Z [INFO] : ACS request; acsRequestId=“18337b95cf10100” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.563Z [INFO] : ACS request; acsRequestId=“18337b95cf10101” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.580Z [INFO] : ACS request; acsRequestId=“18337b95cf10102” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.588Z [INFO] : Script: Inform Script  
2022-09-13T16:40:38.598Z [INFO] : Script: -06:00  
2022-09-13T16:40:38.598Z [INFO] : Script: time zone not -04:00  
2022-09-13T16:40:38.606Z [INFO] : ACS request; acsRequestId=“18337b95cf10200” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.622Z [INFO] : ACS request; acsRequestId=“18337b95cf10201” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.639Z [INFO] : ACS request; acsRequestId=“18337b95cf10202” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.648Z [INFO] : Script: Inform Script  
2022-09-13T16:40:38.657Z [INFO] : Script: -06:00  
2022-09-13T16:40:38.657Z [INFO] : Script: time zone not -04:00  
2022-09-13T16:40:38.666Z [INFO] : ACS request; acsRequestId=“18337b95cf10300” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.683Z [INFO] : ACS request; acsRequestId=“18337b95cf10301” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.700Z [INFO] : ACS request; acsRequestId=“18337b95cf10302” acsRequestName=“GetParameterValues”  
2022-09-13T16:40:38.706Z [WARN] : Channel has faulted; channel=“inform” retries=0 faultCode=“preset\_loop” faultMessage=“The presets are stuck in an endless configuration loop”  
2022-09-13T16:40:38.706Z [WARN] : Channel has faulted; channel=“remote” retries=0 faultCode=“preset\_loop” faultMessage=“The presets are stuck in an endless configuration loop”

Thanks!

---

<div class="post-metadata">

**Author:** ![rudymartin](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rudymartin](https://forum.genieacs.com/u/rudymartin)\
**Post date:** [September 13, 2022, 5:20pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945/2 "2022-09-13T17:20:29Z")

</div>

[https://docs.genieacs.com/en/latest/provisions.html#tags](https://docs.genieacs.com/en/latest/provisions.html#tags)

place a tag at the end

still :

> [@cingelj16](#):
>
> ```auto
> declare("InternetGatewayDevice.Time.LocalTimeZone", {path: 1, value: easternTime});
> }
> 
> ```

something seems wrong to me with that line. If I’m not mistaken path is used with objects. That may be the cause you get the loop.

---

<div class="post-metadata">

**Author:** ![cingelj16](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cingelj16](https://forum.genieacs.com/u/cingelj16)\
**Post date:** [September 13, 2022, 5:22pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945/3 "2022-09-13T17:22:36Z")

</div>

I swapped out “path” with “value” and got the same outcome, let me try delineation via a tag.

---

<div class="post-metadata">

**Author:** ![rudymartin](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rudymartin](https://forum.genieacs.com/u/rudymartin)\
**Post date:** [September 13, 2022, 5:25pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945/4 "2022-09-13T17:25:13Z")

</div>

take the shortest route and re read the docs first

[https://docs.genieacs.com/en/latest/provisions.html#declare-path-timestamps-values](https://docs.genieacs.com/en/latest/provisions.html#declare-path-timestamps-values)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 13, 2022, 10:20pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945/5 "2022-09-13T22:20:24Z")

</div>

Your syntax is bad.

```auto
declare("InternetGatewayDevice.Time.LocalTimeZone", {path: 1}, {value: easternTime});

```

But, you are making things harder on yourself. Just let GenieACS manage state by taking out all the checks and just putting the declare in. GenieACS will then only update the `InternetGatewayDevice.Time.LocalTimeZone` param if needed.

---

<div class="post-metadata">

**Author:** ![cingelj16](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cingelj16](https://forum.genieacs.com/u/cingelj16)\
**Post date:** [September 14, 2022, 12:03pm UTC](https://forum.genieacs.com/t/timezone-declaration-creating-endless-configuration-loop/2945/6 "2022-09-14T12:03:47Z")

</div>

I fixed it with

```auto
declare("InternetGatewayDevice.Time.LocalTimeZone", null, {value: easternTime});

```

But I will remove the if statements and just execute the declare, thanks!
