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

**URL:** <https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307>\
**Category:** Ignition Early Access\
**Created:** [February 16, 2020, 2:19am UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307 "2020-02-16T02:19:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 16, 2020, 2:19am UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/1 "2020-02-16T02:19:03Z")

</div>

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?

```auto
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.

 ![mem](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2bd3889c7aa36d6e17de10afb5ddf58c00f5f753.jpeg)

 ![card](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/25bdbfa3254209242e9b81e6a5ed61d5b8ef07b4.jpeg)

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 17, 2020, 3:16pm UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/2 "2020-02-17T15:16:06Z")

</div>

Monday bump

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 18, 2020, 12:19am UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/3 "2020-02-18T00:19:14Z")

</div>

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.

```auto
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)]

```

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 18, 2020, 12:34am UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/4 "2020-02-18T00:34:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 18, 2020, 3:41pm UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/5 "2020-02-18T15:41:43Z")

</div>

> [@wking](#):
>
> But, there is no shutdown evet on this view.

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

> [@wking](#):
>
> How do I figure out where this is coming from?

Read the stack trace.

```auto
Error running session.onShutdown(session):

```

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

> [@wking](#):
>
> But, If I open the view in a designer it goes crazy.

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.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 18, 2020, 4:00pm UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/6 "2020-02-18T16:00:17Z")

</div>

> [@wking](#):
>
> How does a guy get rid of these ghost scripts/transforms/bindings?

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".

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 28, 2020, 12:08am UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/7 "2020-02-28T00:08:48Z")

</div>

> [@cmallonee](#):
>
> Sometimes you’ll see similar issues if you have bindings which circle back on themselves and essentially create an infinite loop

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

```auto
 },
  "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.

> [@cmallonee](#):
>
> Could you verify nothing is creating that property as part of a transform or propertyChange script?

Nothing was creating that prop. No.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 28, 2020, 3:25pm UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/8 "2020-02-28T15:25:03Z")

</div>

Could you supply the view.json?

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 28, 2020, 5:08pm UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/9 "2020-02-28T17:08:02Z")

</div>

[view.json](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/dd4b038e6c1ccff35799c5b42cf2dfe732f4922f.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.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 28, 2020, 6:00pm UTC](https://forum.inductiveautomation.com/t/im-getting-session-onshutdown-errors-in-log-but-ive-never-made-one/32307/10 "2020-02-28T18:00:55Z")

</div>

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](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b6ea3b8b6f5d719020d1dde85c55005f7bd6b213.json) (11.4 KB)
