# Datasource down or faulted

> An OPC-UA / MQTT / CSV datasource stops streaming, or a row shows a fault indicator.

## Symptom

One of two things:

- **Enable fails.** Toggling **Enable** on an input datasource row bounces back to **Disabled** and shows an error code such as `model_not_paired` or `adapter_connect_failed`.
- **A running source faults mid-stream.** A previously-streaming datasource stops producing predictions; the row shows a fault indicator and a red banner appears. Under the hood the runtime dropped to a faulted, then idle, state.

Enabling a datasource does **not** start streaming. It prepares the runtime (loads the
model, connects the adapter). You press **Start** to begin inference. A row that is
Enabled but not predicting is often just waiting for Start — that is by design.

## Confirm

Identify which stage failed.

- **Read the error code on the row.** The code names the failed step directly:
  - `model_not_paired` → the datasource has no model assigned.
  - `adapter_connect_failed` → the protocol connection (OPC-UA handshake / MQTT broker connect / Modbus probe) failed — almost always a network or endpoint problem.
- **Check the backend log** for the connect attempt and fault reason:

  ```bash
  docker compose -f docker-compose.release.yml logs backend | grep -iE "datasource|adapter|fault|enable"
  ```

- **A mid-stream fault** comes from a read error on the live source (a tag stopped responding). When that happens the runtime tears down to a clean idle state: the model is unloaded and the adapter is unbound. **Recovery is not automatic** — the source must be re-enabled from scratch.

## Fix

1. **`model_not_paired`** — assign a model to the datasource first, then Enable again. A datasource must be paired with a model before it can run.

2. **`adapter_connect_failed`** — the runtime could not reach the source. The Enable already rolled the row back to Disabled cleanly, so fix the connection and retry:
   - Verify the endpoint address, port, and credentials in the datasource config.
   - Confirm the box has network reachability to the OPC-UA server / MQTT broker / device.
   - For a CSV source, confirm the file path and that the file is present and readable.
   - Use the form's **Test Connection** against the *current* values, then Enable again.

3. **A source that faulted mid-stream** has been torn down to idle — the model was unloaded and the adapter unbound. Re-establish it fully:
   - Fix the underlying source problem (reconnect the sensor / restore the tag / fix the network).
   - **Enable** the datasource again (this reloads the model and reconnects the adapter).
   - Press **Start** to resume streaming.

Only one input datasource can be Enabled at a time. Enabling source B automatically
disables source A. If a source you expected to be running shows Disabled, check whether
enabling a different source switched it off.

## Prevent

- **Pair the model and map all channels before going live.** Most Enable failures are pre-flight validation: a missing model pairing or an incomplete tag-to-channel mapping (gaps or over-fills). Complete these once and Enable succeeds first try.
- **Stabilise the source before Start.** A flaky OPC-UA endpoint or intermittent broker will fault the stream and force a full re-enable. Confirm a stable connection with Test Connection before pressing Start.
- **Expect the two-step flow.** Enable prepares; Start streams. Building this into the operating procedure avoids "it's enabled but nothing's happening" tickets.

## Related

- [Connecting Datasources](/configure/input-datasources/) — adapter types, connection config, tag mapping.
- [Your First Inference](/install-deploy/first-inference/) — model load and run flow.
