# \[Errant?\] Error Message on Gateway Tag Script

**URL:** <https://forum.inductiveautomation.com/t/errant-error-message-on-gateway-tag-script/116209>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 30, 2026, 3:33pm UTC](https://forum.inductiveautomation.com/t/errant-error-message-on-gateway-tag-script/116209 "2026-06-30T15:33:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gloweware](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@gloweware](https://forum.inductiveautomation.com/u/gloweware)\
**Post date:** [June 30, 2026, 3:33pm UTC](https://forum.inductiveautomation.com/t/errant-error-message-on-gateway-tag-script/116209/1 "2026-06-30T15:33:24Z")

</div>

Just upgraded to 8.3.7 from 8.3.1 and was modifying a Gateway Tag Change script when I received an error that previously did not exist.

`def onTagChange(initialChange, newValue, previousValue, event, executionCount):`  
`if newValue.value == True:`  
`DatabaseRoutines.DatabaseCleanup("Tag")`  
`system.tag.writeBlocking(["[Dashboard]Misc/DatabaseCleanup"], [False])`

and I get this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7d22e78d06112686d7b6b5a78d82c963bef9d5a1.png)

If I chose yes, the script works just fine and only runs the routine on a True state.

If I remove the IF statement, it does not throw the error, but will fire on both true and false states (which I don't want).

It appears to be just not detecting the tab indent after the IF statement.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 30, 2026, 3:38pm UTC](https://forum.inductiveautomation.com/t/errant-error-message-on-gateway-tag-script/116209/2 "2026-06-30T15:38:43Z")

</div>

Previously reported. Indent deeper for now. (Or make a one-liner that calls into your gateway scripting project's library.)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 30, 2026, 3:50pm UTC](https://forum.inductiveautomation.com/t/errant-error-message-on-gateway-tag-script/116209/3 "2026-06-30T15:50:38Z")

</div>

Yep, same issue reported here:

> [@\[IGN-16691\]Gateway Event Script Compile Error](https://forum.inductiveautomation.com/t/ign-16691-gateway-event-script-compile-error/116115):
>
> I'm not sure if I'm crazy or what but I'm running into a compile error when trying to save a script for a Gateway Event. Crazy thing it I'm positive I was not getting this error running on 8.3.2. Then I upgraded to 8.3.7 and went into the script to add something and when I try to close & save I get a compile error. The other crazy thing is that I don't think I should be getting a compile error because the error is complaining about indent and my indent looks fine to me. Since the code is on t…

Unfortunately the fix missed the release train for 8.3.8 but _should_ be in 8.3.9.

---

<div class="post-metadata">

**Author:** ![gloweware](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@gloweware](https://forum.inductiveautomation.com/u/gloweware)\
**Post date:** [June 30, 2026, 3:56pm UTC](https://forum.inductiveautomation.com/t/errant-error-message-on-gateway-tag-script/116209/4 "2026-06-30T15:56:33Z")

</div>

ok. Thanks.

I did look for previously reported items, but I guess I never hit the right keywords.
