Importing new tags to overwrite old ones, without collision policy error?

I get this error when importing a set of tags that have been mass-modified externally:

Bad_Failure(“Tag ‘Customer/…/MyTag’ already exists, and ‘abort’ collision policy has been specified”)

I know you can script them one at a time through system.tag.configure, but I already have the json ready to import and I just want to do it through the GUI, particularly since this is only the first of several mass-overwrites that I’ll need to make. How can I adjust this collision policy?

1 Like

The right side of the tag import dialog should have a dropdown to set the collision policy:

1 Like

I can’t believe I didn’t even notice that. It’s been a long day. Thank you!

1 Like

Just noticed that dropdown myself. The last choice is MergeOverwrite, but this is not detailed in the manual. Can you explain what this option does please?
Thanks

MergeOverwrite means keep the existing values in the property set, unless there’s a conflict, in which case it will prefer the value from the new property set. This is different from Overwrite, which replaces outright whatever was already set in the tag’s configuration.

For an export/import, it shouldn’t matter - the export already has “everything” (that’s not already a default value) defined, meaning it won’t matter. MergeOverwrite is used internally by the editTags function, since you generally don’t call that function with an entire tag configuration, just a few changes to apply to an existing tag.

2 Likes

FWIW, this is what it looks like today (2022) using release 8.1.19 using the Tag Browser’s Import Tags>Interactive utility.

Just a note, the first time I executed this, I clicked OK and got an import error. It worked the second time I tried, when I first clicked Apply before clicking OK.

java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source)
at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source)
at java.base/java.util.Objects.checkIndex(Unknown Source)
at java.base/java.util.ArrayList.get(Unknown Source)
at com.inductiveautomation.ignition.gateway.tags.TagCreator$Session.handleCommit(TagCreator.kt:623)
at com.inductiveautomation.ignition.gateway.tags.TagCreator$Session.modify(TagCreator.kt:434)
at com.inductiveautomation.ignition.gateway.tags.TagCreator$modify$1.invoke(TagCreator.kt:123)
at com.inductiveautomation.ignition.gateway.tags.TagCreator$modify$1.invoke(TagCreator.kt:109)
at com.inductiveautomation.ignition.gateway.tags.TagCreator.sessionMdc(TagCreator.kt:134)
at com.inductiveautomation.ignition.gateway.tags.TagCreator.modify(TagCreator.kt:109)
at com.inductiveautomation.ignition.gateway.tags.TagProviderImpl.lambda$creatorModify$23(TagProviderImpl.java:1012)
at com.inductiveautomation.ignition.gateway.tags.TagProviderImpl.lambda$exec$5(TagProviderImpl.java:462)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

@PGriffith :

Curiously, after this error, the Import Tags option in the Tag Browser’s right-click context menu was no longer enabled; only Export Tags remained enabled. After restarting the Designer, the import option once again was enabled.

Again, then by first clicking “Apply” and then “OK” the UDT imported successfully overwriting the existing definition.

Do you by any chance have a backup/tag export before the import you attempted, as well as a copy of the actual import you were attempting? That would be a huge help to isolate exactly what’s going wrong.

Unfortunately I was not that methodical. I could send you a copy of the UDT definition that was in place, and the new version of that UDT that was imported.

One tiny nuance: the JSON-filename did not match the name of the UDT that was being imported. I had manually edited the “name”: “flexSortBarcodes” attribute in the JSON file (to over-write that definition).

Sure, anything would help. So you had N instances of this tag, then imported a new definition? Or imported to overwrite the instances?

correct, N instances running the old definition; then import the new definition to overwrite the existing def

1 Like