# New error opening windows?

**URL:** <https://forum.inductiveautomation.com/t/new-error-opening-windows/34073>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 21, 2020, 1:29pm UTC](https://forum.inductiveautomation.com/t/new-error-opening-windows/34073 "2020-04-21T13:29:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 21, 2020, 1:29pm UTC](https://forum.inductiveautomation.com/t/new-error-opening-windows/34073/1 "2020-04-21T13:29:14Z")

</div>

I recently merged a Vision project with a Perspective project so they can share scripting modules. Now as of tihs morning after making this push, oddly enough the navigation in my Vision project is acting buggy - sometimes the window does open at all ie I get blank grey screen like this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4f10f62c752f7f24cdb1b42cf4628a3eef1729ee.png)

but it doens’t always happen.

Here’s the full error

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 16, in swapWindow
	at java.base/java.util.Timer.sched(Unknown Source)
	at java.base/java.util.Timer.schedule(Unknown Source)
	at com.inductiveautomation.ignition.common.expressions.functions.AbstractPollingFunction.startTask(AbstractPollingFunction.java:65)
	at com.inductiveautomation.ignition.common.expressions.functions.AbstractPollingFunction.startup(AbstractPollingFunction.java:52)
	at com.inductiveautomation.ignition.common.expressions.FunctionExpression.startup(FunctionExpression.java:63)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.ignition.common.expressions.FunctionExpression.startup(FunctionExpression.java:62)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.ignition.common.expressions.FunctionExpression.startup(FunctionExpression.java:62)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.startup(ExpressionPropertyAdapter.java:110)
	at com.inductiveautomation.factorypmi.application.binding.DefaultInteractionController.startupBindings(DefaultInteractionController.java:355)
	at com.inductiveautomation.factorypmi.application.FPMIWindow.startup(FPMIWindow.java:344)
	at com.inductiveautomation.factorypmi.application.VisionDesktop$RuntimeWindowOpener.openWindow(VisionDesktop.java:554)
	at com.inductiveautomation.factorypmi.application.VisionDesktop.openWindow(VisionDesktop.java:197)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.lambda$openWindowImpl$5(NavUtilities.java:393)
	at com.inductiveautomation.factorypmi.application.script.builtin.WindowUtilities.doGUIAction(WindowUtilities.java:815)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindowImpl(NavUtilities.java:336)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindow(NavUtilities.java:326)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilitiesDispatcher.openWindow(NavUtilitiesDispatcher.java:143)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.lang.IllegalStateException: java.lang.IllegalStateException: Timer already cancelled.

	at org.python.core.Py.JavaError(Py.java:552)
	at org.python.core.Py.JavaError(Py.java:543)
	at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:190)
	at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:518)
	at org.python.core.PyObject. __call__ (PyObject.java:480)
	at org.python.core.PyObject. __call__ (PyObject.java:484)
	at org.python.pycode._pyx116.swapWindow$1(<event:actionPerformed>:16)
	at org.python.pycode._pyx116.call_function(<event:actionPerformed>)
	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:788)
	at com.inductiveautomation.factorypmi.application.script.builtin.ClientSystemUtilities.lambda$invokeLater$1(ClientSystemUtilities.java:276)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Timer already cancelled.
	at java.base/java.util.Timer.sched(Unknown Source)
	at java.base/java.util.Timer.schedule(Unknown Source)
	at com.inductiveautomation.ignition.common.expressions.functions.AbstractPollingFunction.startTask(AbstractPollingFunction.java:65)
	at com.inductiveautomation.ignition.common.expressions.functions.AbstractPollingFunction.startup(AbstractPollingFunction.java:52)
	at com.inductiveautomation.ignition.common.expressions.FunctionExpression.startup(FunctionExpression.java:63)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.ignition.common.expressions.FunctionExpression.startup(FunctionExpression.java:62)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.ignition.common.expressions.FunctionExpression.startup(FunctionExpression.java:62)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.ignition.common.expressions.AbstractExpression.startup(AbstractExpression.java:61)
	at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.startup(ExpressionPropertyAdapter.java:110)
	at com.inductiveautomation.factorypmi.application.binding.DefaultInteractionController.startupBindings(DefaultInteractionController.java:355)
	at com.inductiveautomation.factorypmi.application.FPMIWindow.startup(FPMIWindow.java:344)
	at com.inductiveautomation.factorypmi.application.VisionDesktop$RuntimeWindowOpener.openWindow(VisionDesktop.java:554)
	at com.inductiveautomation.factorypmi.application.VisionDesktop.openWindow(VisionDesktop.java:197)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.lambda$openWindowImpl$5(NavUtilities.java:393)
	at com.inductiveautomation.factorypmi.application.script.builtin.WindowUtilities.doGUIAction(WindowUtilities.java:815)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindowImpl(NavUtilities.java:336)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindow(NavUtilities.java:326)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilitiesDispatcher.openWindow(NavUtilitiesDispatcher.java:143)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:188)
	... 26 more

Ignition v8.0.6 (b2019111216)
Java: Azul Systems, Inc. 11.0.4

```

and here’s the logic on the navigation buttons that never caused an issue before

```auto
def swapWindow(event = event):
	import system
	for window in system.gui.getOpenedWindows():
		print window.getPath()
		if window.getPath() == '_Header':
			print 'Header found'
		elif window.getPath() == '_navLeft':
			print 'Found navLeft'
		else:
			system.nav.closeWindow(window.getPath())
	system.nav.openWindow(event.source.outWindowName)

system.tag.write("[Client]PopupLoading", 1)
system.util.invokeLater(swapWindow)

```

Any idea whats going on?

---

<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:** [April 21, 2020, 3:51pm UTC](https://forum.inductiveautomation.com/t/new-error-opening-windows/34073/2 "2020-04-21T15:51:30Z")

</div>

Hmm, my best guess is there’s a race happening where the window hasn’t properly shut down from the `closeWindow` call before the `openWindow` call happens; that shouldn’t be possible, and none of that code should have changed anytime recently, but that’s my best guess. If you, just for testing, put a little delay before the `openWindow` call (say `time.sleep(0.5)` or something) do you get the same behavior?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 21, 2020, 4:01pm UTC](https://forum.inductiveautomation.com/t/new-error-opening-windows/34073/3 "2020-04-21T16:01:35Z")

</div>

I restored my gateway to how we were at midnight, with my vision and perspective project being separate, and now it’s not happening as much though I did just get a report it happening once more.

I think you’re right in that its some race condition. Overall though all my Vision clients are being very slow now and freezing beyond being usable and I’m not sure why, I think they’re related in that its running slower and now the race condition which use to execute fine is now having issues.

I’m seeing every client is pushing it to the limit with the memory use  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7547abd6c183f40e411d994245052a650e88d466.png)

I’m confused why its out of 256 too as I set the vision project properites to this  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5b57a39ce66896fd3d2d0e53b315714a14b05d18.png)

Should I call in?

---

<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:** [April 21, 2020, 4:03pm UTC](https://forum.inductiveautomation.com/t/new-error-opening-windows/34073/4 "2020-04-21T16:03:00Z")

</div>

Yeah, that’s probably best; I’m not sure what’s happening here.
