Files
sencho/docs/features/remote-updates.mdx
T
Anso 3d69746eee fix(fleet): make local self-update flow reliable end-to-end (#472)
The "Updating Sencho..." overlay used to dismiss prematurely while the
image pull was still running, after which the local node card would get
stuck in "updating" and eventually surface a generic "Timed Out" error
while the container remained on the old version.

Three root causes are addressed:

1. The image pull was synchronous (`execFileSync`), which blocked the
   Node event loop. The overlay's health probe saw the server come back
   the moment the pull finished and reloaded the page, even though the
   container had not restarted yet. The pull is now async via
   `promisify(execFile)`, so /api/health and /api/fleet/update-status
   keep serving throughout.

2. The overlay reloaded on the first 200 from /api/health regardless of
   whether the underlying process had actually restarted. /api/health
   now exposes the gateway boot timestamp, and the overlay captures it
   pre-update and only reloads when it observes a different value. A
   wasOffline-then-online fallback handles the case where the pre-update
   fetch failed.

3. Helper container spawn errors from `docker run` were silently
   discarded, so a failed compose recreate never surfaced anywhere.
   Errors are now captured into `lastUpdateError` via the execFile
   callback and surfaced through the existing /api/fleet/update-status
   error path.

A 3-minute early-fail heuristic on the local node block surfaces a clear
failure message when the helper fails silently, instead of waiting the
full 5-minute timeout for an unknown failure.
2026-04-10 12:00:44 -04:00

114 lines
6.3 KiB
Plaintext

---
title: Remote Updates
description: Check for outdated nodes and trigger over-the-air Sencho updates from the Fleet View.
---
Sencho can update remote nodes directly from the dashboard. When a node is running an older version than the latest available release, a one-click update pulls the latest image and recreates the container automatically. This includes the local (gateway) node itself.
<Note>
Remote updates require a **Skipper** or **Admiral** license.
</Note>
## Prerequisites
Remote updates work when each node meets these conditions:
- Deployed via **Docker Compose** (the recommended method)
- The Docker socket (`/var/run/docker.sock`) is mounted into the container
- Running a Sencho version that supports the `self-update` [capability](/features/node-compatibility)
Nodes deployed with `docker run` or orchestrators like Kubernetes do not support self-update. These nodes show an error message when you attempt to update them.
## Checking for updates
Open the **Fleet** tab and click **Check Updates** in the header. This opens the **Node Updates** dialog, which lists every node with its current version and update status.
<Frame>
<img src="/images/fleet-view/fleet-node-updates.png" alt="Node Updates dialog showing update status for each node" />
</Frame>
The dialog includes:
- **Summary cards** at the top showing counts of nodes that are Up to date, have updates Available, are currently Updating, or have Failed
- **Latest version** label showing the newest available Sencho release
- **Filter** search box to find specific nodes by name or type
- **Node table** with columns for name, type, current version, latest version, and status
Each node's status column shows one of:
| Status | Meaning |
|--------|---------|
| **Up to date** badge | Node is running the latest available version |
| **Update** button | A newer version is available; click to update |
| **Updating** badge | The node is pulling the new image and restarting |
| **Updated** badge | The node came back online with the new version |
| **Timed out** badge | The node did not come back within 5 minutes |
| **Failed** badge | The update was rejected or the image pull failed on the remote host |
Nodes that are too old to report their version show "unknown" in the current version column. These nodes are treated as outdated.
### Updating state
When an update is in progress, the dialog shows a spinning "Updating" badge and the summary card count changes in real time. The Fleet View polls every 5 seconds while an update is active.
<Frame>
<img src="/images/fleet-view/fleet-node-updating.png" alt="Node Updates dialog showing a node in the updating state" />
</Frame>
## Updating a single node
You can trigger an update in two ways:
- Click the **Update** button next to a node in the Node Updates dialog
- Click the **Update to vX.Y.Z** button directly on a node card in Fleet View
For remote nodes, the update happens in the background. The Fleet View automatically polls at a faster rate (every 5 seconds) while an update is in progress, so you can watch the status change in near real-time.
## Updating all nodes
Click **Update All (N)** in the footer of the Node Updates dialog to trigger updates on all outdated remote nodes simultaneously. The local node is excluded from bulk updates to avoid losing dashboard connectivity. Nodes that previously failed or timed out are automatically retried in a bulk update.
## Local node updates
When you update the local (gateway) node:
1. A confirmation dialog appears explaining that the dashboard will briefly disconnect.
2. After confirming, the server pulls the latest image and restarts.
3. A reconnecting overlay appears and polls the server every few seconds. It stays visible for the entire pull and restart cycle, even if the API briefly responds in between, so the page does not reload until the new container has actually booted.
4. Once the new container reports a fresh boot timestamp, the page automatically reloads with the new version.
If the new container does not come up within 5 minutes, a timeout message appears with a manual reload option. If the gateway can detect that the update did not complete (for example, the image pull failed or the restart helper container could not spawn), the local node card surfaces a "Failed" badge with the underlying error within about 3 minutes instead of waiting for the full timeout.
## What happens during an update
When an update is triggered on a node, Sencho:
1. Pulls the latest `saelix/sencho` image using Docker Compose
2. Recreates the container with the new image
3. The node goes briefly offline during the restart
The gateway monitors the remote node until it comes back online, then marks it as **Updated**. Completion is detected by three signals: a version change, a change in the node's process start time, or detecting that the node went briefly offline and came back (indicating a container restart). The "Updated" badge clears automatically after about 60 seconds and the node returns to "Up to date" status.
If the node is still reachable and unchanged after about 90 seconds, the gateway marks the update as **Failed**. This usually means the image pull failed on the remote host. Check the Docker logs on the remote node for details.
## Handling failures
If an update times out or fails, the badge shows **Timed out** or **Failed** with two action buttons:
- **Retry** (circular arrow icon) clears the failed state and re-triggers the update
- **Dismiss** (X icon) clears the failed state without retrying, returning the node to "Update available"
Hovering over a failed or timed-out badge reveals the error message with details about what went wrong.
<Frame>
<img src="/images/fleet-view/fleet-node-failed.png" alt="Node Updates dialog showing a failed node with retry and dismiss buttons" />
</Frame>
You can also click **Recheck** in the dialog footer to clear all failed and timed-out states at once, refresh the cached latest version from GitHub, and fetch fresh version information from every node.
<Note>
Update tracking is stored in memory on the gateway. Restarting the gateway clears all update states, so any stuck "Timed out" or "Failed" badges will resolve on their own after a restart.
</Note>
If you run into issues with remote updates, see the [Troubleshooting](/operations/troubleshooting#remote-update-button-does-not-appear) page.