[BUG] Custom Property on Label Persists after delete

Ignition V8.1.38. Perspective Designer. I have been able to replicate this, but not reliably.

I created a label object on my perspective display with 2 custom properties. During design, I had some trouble with a query binding on the first property where I forgot to change the return format to JSON. It was left to Auto and was returning a dataset. While trying to figure out why I wasn't able to see the proper data returned, I was playing around with the properties structure changing different components between array and object, but at one point left it set to value. When I realized my mistake, I changed the return type to JSON, and a whole new custom property created itself, basically duplicating itself. I deleted the original property from the object, and didn't think anything else about it.

The next day, I came in and checked my logs. I saw a slew of "ExecutionQueue Uncaught Throwable during execution." warnings in there. The log wasn't much help in identifying the problem component or binding.

java.lang.IllegalArgumentException: Malformed path: 0
at com.inductiveautomation.ignition.common.JsonPath.parse(JsonPath.java:242)
at com.inductiveautomation.perspective.gateway.property.PropertyTree.write(PropertyTree.java:547)
at com.inductiveautomation.perspective.gateway.model.ElementBindingHarness.writeToTarget(ElementBindingHarness.java:60)
at com.inductiveautomation.perspective.gateway.model.AbstractBindingHarness.valueReady(AbstractBindingHarness.java:379)
at com.inductiveautomation.perspective.gateway.model.AbstractBindingHarness.lambda$processValue$0(AbstractBindingHarness.java:248)
at com.inductiveautomation.ignition.common.util.TimedRunnable.run(TimedRunnable.java:21)
at com.inductiveautomation.ignition.common.util.ExecutionQueue$PollAndExecute.run(ExecutionQueue.java:239)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

I saw another post related to what I was seeing [IGN-11148]Locating script errors from Wrapper log - #8 by nminchin and did some more digging. I found it was related to this label. I deleted the object from my screen and recreated my label correctly, and the warnings stopped. Before I deleted it, I did copy the object and paste its code into a text editor.

[
  {
    "type": "ia.display.label",
    "version": 0,
    "props": {},
    "meta": {
      "name": "NextJobIDLabel"
    },
    "position": {
      "x": 565,
      "y": 112,
      "width": 200,
      "height": 32
    },
    "custom": {},
    "propConfig": {
      "custom.LastID": {
        "binding": {
          "type": "query",
          "config": {
            "returnFormat": "scalar",
            "queryPath": "GetNextJobID"
          }
        }
      },
      "custom.NextID": {
        "binding": {
          "type": "expr",
          "config": {
            "expression": "{this.custom.LastID} + 1\r\n"
          }
        }
      },
      "custom.0": {
        "binding": {
          "type": "query",
          "config": {
            "returnFormat": "json",
            "queryPath": "GetNextJobID"
          }
        }
      },
      "props.text": {
        "binding": {
          "type": "expr",
          "config": {
            "expression": "\"Next Job ID = \" + {this.custom.NextID}"
          }
        }
      }
    }
  }
]

Of note in there is the custom.0 property. That is the one that I deleted from the designer. There are no warnings in the designer about it, and I never would have found that without the text editor and a lot of trial and error. Custom.LastID is the proper custom property with the scalar return format, but custom.0 retained the JSON return format. If I paste the object back into my project, the logs now show the same error, but they tell me the project name and view that the warning is occurring in.

The easiest way for me to replicate something close to what I originally experienced is to create a custom property, bind it to a query with JSON return format (mine returns three values). It should change to the structure to an array with an object with 3 values. Change the Structure of that property to a value. Then open the binding dialog again. Change the return format to Scalar, apply the changes, change it back to JSON, apply the changes and the custom.0 property appears. If you delete it from the list in the designer, it disappears as does the warning, but pasting the code for the button reveals that the custom property is still there. In my first example it was custom.0, in my recreation it became custom['0'].

Not sure I fully understand the issue as you describe it, but sounds like it may be related to this:

1 Like

Potentially, but the property doesn't reappear, at least not in the designer. What concerns me is that the third property created itself. I didn't create it, or delete anything in the process. You can't name a property 0 if you try, it errors out immediately, which makes perfect sense. I have no doubt that I was doing something I probably shouldn't have been doing, but I am pretty good about unbinding things before I delete objects, mostly because it is a quick way to see if losing the binding affects anything pretty quickly.

You could paste that code into a project, and expect to see the errors that occur because you don't have the named query, but you should still be able to see that only two custom properties exist in the designer despite the code showing three. I am sure it is because it has the name "0" which is invalid, but I don't know where the 0 comes from. It created itself in my designer as a whole new property. I didn't delete it until after it had already been created. I wish I could recreate it exactly as it happened before.