# JSON Encode error: object has no attribute jsonEncode

**URL:** <https://forum.inductiveautomation.com/t/json-encode-error-object-has-no-attribute-jsonencode/113567>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [January 27, 2026, 2:53pm UTC](https://forum.inductiveautomation.com/t/json-encode-error-object-has-no-attribute-jsonencode/113567 "2026-01-27T14:53:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mario.lopez](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mario.lopez](https://forum.inductiveautomation.com/u/mario.lopez)\
**Post date:** [January 27, 2026, 2:53pm UTC](https://forum.inductiveautomation.com/t/json-encode-error-object-has-no-attribute-jsonencode/113567/1 "2026-01-27T14:53:33Z")

</div>

I have implemented a doPost operation using the webdev. At the end of the code it is used the function `system.util.jsonEncode(dic)` where a dictionary is given as the argument of the function through a variable. The type of this variable is a dictionary, but once in a while when running a post operation against this web server it throws the following error in the ignition log:

`com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 92, in doPost AttributeError: 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'jsonEncode'`

The line where the error was raised is:  
`functions.logger.info(system.util.jsonEncode(info))`

The function is correctly called and the variable is a dictionary so does not make sense that this error were raised. As I said this does not happen every time this code is executed, just once in a while, but whithout any specific pattern, or at least none that has been noticed. Once the error appear, the only way to prevent the error to be raise is by executing it in tow steps as follows:

`infoJsonString = system.util.jsonEncode(info)`  
`functions.logger.info(infoJsonString)`

So, this behaviour of ignition does not make any sense for me. Don’t know if there is any bug that can cause it or if I am doing something wrong. So I was wondering how to fix it.

Thanks!

Mario

---

<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:** [January 27, 2026, 4:28pm UTC](https://forum.inductiveautomation.com/t/json-encode-error-object-has-no-attribute-jsonencode/113567/2 "2026-01-27T16:28:23Z")

</div>

1. What version of Ignition is this?
2. Are you accidentally rebinding or modifying `system` along some code path? You can both shadow and mutate the `system` package objects that are automatically introduced into scope.
3. Are you explicitly importing `system` or any other project library in your code? (don't do this)
4. If you move your entire script to the project library and make you webdev endpoint a one-line script that simply calls it, providing all the webdev module's parameters, does the issue still occur?
