# system.util.jsonEncode() maximum recursion depth exceeded

**URL:** <https://forum.inductiveautomation.com/t/system-util-jsonencode-maximum-recursion-depth-exceeded/117157>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 22, 2026, 8:52am UTC](https://forum.inductiveautomation.com/t/system-util-jsonencode-maximum-recursion-depth-exceeded/117157 "2026-09-22T08:52:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [September 22, 2026, 8:52am UTC](https://forum.inductiveautomation.com/t/system-util-jsonencode-maximum-recursion-depth-exceeded/117157/1 "2026-09-22T08:52:06Z")

</div>

Hi!

Sometimes when I try to encode an object (normally when I try to encode Ignition object as qualitycodes) it gives me this error:

`RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)`

Any idea of this? And how to fix it or get around?  
Thx in advance!

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [September 22, 2026, 8:54am UTC](https://forum.inductiveautomation.com/t/system-util-jsonencode-maximum-recursion-depth-exceeded/117157/2 "2026-09-22T08:54:07Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/2/42efcc901927fcb2104f62fc9268e33f40b1c37d.png)

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [September 22, 2026, 12:25pm UTC](https://forum.inductiveautomation.com/t/system-util-jsonencode-maximum-recursion-depth-exceeded/117157/3 "2026-09-22T12:25:37Z")

</div>

I think this might be because the QualityCode is nested inside the list. If you want to have it in a list you might have to convert it into a string or the respective integer code before the jsonEncode.
