Error Running Query: Requested timestamp is previous to an already requested time

I’ve got a sparkline inside a template that keeps throwing these errors, and I’m having trouble understanding what it’s trying to say:

Exception: Error running query:
TagHistory(paths=[histprov:default:/prov:default:/tag:BOP/TT7700/Status/Value], start=Tue Mar 02 18:00:24 EST 2021, end=Tue Mar 02 18:10:24 EST 2021, flags=0)@1000ms
On: Basic.Basic.Sparkline Chart.data
	caused by GatewayException: Requested timestamp is previous to an already requested time. All requests must go forward in time. Received '-1' after '0'
	caused by IllegalArgumentException: Requested timestamp is previous to an already requested time. All requests must go forward in time. Received '-1' after '0'

Ignition v(Dev Version)
Java: Azul Systems, Inc. 11.0.9

It kinda sounds like my start/end times are swapped, but as you can see in the query the start time is before the end time.

What’s also weird is that the sparklines will work fine for a while before eventually starting with these errors, and then magically go back to working without any obvious cause/effect.

Any clue?
This gateway is still on an older 8.1 nightly ( b2021010502).

@bmusson did you ever find anything on this besides just upgrading the gateway?

Nope, never found any specific fix for this issue.
The problem went away once we moved the project to the customer’s hardware so I kind of forgot about it until now.

I’ve had a similar issue before and it had to do with how the bindings were working when the window opened. I think I had the start and stop dates bound to tag values but it took a little while for the tag values to return as ‘good’. My solution was to bind the tag values to custom properties and check that the tag values were good with a try() expression, if not then I returned some default dates.

That specific example doesn’t sound like what you are seeing, but perhaps it’s caused by some kind of binding race condition somewhere?

Fair enough. We are only seeing it on our internal development server which is 8.1.5 so I may just upgrade to see if the issue goes away. Same exact error that you were seeing…

Yeah this comes and goes while the window is open. Kind of annoying to say the least. :smiley:

Any update on this? I'm running into this same problem. My query was working fine for a day and out of no where started throwing these errors. The errors only appear in designer, my client window isn't reporting any issues.

Ignition v8.1.22 (b2022110109)
Java: Azul Systems, Inc. 11.0.16.1