# NullPointerException with system.tag.writeAll

**URL:** <https://forum.inductiveautomation.com/t/nullpointerexception-with-system-tag-writeall/10928>\
**Category:** Ignition\
**Created:** [December 17, 2015, 9:10am UTC](https://forum.inductiveautomation.com/t/nullpointerexception-with-system-tag-writeall/10928 "2015-12-17T09:10:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [December 17, 2015, 9:10am UTC](https://forum.inductiveautomation.com/t/nullpointerexception-with-system-tag-writeall/10928/1 "2015-12-17T09:10:35Z")

</div>

I always get the same error when trying to simultaneously write to 163 variables using the function system.tag.writeAll, below you can see the code and the error report. Any ideas?

tags1 = ["" for x in range(163)]  
tags2 = ["" for x in range(163)]

values1 = [0 for x in range(163)]

for x in range(163):

```
if x<160:
	
	tags1[x]="VALDEMORO/Astro/CM "+str(x+1)+"/Sunrise.Enabled"
	tags2[x]="VALDEMORO/Astro/CM "+str(x+1)+"/Sunset.Enabled"

else:

	tags1[x]="VALDEMORO/Astro/CM "+str(x+40)+"/Sunrise.Enabled"
	tags2[x]="VALDEMORO/Astro/CM "+str(x+40)+"/Sunset.Enabled"

```

system.tag.writeAll(tags1,values1)  
system.tag.writeAll(tags2,values1)

Traceback (most recent call last):  
File “event:actionPerformed”, line 21, in   
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.newGatewayException(GatewayInterface.java:328)

```
at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:302)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:259)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.invoke(GatewayInterface.java:800)

at com.inductiveautomation.ignition.client.script.ClientTagUtilities.writeToTagsImpl(ClientTagUtilities.java:366)

at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.writeAll(AbstractTagUtilities.java:298)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

```

com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: Error executing gateway function.

```
at org.python.core.Py.JavaError(Py.java:495)
at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.writeAll(AbstractTagUtilities.java:300)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:186)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:428)
at org.python.core.PyObject. __call__ (PyObject.java:404)
at org.python.core.PyObject. __call__ (PyObject.java:408)
at org.python.pycode._pyx32.f$0(<event:actionPerformed>:21)
at org.python.pycode._pyx32.call_function(<event:actionPerformed>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:624)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:168)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:265)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at com.sun.proxy.$Proxy24.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

```

Caused by: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: Error executing gateway function.  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.newGatewayException(GatewayInterface.java:328)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:302)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:259)  
at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.invoke(GatewayInterface.java:800)  
at com.inductiveautomation.ignition.client.script.ClientTagUtilities.writeToTagsImpl(ClientTagUtilities.java:366)  
at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.writeAll(AbstractTagUtilities.java:298)  
… 54 more  
Caused by: java.lang.NullPointerException  
at com.inductiveautomation.ignition.gateway.sqltags.execution.tags.AbstractExecutableTag.getContext(AbstractExecutableTag.java:122)  
at com.inductiveautomation.ignition.gateway.sqltags.execution.tags.AbstractExecutableTag.internalPropertyWrite(AbstractExecutableTag.java:700)  
at com.inductiveautomation.ignition.gateway.sqltags.execution.tags.AbstractExecutableTag.write(AbstractExecutableTag.java:662)  
at com.inductiveautomation.ignition.gateway.sqltags.providers.AbstractStoreBasedTagProvider.writeToLocalTags(AbstractStoreBasedTagProvider.java:1556)  
at com.inductiveautomation.ignition.gateway.sqltags.providers.AbstractStoreBasedTagProvider.internalWriteValue(AbstractStoreBasedTagProvider.java:1511)  
at com.inductiveautomation.ignition.gateway.sqltags.providers.AbstractStoreBasedTagProvider.write(AbstractStoreBasedTagProvider.java:1495)  
at com.inductiveautomation.ignition.gateway.sqltags.providers.RedundantProviderWrapper.write(RedundantProviderWrapper.java:158)  
at com.inductiveautomation.ignition.gateway.sqltags.SQLTagsManagerImpl.write(SQLTagsManagerImpl.java:667)  
at com.inductiveautomation.ignition.gateway.project.ProjectSettingsCache$ProjectDefaultTagManagerFacade.write(ProjectSettingsCache.java:581)  
at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.SQLTags.writeToTagsBulk(SQLTags.java:400)  
at sun.reflect.GeneratedMethodAccessor68.invoke(null)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:483)  
at com.inductiveautomation.ignition.gateway.servlets.gateway.AbstractGatewayFunction.invoke(AbstractGatewayFunction.java:177)  
at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:343)  
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)  
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)  
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)  
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)  
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)  
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)  
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)  
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)  
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)  
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)  
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)  
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)  
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)  
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)  
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)  
at org.eclipse.jetty.server.Server.handle(Server.java:497)  
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)  
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)  
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)  
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)  
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)  
at java.lang.Thread.run(Thread.java:745)

Ignition v7.7.4 (b2015033012)  
Java: Oracle Corporation 1.8.0\_25

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [December 22, 2015, 12:52am UTC](https://forum.inductiveautomation.com/t/nullpointerexception-with-system-tag-writeall/10928/2 "2015-12-22T00:52:59Z")

</div>

Hi,

I can’t find the exact ticket right now, but I’m fairly certain this has been fixed. Could you try upgrading to 7.7.6 and see if you still have the problem? I’m pretty sure it was a problem trying to write to a disabled tag. I tried it it quickly in 7.8 and did not hit an error.

Regards,
