---
title: "Data Is Stale, Frozen, or Has Gaps"
description: "Live values look frozen, trends are flat or gappy, or history isn’t recording"
source_url: https://ai-ops.com/docs/troubleshoot/stale-data
---

# Data Is Stale, Frozen, or Has Gaps

This article covers the family of "my data isn't moving" symptoms:

- A tag's **live value looks frozen** and never changes
- **Trends** show flat lines, big gaps, or far fewer points than expected
- **History isn't recording** for a tag, device, or the whole system
- A **model complains** that its input data is old or stale

These symptoms fall into two very different buckets, and the fix depends on which one you have:

| Symptom | Likely bucket | Where to look |
|---------|---------------|---------------|
| Live value frozen, or trends completely empty | **Collection stopped** upstream (device/tag not scanning) | [Collection stopped](#collection-has-stopped-nothing-is-being-recorded) |
| Live value updates fine, but trends are flat or sparse | **Historization is dropping points** (compression/range) | [Tag is not historizing properly](#tag-is-not-historizing-properly) |

> [!TIP] Watch the live value first
> The single fastest diagnostic is: does the **live value** on the tag's Overview tab change over time? If it never moves, collection has stopped upstream. If it moves but Trends stay flat, the problem is compression, not collection.

## Collection Has Stopped: Nothing Is Being Recorded

If the live value is frozen and Trends are empty, the tag isn't being collected at all. History can only record what collection produces, so fix collection first.

Work outward from the tag:

1. **Is the tag failed?** A failed tag isn't producing values. Check its error code and error message. See [Bad, Missing, or Frozen Tag Values](https://ai-ops.com/docs/troubleshoot/tag-values.md).
2. **Is the parent device failed or stopped?** If the device is down, every tag on it stops. A tag whose device is stopped shows an info banner telling you the device is stopped and the tag won't update until it is enabled and running. See [Troubleshoot a Connection](https://ai-ops.com/docs/troubleshoot/connection.md).
3. **Is the value a calculated or mapped value?** An expression or value-mapping failure freezes the output even when the source tags are fine. See [Expression & Value-Mapping Errors](https://ai-ops.com/docs/troubleshoot/expressions-and-mapping.md).

The three diagnostic fields (error code, error message, error detail), the status/quality legend, and the auto-clear behavior are all documented once in [Reading Status, Quality & Errors](https://ai-ops.com/docs/troubleshoot/reading-status-and-errors.md). Start there if you need to interpret a code or status color.

### History-Write Failure Codes

A tag can be collected successfully and still fail to *write* to history. In that case the live value is current, but a gap appears in Trends for that period. These are the codes that signal a history-write failure specifically:

| Entity | Code | Name | What it means |
|--------|------|------|---------------|
| Tag | 200 | **Failed To Historize** | The tag's value could not be written to history. The tag is still being scanned and its live value is available, but historical data has a gap for this period. |
| Device | 13 | **Failed To Write To Long Term History** | Tag values could not be written to the time-series database. The device is still scanning and live values are available, but historical data will have a gap. |
| Device | 12 | **Failed To Write To Model History** | Tag values could not be written to the model (in-memory / AI) history store. The device is still scanning, but model predictions may be affected. |

> [!NOTE] These usually self-heal
> History-write failures typically clear on the next successful scan and often point at a transient storage or resource condition. If code 200 or device code 13 persists, check disk usage and service health in [Service Health & Resource Alarms](https://ai-ops.com/docs/troubleshoot/services-and-alarms.md).

### Tag is not historizing properly

If a tag's live value is updating but Trends show flat lines or far fewer recorded points than expected, the cause is almost always a mismatch between the tag's **Range Min / Max** and the compression settings — **not** a collection problem.

Koios uses **Swinging Door Trending (SDT)** to compress historical data. SDT maintains a tolerance band (a "door") around the last recorded point and discards new values that fall inside the band, because the trend line already represents them. The width of that band is calculated as a **percentage of the tag's configured range**, not of the actual value.

The default tag range is **0–100**. If a tag only moves between **0 and 1** but its range is left at 0–100, the tolerance band is wider than the entire signal, so almost nothing passes the filter. The result is silent data loss: the live value updates, but Trends look flat or empty.

**How to fix it:**

1. Set the tag's **Range Min** and **Range Max** to match the actual expected value range (for example **0–1**, not 0–100).
2. Review the global **Compression Deviation**. A deviation of **1–2%** is a good starting point for most process data.
3. If only this tag needs special treatment, enable **Override global compression settings** on the tag's Configuration tab and set a tighter deviation, or disable compression for this tag alone.
4. To disable compression globally, turn off the **Compression Enabled** toggle on the Retention page.

> [!WARNING] Check the range on every tag
> The default range of 0–100 causes silent data loss for tags with narrow value bands (0–1, 4–20 mA, 0.0–5.0). This is the most common cause of missing historical data. The actual settings and a full explanation of how SDT interacts with the tag range live in [Tag Range and Compression](https://ai-ops.com/docs/system/retention.md#tag-range-and-compression).

## Trends Are Flat or Gappy

If Trends look wrong but the live value is fine, run through these in order:

- **Flat line with almost no points** → compression is discarding everything. See [Tag is not historizing properly](#tag-is-not-historizing-properly).
- **A gap for a specific time window** → collection or history-write stopped during that window. Check the tag/device error history and the [history-write failure codes](#history-write-failure-codes) above.
- **Older data disappeared entirely** → retention cleanup deleted it. History older than the configured **History Database Retention** period is permanently removed. Review the period in [Data Retention](https://ai-ops.com/docs/system/retention.md).
- **Everything stopped at the same moment across many tags** → a device outage or a service/resource problem. See [Service Health & Resource Alarms](https://ai-ops.com/docs/troubleshoot/services-and-alarms.md).

> [!WARNING] Reducing retention deletes data
> When you reduce a retention period, existing data older than the new limit is permanently deleted. This is a common cause of "old trends vanished" reports. See [Data Retention](https://ai-ops.com/docs/system/retention.md).

## A Model Complains About Old or Stale Data

Models read from history, so historization problems surface as binding errors. Check the model's **Bindings** tab for these two codes:

| Code | Name | What it means | What to do |
|------|------|---------------|------------|
| 1 | **Not Enough Historical Depth** | There isn't enough historical data to fill the model's input window. Common right after a model is first enabled or a device is restarted. | Wait for enough scan cycles to accumulate the required depth. The error detail shows how much more data is needed. |
| 2 | **Stale History Data** | The most recent data point is too old — the tag's device has stopped collecting, or the data is arriving with significant delay. | Fix collection on the bound tag's device, then the binding recovers automatically. |

> [!NOTE] New models need time to warm up
> When you first enable a model, input bindings show **Not Enough Historical Depth** until the device has collected enough scan cycles to fill the sample window (depth × sample rate). This is normal — the model starts running automatically once enough data accumulates.

Both codes point back at historization: **Stale History Data** almost always means collection stopped on an upstream device, and **Not Enough Historical Depth** can be aggravated by aggressive compression starving the history. If the depth error won't clear even after waiting, confirm the bound tag is actually recording points — a compression/range mismatch can prevent history from ever filling the window. See [Tag is not historizing properly](#tag-is-not-historizing-properly) and the model [inference requirements](https://ai-ops.com/docs/models/inference-requirements.md) for how depth is calculated. For the full model and binding error catalog, see [A Model or Binding Isn't Running](https://ai-ops.com/docs/troubleshoot/models.md).

## Still Stuck?

If a tag records live values but history stays empty even after correcting the range and compression:

1. Confirm the tag's live value is genuinely changing — SDT correctly stores nothing for a truly constant signal until **Maximum Time Between Samples** forces a sample.
2. Set the device's log level to **Debug** and watch for historization errors during a scan. See [Logs](https://ai-ops.com/docs/system/logs.md).
3. Check disk space and service health — a full disk or a stalled service stops all writes. See [Service Health & Resource Alarms](https://ai-ops.com/docs/troubleshoot/services-and-alarms.md).
4. If you're preparing a support ticket, gather the details in [Collecting Diagnostics for Support](https://ai-ops.com/docs/troubleshoot/collecting-diagnostics.md).

## What's Next

- [Reading Status, Quality & Errors](https://ai-ops.com/docs/troubleshoot/reading-status-and-errors.md): the shared reference for the three diagnostic fields, the status/quality legend, and the master error-code lookup
- [Bad, Missing, or Frozen Tag Values](https://ai-ops.com/docs/troubleshoot/tag-values.md): upstream causes when a live value never moves
- [Troubleshoot a Connection](https://ai-ops.com/docs/troubleshoot/connection.md): device-level outages that stop collection
- [A Model or Binding Isn't Running](https://ai-ops.com/docs/troubleshoot/models.md): stale-history and depth binding errors in full
- [Service Health & Resource Alarms](https://ai-ops.com/docs/troubleshoot/services-and-alarms.md): disk, service, and resource problems that stop writes
- [Tag Range and Compression](https://ai-ops.com/docs/system/retention.md#tag-range-and-compression): the SDT and compression settings that own historization
- [Data Retention](https://ai-ops.com/docs/system/retention.md): compression, retention periods, and storage monitoring
- [Model Inference Requirements](https://ai-ops.com/docs/models/inference-requirements.md): tensor shape and history depth
