Error in perspective popup `onStartup` script when opening screen in designer, object does not support item assignment

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 13, in runAction TypeError: 'instancemethod' object does not support item assignment

at org.python.core.Py.TypeError(Py.java:234)

at org.python.core.PyObject.setitem(PyObject.java:731)

at org.python.pycode._pyx193.runAction$1(:17)

at org.python.pycode._pyx193.call_function()

at org.python.core.PyTableCode.call(PyTableCode.java:173)

at org.python.core.PyBaseCode.call(PyBaseCode.java:306)

at org.python.core.PyFunction.function___call__(PyFunction.java:474)

at org.python.core.PyFunction.call(PyFunction.java:469)

at org.python.core.PyFunction.call(PyFunction.java:464)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:847)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:829)

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:868)

at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:1010)

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:950)

at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:161)

at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:98)

at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:80)

at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)

at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)

at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)

at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)

at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at com.inductiveautomation.perspective.gateway.threading.BlockingWork$BlockingWorkRunnable.run(BlockingWork.java:58)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: org.python.core.PyException: TypeError: 'instancemethod' object does not support item assignment

... 28 common frames omitted

Hello and welcome aboard,

Here are a few tips to make your stay with us pleasant for everyone:

  • when posting code, stack traces, error messages... use the built-in code formatting tool, it makes things much more readable by using a monospaced font and preserving indentation
  • make the title descriptive, but keep it short. You can add details in the body of the post.
  • when asking for help fixing an error, show the code/what you're doing. We can't help you find what's wrong without access to what have.
  • we are NOT support, only users willing to share what we know. Keep that in mind when posting.
  • even if we were support, we'd still be human people (I think ?) and it's usually a good idea to observe at least some basic level of politeness when addressing human people. Especially when asking for help.

Here, the error tells us that on line 13 of a script assigned to the onStartup event of your view, you're trying to assign a value to something that's read-only or not built to receive values.

For more details, we'll need to see the code.
And remember: when posting code, use the formatting tool. Post the actual code, not a screenshot.

2 Likes