After upgrading tags retired and can't find historical data

I updated to 7.7.1 from from 7.6.x. Most of my historical trends won’t show data from prior to the update. I looked at sqlth_te and it appears most all tags were retired after the upgrade. The data is being read from the new 'un’retired tags but the easy chart is not spanning back to the retired tags. This is not happening for all tags but most tags. All the tags are found in a UDT.

Jeffrey DeCicco

Hi Jdecicco,

Where you able to fix your problem?
I had exactly the same issue a couple of days ago after migrating to 7.7.1 and fixed it by doing this:

We saw that :

  • there were added one new record to the sqlth_drv table in the database. (only id 1 was available before the upgrade, and now there was another record with id=2)

  • there were added new records to the table sqlth_scinfo in the database.

To solve this issue we did the following:

  1. Remove the newly added items in sqlth_scinfo.
  2. Change the drvid of our recods in this table from id 1 , to 2.
    like this:

please be aware that this maybe does not help in your situation and even breaks stuff and is depending on your specific setup. So be careful.

Hi,

This has been a common issue, and I think we have it sorted out for 7.7.2. We really should probably write a knowledgebase article about it.

The suggestion above, about deleting the scinfo entries and everything, is something, but not what I’d suggest.

Here’s what happened:

  • Pre-7.7, tag history was stored identified by the gateway name. This is bad if there are multiple tag providers, as you have no way to distinguish them. This means that you can’t have the same tag path in two providers and successfully store history.
  • In 7.7, we added a “providerName” column to sqlth_drv to make this identification.
    As a result…
  1. New entries were created in sqlth_scinfo, which links driver to scan class.
  2. New entries were created in sqlth_te, which links tags to scan class (and thereby drivers).

That’s all fine. When querying history, for backwards compatibility, the system is supposed to look at tag paths for the specific provider, as well as older paths for non-specific providers. There is not supposed to be an issue in the tag system for multiple ids for a given path (the system has always expected that).

The problem appears to be in the way that the system calculates data validity, or “staleness”. By default, the system looks at a record of when the scan classes were executing (sqlth_sce), and marks the data valid or not. The goal of this system is to distinguish between periods of time when the system was not running for times when the data simply didn’t change. It appears that the system was using the wrong entries for the tags, and so the data previous to the upgraded was being marked as “stale”.

The most direct solution that we’ve been using is to update the sqlth_sce table to set the “start_time” of the rows for the new, more specific, driver ids to 0, so that it covers “all time”. Since this table is really used as a secondary check when querying, I usually don’t feel too bad about just resetting the values to cover a large range.

The important note about this issue is that while terribly annoying, no actual data has been lost. The issue is purely in the interpretation of the data when querying.

Changing the sqlth_drv tables as suggested above is relatively harmless if you only have one tag provider. If you have multiple, updating the sqlth_sce table is better.

As a final note, not exactly related to this but worth remembering, is that the most crucial part of the history tables is the sqlth_te table. If you lose that, there is no way to make sense of the data, so be careful.

Regards,

I seem to be having the same issue with this. I upgraded a project from 7.7.1 to 7.7.2 and we are about to move to 7.7.3 so I need to find the fix for this issue so I don’t run into the problem again with the new upgrade.

As said in the above posts All data is still in the database but when I try to view the data on a historical easy chart it only shows data starting from the update. All of the data from before the update does not show which is a problem since the easy chart is used to pull the historical data for processing.

I have tried to update all the sqlth_sce "start_time"s to 0 as Colby suggested but that had no effect. Any other thoughts on how to fix this issue?

Blefe001, the current release is 7.7.4 (as of today). Please skip the older release and update to the current 7.7.4 release. That should fix your issue.

Anna I have this issue as well, I am on 7.7.4 upgraded from 7.6.4.

Do you have a fix please?

thx
Hazey