Bad tag configurations breaking designer

Our Ignition server has cruft in the tag configurations for MQTT tags from some unknown old activity that is now preventing certain Designer actions.

We recently upgraded from 8.0.12 to 8.1, which is when this issue started happening.

I suspect that the tag database was already in a weird state behind-the-scenes before the upgrade, but it wasn’t causing any apparent issues then.

Now, after the upgrade, Designer will fail if I try to “Copy JSON” on many of the MQTT Engine’s tags. (See copy_json_failure.txt (6.7 KB)) I have narrowed it down to certain tags that cause this issue. If I try to “Edit Raw” on those tags, I get a similar error.

If I look at one of those tags via “Edit Tags”, the editor mostly works, but the historyTimeDeadbandUnits field is not shown and I cannot adjust it.

If I shut down the server and use sqlite to directly dump /var/lib/data/db/config.idb I can find TAGCONFIG entries like this on the bad tags:

INSERT INTO TAGCONFIG VALUES('c00c1105-77cc-41f4-8675-8a68044326fb',2,'3a450305-a2d2-485d-82b9-e7262eb434d6',replace('{\n "usr": {\n "accessRights": "Read_Write",\n "historyTimeDeadband": 0,\n "dataType": "Int8",\n "historyTimeDeadbandUnits": 0,\n "value": 0,\n "engUnit": "",\n "sampleMode": 0\n },\n "name": "HR6 INT64"\n}','\n',char(10)),5,'HR6 INT64');

I suspect the issue is the "historyTimeDeadbandUnits": 0 and "sampleMode": 0 values.

After a bit of fumbling experimentation, I fixed one tag by using “Edit Tag” in Designer to change the sampleMode to some other value then back. Once that was done, both sampleMode and historyTimeDeadbandUnits have string values and “Copy JSON” and “Edit Raw” now work.

But I have over 100 more tags like this, based on a quick grep of the config.idb dump. Finding each one and editing it twice is a tedious method to have to repeat that many times.

Can anyone suggest a better way to handle this?

Further investigation shows that MQTT Engine 4.0.6 is creating new tags under Sparkplug devices with the historyTimeDeadband, historyTimeDeadbandUnits, and sampleMode properties set to 0 on our server. After being created this way, they are still mostly usable and you can do “Copy JSON” in Designer without issue. However, if a script tries to reconfigure those tag properties to strings values using system.tag.configure in “merge” mode, it fails and after that point Designer will throw errors if you try to “Copy JSON”.

I have sent an email to CirrusLink directly asking for help on this root cause for the tag cruft, but I feel there is still a possible issue for IA to look at in that the Designer should be able to “Copy JSON” or “Edit Raw” on crufty tags without throwing errors.