# \[BUG-13425\] NameError: global name 'shared' is not defined

**URL:** <https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791>\
**Category:** Ignition Early Access\
**Created:** [April 2, 2019, 3:53pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791 "2019-04-02T15:53:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nburt](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@nburt](https://forum.inductiveautomation.com/u/nburt)\
**Post date:** [April 2, 2019, 3:53pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/1 "2019-04-02T15:53:17Z")

</div>

I’ve been holding off posting this bug for a while because it seems to occur (and resolve) at random, but it has really become quite a problem.

Our main project originally had a script package called ‘shared’, but after an update this ‘shared’ package became part of a new parent project (global) and our main project automatically became a child of global.

Our main project has a script package called ‘project’. This package has a handful of scripts, some of which make calls to functions defined in the ‘shared’ package. All our scripts seem to be working except one called ‘webservice’.

Steps to reproduce the error:

- some kind of project restart has to be done, not sure exactly what yet
- onClick of a button calls project.webservice.test(), which simply calls shared.logConst.LOGOUT (but this could be shared.\<any\_script\>.\<any\_function\_or\_constant\>). This gives the error.
- some kind of change has to be done. yesterday we copied ‘webservice’ to a new script, deleted ‘webservice’, and renamed the new script to be ‘webservice’, which worked. Today the same error occurred so we duplicated the project.webservice.test() function to project.videsDbFunctions.test(). videsDbFunctions already makes references to ‘shared’ without error so we expected this test to pass as well which it did BUT this also caused project.webservice.test() to start working. After reverting the change (ie removing test() from videsDbFunctions), webservice.test() still ran without errors.  
Restarting the Designer did not bring the error back.  
Restarting the Gateway did not bring the error back.

However, much like yesterday and many times before, I’m sure that at some point the error will reoccur.

---

<div class="post-metadata">

**Author:** ![nburt](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@nburt](https://forum.inductiveautomation.com/u/nburt)\
**Post date:** [April 2, 2019, 3:53pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/2 "2019-04-02T15:53:56Z")

</div>

STACK TRACE:

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File “”, line 8, in runAction File “”, line 158, in test NameError: global name ‘shared’ is not defined

at org.python.core.Py.NameError(Py.java:290)

at org.python.core.PyFrame.getglobal(PyFrame.java:265)

at org.python.pycode.\_pyx574.test$8(:158)

at org.python.pycode.\_pyx574.call\_function()

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

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

at org.python.core.PyFunction. **call** (PyFunction.java:403)

at org.python.pycode.\_pyx573.runAction$1(:10)

at org.python.pycode.\_pyx573.call\_function()

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

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

at org.python.core.PyFunction.function\_\_\_call\_\_(PyFunction.java:471)

at org.python.core.PyFunction. **call** (PyFunction.java:466)

at org.python.core.PyFunction. **call** (PyFunction.java:456)

at org.python.core.PyFunction. **call** (PyFunction.java:451)

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

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

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

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

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

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

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

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

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

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 java.base/java.lang.Thread.run(Unknown Source)

Caused by: org.python.core.PyException: Traceback (most recent call last): File “”, line 8, in runAction File “”, line 158, in test NameError: global name ‘shared’ is not defined

… 30 common frames omitted

---

<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:** [April 2, 2019, 4:26pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/3 "2019-04-02T16:26:30Z")

</div>

Any chance I could see your “test” script, either here in the thread or through Direct Message?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 2, 2019, 4:26pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/4 "2019-04-02T16:26:45Z")

</div>

Thanks, I think I’ve reproduced this.

---

<div class="post-metadata">

**Author:** ![nburt](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@nburt](https://forum.inductiveautomation.com/u/nburt)\
**Post date:** [April 2, 2019, 5:00pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/5 "2019-04-02T17:00:57Z")

</div>

def test():  
shared.logConst.LOGOUT

That’s the script (tabs aren’t displayed in the forum post) that is giving an error in project.webservice but not giving an error in project.videsDbFunctions or any other project scripts.

I can send full scripts/files if you want, though it sounds like Kevin was able to reproduce the bug

---

<div class="post-metadata">

**Author:** ![RyanDyni](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@RyanDyni](https://forum.inductiveautomation.com/u/RyanDyni)\
**Post date:** [April 8, 2019, 9:07pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/6 "2019-04-08T21:07:38Z")

</div>

Hi Kevin,  
With the full release of Ignition 8 we are still seeing the same issue.  
You mentioned you had been able to reproduce the issue, just wondering what the plan for fixes is now that the product it out of Beta? Is there some cadence to 8.0.xx releases we can expect?

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 8, 2019, 9:11pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/7 "2019-04-08T21:11:59Z")

</div>

> [@RyanDyni](#):
>
> You mentioned you had been able to reproduce the issue, just wondering what the plan for fixes is now that the product it out of Beta? Is there some cadence to 8.0.xx releases we can expect?

Every ~4 weeks there should be a new release. We're also going to continue doing nightly releases in between those 4 week releases.

Blog post about it: [All Aboard the Release Train. First Stop: Ignition 8! | Inductive Automation](https://inductiveautomation.com/blog/all-aboard-the-release-train-first-stop-ignition-8)

---

<div class="post-metadata">

**Author:** ![RyanDyni](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@RyanDyni](https://forum.inductiveautomation.com/u/RyanDyni)\
**Post date:** [April 8, 2019, 9:57pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/8 "2019-04-08T21:57:33Z")

</div>

Thanks, that is helpful information.  
Specifically regarding this issue, it is a show stopper for us.  
Our project development is essentially complete and we are going through testing and acceptance.  
The way this is occurring the project just becomes nonfunctional multiple times through the day.

Basically our project will have to hold any go-live until this is resolved. Can you confirm it is being addressed for the next build release?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 8, 2019, 10:09pm UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/9 "2019-04-08T22:09:12Z")

</div>

It hasn’t been officially assigned yet but it should get fixed for 8.0.1 unless for some reason we can’t figure it out in time.

---

<div class="post-metadata">

**Author:** ![JantjeBeton](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@JantjeBeton](https://forum.inductiveautomation.com/u/JantjeBeton)\
**Post date:** [April 19, 2019, 10:15am UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/10 "2019-04-19T10:15:08Z")

</div>

Almost the same here, this is blocking our development and we need a solution quite soon.  
@Kevin.Herron: When will 8.0.1 be released and when will you know if this fix will be included?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 19, 2019, 11:41am UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/11 "2019-04-19T11:41:14Z")

</div>

This should be fixed in the nightly builds from yesterday and today.

8.0.1-rc1 will be released Monday and 8.0.1 final another week after that.

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [May 3, 2019, 1:41am UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/12 "2019-05-03T01:41:59Z")

</div>

I believe this might still be an issue? Unless it’s unrelated but similar.

I upgraded from 8.0.0 to 8.0.1-rc1 and my scrips stopped working and weren’t being recognized until I went into each, changed a line, and saved the project.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 3, 2019, 2:41am UTC](https://forum.inductiveautomation.com/t/bug-13425-nameerror-global-name-shared-is-not-defined/23791/13 "2019-05-03T02:41:14Z")

</div>

> [@nburt](#):
>
> def test():  
> shared.logConst.LOGOUT

Just FYI you can preserve formatting using the 'preformated text' button ( ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6e64968427b388cb0ecb70a76f11a9eccfa5703d.png) ) or enclose your textblock with three tilde characters either side ```:

```auto
def test():
	shared.logConst.LOGOUT

```
