Troubleshooting
Why Ignition tag history disables after a gateway disconnect
Short answer
The historian is not broken and PostgreSQL is not implicated: a Gateway Network disconnect puts the remote history sink into ServerUnavailable, and the history configuration drops off the tags. Re-set the history fields on the affected tags to restore reads, then stop the recurrence with a reference-tag layer while you fix the connection.
On this page
Tag history goes dark because the Gateway Network connection between the two gateways dropped — not because the historian or its PostgreSQL backend failed. The log trail is unambiguous: the web socket closed on its idle limit, the route disconnected, the remote history sink entered ServerUnavailable, and the history configuration cleared from the affected tags. Restore collection by re-setting the tag's history fields, stop the recurrence by collecting through reference tags, and then fix the disconnect itself, because the reference layer hides the symptom without repairing the link.
What the log sequence proves #
The entries that matter, in order:
| Logger | What it recorded |
|---|---|
| WebSocketConnection | connection status Running to Faulted: remote server forcibly closed the web socket, Idle timeout expired: 42143/30000 ms |
| Routing | route disconnected between server _0:0:Ignition-la-srv-app-02 and connection ignition-la-srv-app-02 |
| HsqlDataStore | store-and-forward datacache ignition_la_srv_app_02_postgresql_localhost started up successfully |
| StandardStoreAndForwardEngine | history sink started successfully |
| RemoteHistorianSink | remote sink service state changed to ServerUnavailable; data sink set to faulted, the history storage service is currently unavailable |
Read the numbers before the words. 42143/30000 ms means the socket's idle limit is 30,000 ms and the timer measured 42,143 ms of silence when it fired — 12,143 ms past the limit — so the remote end closed a connection that had carried no traffic for 42 seconds. Seventeen seconds after that close, the gateway had already restarted the remote historian profile Ignition_la_srv_app_02_Postgresql_Localhost, brought up its local store-and-forward cache, and faulted the remote sink: everything local worked, and the destination was simply unreachable. PostgreSQL appears nowhere in the sequence. The decision this forces: run a Gateway Network diagnosis, not a database case.
Confirm the failure layer in this order #
Work from the live value down to the database, and skip nothing that would change the answer:
- Live source values. Check value, quality, and timestamp in tag diagnostics. Good quality with an empty chart means acquisition is healthy and the fault is downstream of the tag.
- Gateway Network status. Confirm the connection and route state on both gateways at the same timestamp; a fault recorded on one end only points at the path between them.
- Tag history settings. After a disconnect, compare the tag editor's history configuration — the enabled state and the selected provider — against a saved baseline. Export the tag configuration while healthy so the next diff is mechanical. Distinguish a persistent change, where the exported config differs, from the designer merely showing no provider while the connection is down.
- Store-and-forward status. Pending and faulted record counts separate data that is queued from data that failed delivery.
- Tag Historian module on the history gateway. The module must be installed and licensed on the gateway that owns the provider; a missing module or license there breaks remote history reads with blank returns, a different fault from this one.
- Gateway version pairing. A documented unsupported pairing exists for an Edge 8.3 gateway syncing to a standard 8.1 gateway; align versions across the link before blaming the tags.
- PostgreSQL last. Connection, permissions, and recent writes. In this fault pattern it is the final check because the logs never name the database.
Restore collection now #
Recovery is a tag edit, nothing on either gateway:
- Open the project that owns the affected tags.
- On each tag, re-set the cleared history configuration — the enabled state and the provider selection — and save.
- Confirm the provider still points at the remote profile on the history gateway.
- Put a Power Chart across a window that spans the outage: reads resume immediately, and the gap stays empty until it is backfilled.
That restores service and proves the diagnosis, but it is not a fix. The next disconnect clears the same fields again, and every cycle adds another gap to the trend.
Stop the recurrence with a reference-tag layer #
The working arrangement for this fault pattern is to let reference tags own the historical collection. The observed behavior: history enabled on reference tags survived disconnects that cleared the same fields on the source tags. That is the basis for the decision — use it, and prove it once under a controlled disconnect before relying on it.
- Record the baseline: history-enabled state, provider, source paths, and the historical paths every chart queries. Export the tag configuration.
- Verify the source tags show good live values first; fix acquisition faults before rearranging history.
- Create reference tags for a representative set of source tags, and check that each reference's value, quality, and timestamp match its source.
- Enable history on the reference tags against the intended provider, and leave history disabled on the source tags. Collecting on both creates two historical streams for one measurement and doubles the storage for it.
- Point a test Power Chart at the reference paths. Records already stored stay under the old paths, so reach them through the remote provider when you verify continuity — see querying tag history from a remote tag provider.
- Prove reconnection in a planned maintenance window or on a representative test system, never by pulling a production link while the line runs: drop the inter-gateway connection, confirm the reference layer keeps its history configuration, restore the link, and confirm buffered records arrive.
- Roll the arrangement out to the remaining tags once the representative set passes both normal operation and the reconnect test.
The reference arrangement also earns its keep on the recovery side of an outage, as in getting backfilled Sparkplug history through Ignition reference tags after an MQTT Engine outage.
What the fault costs in data #
Worked example, illustrative inputs: 40 tags, each logging one sample every 30 s, collection lost for 45 minutes.
- Per tag: 45 min × 60 s/min = 2,700 s; 2,700 s ÷ 30 s/sample = 90 samples.
- Total: 40 tags × 90 samples = 3,600 history records.
The decision turns on which side of the fault the tags sat on. Tags that stayed history-enabled while only the sink faulted produce those 3,600 records into the local store-and-forward cache, which forwards them when the sink recovers — the engine's behavior across an outage is the one described in MQTT store and forward backfill after a connection outage. Tags whose configuration cleared, which is this fault pattern, never create the records: the interval must be backfilled or accepted. Pull the interval from a plant historian that kept collecting, as in backfilling trend history from a plant historian. Where no historian holds the interval, write the values back with past timestamps, as in backfilling a managed tag provider with updateValue in the past.
Fix the disconnect itself #
The reference layer is a workaround; the transport fault is still yours to fix.
- Pull the logs from both gateways around each fault and confirm both ends record the close; one-sided evidence points at the path between them.
- Repeated
Idle timeout expiredentries mean the link sits quiet past its idle limit and the remote end closes it: check whether a stateful firewall or NAT between the gateways tears down idle sessions, and whether the route carries any periodic traffic that would keep it alive. - Re-verify the route's approval and certificate state after any gateway restore, since a half-reapproved route behaves exactly like a flapping connection.
- The wider failure family — a remote history provider that stops when the gateway link degrades — is diagnosed the same way, transport first: see remote tag history stopping when gateway redundancy fails.
Decisions #
| What you see | Decision |
|---|---|
| History fields cleared on tags after a Gateway Network fault | Re-set the enabled state and provider now; move collection to reference tags before the next disconnect |
ServerUnavailable with the local cache started |
Transport fault: run the Gateway Network diagnosis, do not open a database case |
| An outage gap in the trend | Backfill from a plant historian or managed-provider writes with past timestamps; otherwise accept and document the interval |
| Repeated idle-timeout closes | Fix idle-session handling on the path between the gateways; the reference layer only hides the symptom |
Questions asked
Does ServerUnavailable mean PostgreSQL failed?
No. The log sequence shows the local store-and-forward cache and the local history sink starting successfully, then the remote sink faulting because the history storage service was unreachable over the dropped route. PostgreSQL appears nowhere in the sequence, so the database is the last check, after the route, the tag configuration, and the Tag Historian module license on the gateway that owns the provider.
Will store and forward save the data during one of these outages?
Only for tags that stay history-enabled and keep producing records. The engine buffers those records locally and forwards them when the sink recovers. In this fault the history configuration clears from the tags, so no records are created during the gap; the outage interval has to be backfilled from another source or accepted.
Why do reference tags stop the configuration loss?
Empirically, history enabled on reference tags survived disconnects that cleared the same fields on the source tags, and that is the working basis for the arrangement: it separates the tags the project uses from the source configuration that needed manual repair. It does not repair the Gateway Network connection, so retest after a controlled disconnect before relying on it.
Should both the source tag and the reference tag collect history?
No. Pick one owner of historical collection. Enabling history on both creates two historical streams for one measurement, doubles storage, and leaves queries ambiguous about which path is authoritative. Leave history disabled on the source tags once the reference layer is proven, and repoint charts to the reference paths.
What does the 42143/30000 ms in the log mean, and what if the entries repeat?
The web socket's idle limit is 30,000 ms and the timer had measured 42,143 ms of idle when it fired — the close happened after the limit was already exceeded, not exactly at it. A single entry is evidence of one idle link, but the same entry recurring at regular intervals points at a stateful firewall or NAT between the gateways tearing down every idle session: check that next, because re-setting the tag history fields after each one is not sustainable.