# system.tag.readAll error executing gateway function exception

**URL:** <https://forum.inductiveautomation.com/t/system-tag-readall-error-executing-gateway-function-exception/37176>\
**Category:** Ignition\
**Tags:** ignition79, vision\
**Created:** [July 29, 2020, 4:53am UTC](https://forum.inductiveautomation.com/t/system-tag-readall-error-executing-gateway-function-exception/37176 "2020-07-29T04:53:05Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [July 29, 2020, 4:53am UTC](https://forum.inductiveautomation.com/t/system-tag-readall-error-executing-gateway-function-exception/37176/1 "2020-07-29T04:53:05Z")

</div>

v7.9.14

Same issue as in this post, but when calling readAll. The tagpaths I'm providing is the fullPath as taken from a browseTags that is run prior to the readAll call.

> [@tag.browseTags and error executing gateway function exception](http://forum.inductiveautomation.com/t/tag-browsetags-and-error-executing-gateway-function-exception/19274):
>
> I am attempting to execute the system.tag.browseTags function. My Ignition version is 7.9.7. My script is configured as a custom method on the root container of a window and is being called from an action performed script on a button. I am passing parameters to the script. Upon executing the script I am returning the following error Traceback (most recent call last): File "\<event:actionPerformed\>", line 6, in doLater File "\<custom-function searchForTags\>", line 10, in searchForTags at com.…

Instead of reading all 55000 tags that the browseTags function returns in one go, I tried also splitting it into various block sizes. I gradually decreased the block size as I noticed that it failed at a particular point each time. I got down to a block size of 5 where I thought I had narrowed it down to the block of 5 tags that it might have been failed on, then I reduced it to blocksize of 1, starting reading at the particular block, and it ran through and didn't fail on any of those 5 tags..

This is the code I have:

```auto
import java.lang.Exception
tags = system.tag.browseTags(recursive=1)

paths = [tag.fullPath for tag in tags]
opctag = [tag + '.OPCItemPath' for tag in paths]
opcItemPaths = []
blockSize = 5000
for i in range(len(opctag)/blockSize + 1):
	try:
		startIndex = i*blockSize
		endIndex = ((i*blockSize)+blockSize-1) if ((i*blockSize)+blockSize-1) < len(opctag) else len(opctag)
		tmp = system.tag.readAll(opctag[startIndex:endIndex])
		tmp = [tag.value for tag in tmp]
		opcItemPaths.extend(tmp)
	except Exception, e:
		print e
	except java.lang.Exception, e:
		print e

print len(opcItemPaths)

```

---

<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:** [July 29, 2020, 5:01am UTC](https://forum.inductiveautomation.com/t/system-tag-readall-error-executing-gateway-function-exception/37176/2 "2020-07-29T05:01:09Z")

</div>

hmm, adding in `tagType = 'OPC'` into the arguments fixed the issue. I should have had that in there previously, but still interested in why this would cause it to cause an exception? Shouldn’t this just produce a lot of bad quality returns?
