# Illegal Character on addTag()

**URL:** <https://forum.inductiveautomation.com/t/illegal-character-on-addtag/11995>\
**Category:** Ignition\
**Created:** [August 1, 2016, 4:23pm UTC](https://forum.inductiveautomation.com/t/illegal-character-on-addtag/11995 "2016-08-01T16:23:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Polynomial](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Polynomial](https://forum.inductiveautomation.com/u/Polynomial)\
**Post date:** [August 1, 2016, 4:23pm UTC](https://forum.inductiveautomation.com/t/illegal-character-on-addtag/11995/1 "2016-08-01T16:23:22Z")

</div>

This code keeps throwing an “illegal character” exception on the addTag() line. The provider name is correct and the Advantech UDT is in the [KRN2.0] provider. Can anyone assist?

`ip = event.source.parent.getComponent('IPField').text
conn_name = event.source.parent.getComponent('NameField').text
try:
	system.device.addDevice("modbus", conn_name, hostname=ip)
except:
	system.gui.warningBox("Device connection already exists!")
system.tag.addTag(parentPath="[KRN2.0]AdvantechDiagnostics", name=conn_name, tagType="UDT_INST", attributes={"UDTParentType":"Advantech"})
system.nav.closeParentWindow(event)`

[code]Traceback (most recent call last):

File “event:actionPerformed”, line 7, in

com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character ‘[’ (Line 1 , Char 1)

```
caused by GatewayException: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character '[' (Line 1 , Char 1)
caused by UncheckedExecutionException: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character '[' (Line 1 , Char 1)

```

Ignition v7.7.5 (b2015071516)  
Java: Oracle Corporation 1.8.0\_91  
[/code]

---

<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:** [August 1, 2016, 5:05pm UTC](https://forum.inductiveautomation.com/t/illegal-character-on-addtag/11995/2 "2016-08-01T17:05:10Z")

</div>

This is a known issue; the tag provider should not allow periods in the name.
