HydraIssues

hydrastreamingmonitor: the cicd.md "force an immediate deploy" procedure does not work
open unclassified Project: hydra Reporter: 11 Jul 2026 09:00

Description

`docs/runbooks/cicd.md` documents two ways to skip the 6-hour auto-update poll after tagging a release. **Neither works.** Hit while deploying v0.4.35.

### 1. `hydrastreamingmonitor update --force` does not exist

```
$ ssh root@78.47.174.83 "hydrastreamingmonitor update --force"
Error: unknown command "update" for "hydrastreamingmonitor"
```

The binary only registers `serve` and `version` (`internal/cli/root.go:23-24`). There is no `update` command to run. The runbook calls this the *preferred* method.

### 2. `systemctl restart` does not pick up a new release either

The runbook hedges that restart "will only pick up a new binary if the auto-updater had already downloaded it to disk" — but in practice a restart will **never** have done so, because the updater sleeps *before* its first check:

```go
// hydrarelease@v1.16.8/pkg/updater/updater.go:248-253
func (u *Updater) StartAutoCheck(interval time.Duration, autoApply bool) {
go func() {
for {
time.Sleep(interval) // <-- sleeps FIRST
info, err := u.CheckForUpdate()
```

`serve.go:40` calls `StartAutoCheck(6*time.Hour, true)`, so **the first update check happens 6 hours after process start**. A freshly restarted service has, by construction, never checked. Restarting therefore resets the 6h clock and guarantees the new binary is *not* applied.

### What actually works today

Install the binary by hand:

```bash
curl -fsSL -o /tmp/hsm.new \
https://releases.experiencenet.com/hydrastreamingmonitor/production/v0.4.35/hydrastreamingmonitor-linux-amd64
chmod +x /tmp/hsm.new && install -m 0755 /tmp/hsm.new /usr/local/bin/hydrastreamingmonitor
systemctl restart hydrastreamingmonitor
```

(Note the release-server path is `/{project}/{channel}/{version}/{binary}` — the runbook does not document the download URL at all.)

### Suggested fix

Either add a real `update` command to the CLI (matching what the runbook already promises), or have `StartAutoCheck` check **once immediately** before entering the sleep loop, so that a `systemctl restart` becomes a genuine deploy trigger. The latter is a one-line change in hydrarelease and would make the documented procedure true. Until then, fix cicd.md to describe the manual install above.

Related: #382 (CI-triggerable update endpoint).