I'm getting session.onShutdown errors in log. But, I've never made one?

It is telling me it’s on view: view=Page/Embedded/Cards/machine home card@C$0:0[8]**, project-name=CMM

But, there is no shutdown evet on this view. How do I figure out where this is coming from?

INFO   | jvm 1    | 2020/02/15 19:51:44 | W [P.ScriptRunner                ] [01:51:44]: Error running session.onShutdown(session): Traceback (most recent call last):
INFO   | jvm 1    | 2020/02/15 19:51:44 |   File "<function:onShutdown>", line 2, in onShutdown
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.getSession(PerspectiveScriptingFunctions.java:671)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.closeSession(PerspectiveScriptingFunctions.java:98)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2020/02/15 19:51:44 | java.lang.IllegalStateException: java.lang.IllegalStateException: Session is not running.
INFO   | **jvm 1    | 2020/02/15 19:51:44 |  view=Page/Embedded/Cards/machine home card@C$0:0[8]**, project-name=CMM
INFO   | jvm 1    | 2020/02/15 19:51:44 | com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last):
INFO   | jvm 1    | 2020/02/15 19:51:44 |   File "<function:onShutdown>", line 2, in onShutdown
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.getSession(PerspectiveScriptingFunctions.java:671)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.closeSession(PerspectiveScriptingFunctions.java:98)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2020/02/15 19:51:44 | 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2020/02/15 19:51:44 | java.lang.IllegalStateException: java.lang.IllegalStateException: Session is not running

I am pretty sure it’s causing my memory to do this as well. it’ll go away if I restart. But, If I open the view in a designer it goes crazy.

Monday bump

https:/uploads/iatesting/original/2X/5/5dd8610eb0dc9e405d2cde6c524bf5837e8e2016.mp4

How does a guy get rid of these ghost scripts/transforms/bindings?

I’ve deleted this guy several times. But, keep getting errors. Like its still there.

INFO   | jvm 1    | 2020/02/17 18:11:59 | java.lang.Exception: java.lang.Exception: java.lang.Exception: Missing value for query parameter {tbl}
INFO   | jvm 1    | 2020/02/17 18:11:59 | "), Mon Feb 17 18:11:59 CST 2020 (1581984719174)]
INFO   | jvm 1    | 2020/02/17 18:12:00 | [null, Error_ScriptEval("Traceback (most recent call last):
INFO   | jvm 1    | 2020/02/17 18:12:00 |   File "<transform>", line 4, in transform
INFO   | jvm 1    | 2020/02/17 18:12:00 |   File "<module:scale>", line 17, in mrbYN
INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at com.inductiveautomation.ignition.gateway.db.namedquery.NamedQueryExecutor$NamedQueryInstance.execute(NamedQueryExecutor.java:414)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at com.inductiveautomation.ignition.gateway.db.namedquery.NamedQueryExecutor.execute(NamedQueryExecutor.java:177)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at com.inductiveautomation.ignition.gateway.db.namedquery.GatewayNamedQueryManager.execute(GatewayNamedQueryManager.java:79)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at com.inductiveautomation.ignition.common.db.namedquery.SecuredNamedQueryManager.execute(SecuredNamedQueryManager.java:40)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities.runNamedQuery(GatewayDBUtilities.java:412)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at jdk.internal.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

INFO   | jvm 1    | 2020/02/17 18:12:00 | 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

INFO   | jvm 1    | 2020/02/17 18:12:00 | java.lang.Exception: java.lang.Exception: java.lang.Exception: Missing value for query parameter {tbl}
INFO   | jvm 1    | 2020/02/17 18:12:00 | "), Mon Feb 17 18:12:00 CST 2020 (1581984720174)]

https:/uploads/iatesting/original/2X/f/f6a765707a11be95ce4d0657b25954ff1eb773bf.mp4

Correct. Or, there is at least no shutdownEvent emitting errors.

Read the stack trace.

Error running session.onShutdown(session):

"session.onShutdown(session)" means that you have a Session Shutdown Event configured, and that Event is failing.

This is a separate issue which I will need more information to help resolve. Hopefully your own examination will reveal the issue. Sometimes you'll see similar issues if you have bindings which circle back on themselves and essentially create an infinite loop.

You need to go to the location you placed the binding and remove it. The issue you're seeing where you attempt to remove the data param could be caused if something in your View is creating that data array. Could you verify nothing is creating that property as part of a transform or propertyChange script?

The view.json is the source of truth for bindings and transforms.

What you could do is this:

  1. Double-click your machine home card View node in the Project browser.
  2. Hold Shift and then right-click the View node.
  3. Select "Copy JSON".
  4. Paste the contents of your clipboard into a text editor.
  5. Save this file somewhere safe so that you can come back to it if something goes terribly wrong.
  6. Duplicate the file and open the duplicate in the text editor.
  7. Very carefully, remove the data array from the json.
  8. Save the duplicate file.
  9. Copy the text present in the editor.
  10. Select the View node in the Project Browser
  11. Hold Shift and right-click the View node.
  12. Select "Paste JSON".
1 Like

I think the issue I am having is related to renaming a view param while it has a binding on it.

I have lots of screens with an input binding. And that is the param for an output SQL binding. This has been effective for me. However when it comes time to add something to it or rename it. Seems to be the issue. Now I am setting it up as input param and output custom property. And not seeing these issues. I am on 8.0.6

https:/uploads/iatesting/original/2X/c/c331226585f0d3e25a328bf4cb3461e3b963a794.mp4

 },
  "params": {},
  "propConfig": {
    "params.in": {
      "binding": {
        "config": {
          "bypassCache": true,
          "designerUseLimit": false,
          "parameters": {
            "part": "{view.params.part}"
          },
          "queryPath": "get part type data",
          "returnFormat": "json"
        },
        "type": "query"
      },
      "onChange": {
        "enabled": null,
        "script": "\t#\timport time\n#\ttime.sleep(1)\n\tif len(currentValue.value) \u003d\u003d 3 or 6:\n\t\twt \u003d self.params.in[0].piece_weight\n\t\tsize \u003d self.params.in[0].lot_size\n\t\trev \u003d self.params.in[0].rev\n\t\tindex \u003d self.params.in[0].index\n\t\t\n\t\t\n\t\tself.getChild(\"root\").getChild(\"weight\").props.value \u003d wt\n\t\tself.getChild(\"root\").getChild(\"lotsize\").props.value \u003d size\n\t\tself.getChild(\"root\").getChild(\"index\").props.text \u003d index\n\t\tself.getChild(\"root\").getChild(\"rev\").props.text \u003d rev\n\t\t\n\telse:\n\t\tpass"
      },
      "paramDirection": "output",
      "persistent": false
    },
    "params.key": {
      "paramDirection": "output",
      "persistent": false
    },
    "params.part": {
      "paramDirection": "input",
      "persistent": false
    },
    "params.part_1": {
      "paramDirection": "input",
      "persistent": true
    },
    "params.part_2": {
      "paramDirection": "input",
      "persistent": true
    },
    "params.part_3": {
      "paramDirection": "input",
      "persistent": true
    },
    "params.part_4": {
      "paramDirection": "input",
      "persistent": true
    },
    "params.rev": {
      "paramDirection": "input",
      "persistent": false
    },
    "params.size": {
      "paramDirection": "input",
      "persistent": false
    },
    "params.wt": {
      "paramDirection": "input",
      "persistent": false
    }

I didn't make part_1 & part_2 and so on.

Nothing was creating that prop. No.

Could you supply the view.json?

view.json (7.9 KB)

This was one of them. Before, I went through and fixed them all. I think that it has to do with renaming a persistent param. Like I said I was using the params incorrectly. As I understand. So maybe it’s expected. I was just following up. But, this JSON file was the one in the most recent video. I grabbed before I fixed it.

Okay, I’ve fixed the View in question, and here are a few notes about what I found:

  1. The in param is bound to a Named Query where one of the parameters is another parameter. Don’t do this. The in param should be a custom property instead. “Inbound” params don’t allow for bindings, but we can’t stop users from configuring the param as an “outbound” param with a binding and then swapping the direction, which it looks like you’ve done here.
  2. The param configs were in place, but the actual param definitions were missing, which can exist in older builds but which we haven’t seen in a long while. In what Version was this View originally made?
  3. You have a View onStartup script which is setting most of the Params. Don’t do this. Inbound params which are written to run the risk of never displaying/representing values passed into them if you are writing values into them.

Recommendations (what I did):

  1. ONLY pass the part param into this View.
  2. Create wt, rev, in, and size custom properties.
  3. Bind in to a Named Query where part is the parameter.
  4. Bind wt, rev, and size to the in property, OR just make the in property the ONLY custom property and bind relevant fields against the necessary values (I would recommend switching the Named Query return type to json if going this route).
  5. Remove all instances of property change scripts from the View.
    view.json (11.4 KB)
2 Likes