Troubleshooting
SQLite historian stores data but the chart stays empty
Short answer
Rows in SQLite prove the historian write path works; an empty table and chart point at retrieval. Set the SQLite JDBC driver's Driver Type from GENERIC to SQLITE in the Gateway configuration, then confirm a fresh sample whose timestamp converts to its real sample time.
On this page
When the SQLite database fills with historian rows but the table and chart stay empty, the write path is healthy and the retrieval path is not. In the reported case, an Ignition 8.0.16 historian stored a sample every 30 seconds into SQLite, the rows were visible in a database browser, and neither the table nor the chart returned anything. The cause was not SQLite and not the tag: the SQLite JDBC driver's Driver Type was set to GENERIC instead of SQLITE, so history queries never came back with usable data. Set the driver type, then confirm a fresh sample whose timestamp converts to its true sample time. That one change restored both views.
What an empty chart proves #
Treat the display and the database as two separate checkpoints. A visible database row proves the tag-to-historian write path ran; it proves nothing about retrieval. Because both the table and the chart failed at once while the database kept receiving data, start with the retrieval path rather than rebuilding tags or changing the storage rate.
- No rows in SQLite: the write path is failing. Check the tag's history settings and the database connection first; the historian trend empty: PLC tag collection troubleshooting article covers that branch.
- Rows exist but both the table and the chart are empty: storage works and retrieval, timestamp interpretation or driver classification is failing. Check the stored timestamps, then the driver.
- One view works and the other does not: the fault sits in the failing component's own binding or requested time range.
A tag-binding fault looks different from this pattern; if your pen is bound to a tag instead of the historian connection, the why an Easy Chart pen shows no historian data article walks through that case instead.
Open the database file first #
Confirm the write path with the database itself before touching any configuration.
- Open the historian-created file with a database browser. In the reported case the historian had created the table sqlt_data_1_2020_10; use whatever current-month table your own installation shows.
- Wait through one storage interval so a genuinely new sample is due.
- Refresh the database view rather than trusting rows loaded earlier.
- Confirm a new record appears and read its t_stamp column.
If no new record appears, stop here and fix the write path. If one appears, the split between "the value is in SQLite" and "the chart has no data" is real and expected: the database browser shows raw rows without applying the time-range filter a chart uses, so both statements can be true at the same time.
Convert the stored t_stamp before judging it #
The historian's t_stamp column holds epoch milliseconds, so read it through a conversion before deciding it is wrong. A negative number is not a defect on its own; SQLite accepts signed integers without complaint. The defect is a value that converts to 1969 or another time far from when the sample was actually written. Convert the newest value and compare it to the clock time the sample should carry. The page on calculating Ignition epoch milliseconds from date tags shows the conversion arithmetic in detail if you want to do it by hand.
Example: converting a negative t_stamp from sqlt_data_1_2020_10 #
Inputs, from the reported case: the newest row's t_stamp read -519269173 ms, and the platform's date conversion ran through the scripting call system.date.fromMillis(-519269173L), which printed Thu Dec 25 18:45:30 EST 1969.
The rule: epoch milliseconds count from 1970-01-01 00:00:00 UTC, and a negative value counts backwards from that instant. Divide by 1000 to get seconds, then by 86400 to get days.
- 519269173 ms ÷ 1000 ms/s = 519269.173 s
- 519269.173 s ÷ 86400 s/day = 6 days with a remainder of 869.173 s
- 869.173 s ÷ 60 s/min = 14 min 29.173 s
The value therefore sits 6 days, 14 minutes and 29.173 seconds before 1970-01-01 00:00:00 UTC, which is 1969-12-25 23:45:30.827 UTC, or 18:45:30 in UTC−5 (EST). That matches the conversion output exactly, which confirms the arithmetic rather than a display quirk.
Result: the sample claims to come from December 1969. Decision: any chart requesting current history excludes that row by its start and end times, so the timestamps are being written wrong and the driver classification is the first thing to correct. Do not widen the chart range back to 1969 to make the rows appear.
Set the SQLite driver type to SQLITE #
The Databases > Drivers page of the Gateway configuration is where the product documentation has you add and edit JDBC drivers, and Driver Type is the setting that tells the platform which database family it is talking to. In one deployment, an upgrade left the SQLite driver classified as GENERIC where a new installation creates it as SQLITE, and that state stored rows fine while every bounded history query came back empty. The connection target is still SQLite; only the platform's internal classification is wrong, which is why writes survive and reads do not.
- Open the Gateway webpage and go to the Config section, then Databases > Drivers.
- Edit the driver named SQLite.
- Read Driver Type. In the reported case it read GENERIC.
- Change it to SQLITE and save the driver.
- Leave the historian tag and its storage settings untouched for the first retest, so the change that restores retrieval is identifiable.
The step-by-step guide to connecting Ignition SCADA to SQLite via JDBC driver covers the connection side of this setup if you are building it from scratch. Recreating the chart, extending the time window, or editing database rows may make individual records visible, but none of them corrects the driver's behavior.
Verify the full path with one new sample #
Work through the layers in order so a cached display or one old malformed row cannot produce a false pass.
- Tag layer: note the live tag value just before the next storage event.
- Database layer: after one storage interval, refresh the view, confirm the new row exists, and convert its t_stamp to confirm it represents the sample time rather than 1969.
- Driver layer: reopen the driver editor and confirm Driver Type still reads SQLITE after saving.
- Display layer: request a table and a chart range containing the new timestamp, and confirm the table lists the sample and the chart plots it at the matching time.
If the new timestamps are correct but one component stays empty, move to that component's own history binding and requested date range. If both still stay empty, check which database connection they point at: a correctly classified driver has no effect on components bound to a different connection, and the Databases > Connections page lists every connection and its driver.
The decision #
- Rows missing from SQLite: the write path is at fault; check tag history configuration and the connection before looking at the chart.
- Rows present, timestamps convert to their sample times, views still empty: check each component's binding and time range, and the connection they use.
- Rows present, the newest t_stamp converts to 1969, and Driver Type reads GENERIC: set it to SQLITE, retest with a fresh sample, and leave the stored rows alone.
- Views return after the change: close the case with the four-layer verification above so future upgrades inherit a known-good configuration.
Questions asked
Why does the SQLite database have rows but the chart stays empty?
The write path and the retrieval path are separate. A row in the file proves the tag reached the database; it says nothing about whether a bounded history query can read it back. In the reported case the SQLite JDBC driver's classification was wrong, so rows landed while history queries returned nothing. Correct the driver type, then retest with a new sample instead of an old row.
Is a negative t_stamp in the historian table a fault?
Not by itself. SQLite stores signed integers, so a negative value is legal. The fault appears only when you convert the value and it resolves to 1969 or another time far from the actual sample time. Convert first, then judge: a timestamp that matches the sample is fine, and one that lands decades back means the historian's timestamp handling, not the row, is broken.
Why didn't widening the chart time range bring the data back?
A wider range only moves the query boundaries; it does not change how the database driver classifies SQLite or interprets its timestamps. Stretching the range back far enough to catch rows written with bad timestamps can make individual records appear, but every future sample stays broken until the driver classification is corrected.
Should I correct the stored timestamps by hand?
No. Rewriting historian-managed rows hides the configuration fault and leaves every following sample exposed to the same problem. Fix the driver classification, leave the tag and its storage settings unchanged for the first retest, and verify with a sample written after the change so you know the whole path works.