Repository navigation
Description
Problem
After an update through the built-in updater, the new code is on disk for the main backend, the Celery worker and Celery beat, but those three services keep running the code they started with. Nothing tells the operator: health answers 200 and the version endpoint carries no commit.
Evidence (local deployment, read-only, 2026-11-11, Europe/Riga local time)
Update to commit 6cd72da98027 through the built-in updater; code sync ran 22:08-22:34.
| Observation | Value |
|---|---|
| SLM backend deployed-commit marker | 6cd72da98027, written 22:32 |
| SLM backend service | restarted 22:32:44 |
Component sync markers autobot-backend, autobot_shared, autobot-slm-frontend, libs, autobot-plugins |
6cd72da98027, written 22:31-22:33 |
| New sources on disk | backend entry module and the new eval/ package, dated 22:08 |
| Main backend service, Celery worker service, Celery beat service | all last started 17:11, i.e. before the code landed; never restarted |
| The update's Ansible log, backend play | contains no restart step |
| Health endpoints | 200 "healthy" |
| Version endpoint | only {"version":"0.0.1","build":"dev"}, no commit |
So changes merged today (#21216, #21247, #21273) are on disk but not live.
Code locations (origin/main, read from git show; static reading, not run)
autobot-slm-backend/ansible/playbooks/update-all-nodes.yml:1414-1421restartsautobot-backendin Play 2, taggedrestart,when: 'backend' in group_names.update-all-nodes.yml:1439-1461restartsautobot-celeryandautobot-celery-beat(added for CRITICAL(deploy): update rewrites 2000+ .py files under the live interpreter — 22-minute window where late first-imports raise ImportError for symbols that exist #13539), same tag and group gate.update-all-nodes.yml:855-856: Play 2 ishosts: infrastructure. Everything above lives in Play 2 only; Play 1 (:382) restarts the SLM backend (:734-739) and nginx for the SLM frontend (:757-761) and nothing else.autobot-slm-backend/api/code_sync.py:3205-3225(_ansible_self_update): runsupdate-all-nodes.ymldetached with--limit= localhost plus co-located nodes. The restart of the SLM backend in Play 1 is what can cut this run.autobot-slm-backend/services/sync_restart.py:20-24: "sync without restart" passes--skip-tags restart -e autobot_restart_services=false, so a code-only sync leaves every service on old code by design.autobot-backend/initialization/endpoints.py:256hard-codes"build": "dev"; no commit is exposed.
Root cause
Not established. The playbook on main does contain restart tasks for the backend and both Celery units, so the missing restart must come from one of: (a) Play 2 never ran or was cut when Play 1 restarted the SLM backend at 22:32:44 (same shape as open #12596); (b) the run was a code-only sync (--skip-tags restart); (c) the machine's inventory row is not in the backend group so the gate is false. Needs the run's PLAY header list and the --limit/--skip-tags it was started with. Tracked here as: whatever the cause, a successful update must not be able to end with stale processes, and a stale process must be detectable.
Related: #12596 (Play 2 skipped after the Play 1 restart), #13539 (restart of Celery added), #18052 (running tree vs code_source), #19444 (stale autobot_shared after self-update), #17645 (nothing reports the deployed commit), #20743 (no-restart sync).
Impact
Every "updated" deployment can silently run old code for the main backend and workers. Fixes appear deployed but are not, and host-evidence checks for acceptance criteria on any issue are invalid until the services are restarted.
Proposed fix (in the built-in updater only; no side-channel restarts)
- One canonical restart step driven by "this component's deployed commit changed", reused for every component and every long-running unit (main backend, Celery worker, Celery beat, workers), instead of per-play hand-written tasks.
- The update does not report success while any unit it manages started before its component's sync time; it reports which units are stale.
- The version endpoint (and health) return the commit the process was started from, so a stale process is detectable by comparing with the deployed-commit marker.
Acceptance criteria
Code-verifiable:
- Every systemd unit the updater manages has a restart path notified by its component's sync, in one shared task/handler (file:line quoted).
- A test/guard fails when a unit named in
code_sync.py::_COMPONENT_SERVICESorupdate-all-nodes.ymlrestarts has no restart path. - The version endpoint returns the commit the process started from (test).
- A "stale process" check compares process start with component sync time and is surfaced in update status (test).
Needs host evidence:
- After an update through the built-in updater, each service's start time is later than its component's sync time (main backend, worker, beat).
- The version endpoint on the local deployment shows the just-deployed commit.
Activity
mrveiss commentedon Nov 12, 2026
Second host observation (2026-11-12, about 10:27 Riga time), after the install was updated to
f87e78874a2ethrough the builtin updater. Read-only; nothing on the host was changed.Result: the gap persists in a narrower form. Files are deployed at the new commit; the SLM side is now restarted and rebuilt; the main backend, the Celery worker, Celery beat and the user frontend are still on pre-update state.
f87e78874a2e; four files changed by today's landed trains (autobot_shared/after_commit.py,knowledge/retrieval_invalidation.py,chat_workflow/stall_escalation.py,llc/services/work_item_import.py) are byte-identical tomainProbable trigger (new evidence). The updater's first playbook run ended with one failed task: in the backend play, at the internal API key alignment step, on the manager host. The error detail is hidden by
no_log; just before it the log shows a warning that the stored keys differ and none was rewritten. Everything ordered after that task in the play — restarting the main backend and Celery, building the user frontend — did not run. A second run reported no failures but matched no hosts for those plays and restarted nothing.So the update reports success-looking state (markers written, files in place) while the services that matter most keep running old code.
What this adds to the acceptance criteria
/api/versionreports only a static version), so "what is running" can be checked without comparing process start times.Not observed: the hidden error text; whether the AI/NPU/TTS workers need a restart for these changes; whether database migrations ran.
mrveiss commentedon Nov 12, 2026
Second sighting — update to
394642fe5fa1(2026-11-12, ~15:01–15:05 Riga), read-only host checkThe updater run finished clean this time (play recap
failed=0on both targets), so the stale processes are not a consequence of the failed key-alignment step seen in the earlier run (#20750) — they occur on a successful update too.394642fe5fa1…; source tree HEAD equals it394642fe5f— all identicalSo after a successful update the files on disk are current while every non-SLM service keeps running the previous code, and the user frontend is neither re-synced nor rebuilt. Anything landed today in the main backend, workers or user frontend has no host evidence until those are restarted/rebuilt by the updater.
Not established: why the play skipped the restarts and the user-frontend sync/build (the self-update log is not readable to the checking account; the recap shows 129 skipped tasks on the node target).
mrveiss commentedon Nov 12, 2026
Third check — update to
1b412de635c8(2026-11-12, deploy window 18:41–18:45 Riga), read-only: cause locatedCorrection to the previous comment: the updater log holds two runs per update. The
failed=0recap quoted earlier was the SECOND run (a remote node's agent only). The FIRST run — the one that deploys the main node — ended withfailed=1on the main node.Where it stops: task
Internal key | Propose re-aligning the backend's key to the SLM's (#20750)fails (its output is hidden byno_log), and the fatal ends that host's play. Everything the play does after that point never runs on the main node:What does run before the abort: source fetch, backend/shared/SLM file sync, SLM agent + SLM backend restart, SLM frontend build.
Just before the failing task, a warning task reports that the stored internal API key differs between the backend's two env files and the SLM, keeps each file's own key and rewrites nothing, because re-aligning a credential needs human approval (#17038). So the sequence is: mismatch detected → a proposal step is attempted → that step fails → the whole update of the main node is aborted.
Why this matters: since the key mismatch appeared, no update has restarted the main services or shipped the user frontend. Every "installed at " since then means "files copied", not "running". No acceptance criterion that needs host evidence for the main backend, workers or user frontend can be met until this is fixed.
Two separate things to fix:
Not established: the error text of the failing task (hidden by
no_log); whether the failures at the two earlier commits today had the same cause (their first-run recaps were not read).mrveiss commentedon Nov 12, 2026
Follow-up from reading the updater log and the playbook (fix proposed in PR #21399, not merged, not yet reviewed):
no_log). The task already tolerates HTTP refusals, so the suspected key deadlock is not what aborts the play. This also confirms the same cause for the two earlier installs today.PR #21399 wraps the propose/report/claim tasks in a block with a rescue so they can never fail the update, reports the non-secret shape of the failure (status, field names, error text unless it could name a key) in the update summary, rewrites no key and approves nothing. The real error text will be visible on the first update that runs with that change.
fix(updater): build the internal-key URL from the flat port and guard…
mrveiss commentedon Nov 12, 2026
Root cause found by reading (unproven until an update runs): the updater's include sets the internal-key URL from
infrastructure.ports.backend. Looking upinfrastructuretemplates the whole dict ininventory/group_vars/infrastructure.yml, whose host entries indexgroups['<name>'][0]unguarded (thereserved_1entry usesvnc_nodes, a group no inventory defines). That raises while the task'surlis templated, before any HTTP call, sofailed_when: falsecannot absorb it andno_loghides it. It fits the ~2 ms failure on every run.PR #21399 builds the URL from the flat
backend_port, guards the dict, and wraps the proposal step in a rescue that reports a key-free shape and lets the update continue. Keep this open until a host update shows the restarts, the rebuilt user frontend, and either a pending approval or the reported shape. Note: with the proposal not recorded, no approval row exists, so the maintenance UI shows nothing about it; only the update output and summary do.12 remaining items
fix(updater): the internal-key proposal step can no longer abort a no…
fix(updater): format the proposal guard test (mrveiss#21343)
mrveiss commentedon Nov 13, 2026
Sighting, 2026-11-13 (read-only observation of the local install after a self-update that reported
failed=0):87819661d3; the SLM backend service was restarted by the run.95511a1281(305 commits behind), it carries no deployed-commit stamp, and its service has been running since before that tree was last synced (no restart).This is a witness for this issue, not a new defect. Frontend half of the same observation: #18100.
mrveiss commentedon Nov 13, 2026
Evidence from a second symptom of the update ordering: after an update the Custom Dashboard showed the toast "Could not load your saved dashboard layout. Editing is off so it cannot be overwritten." (`views.customDashboard.loadFailed`).
Cause verdict: transient, caused by the frontend being published and served before the backend is back. It will not persist once the backend is up and the page is reloaded. Not established: the exact status of the failed request (the proxy access log is empty/disabled, so the 502 is inferred from the upstream errors).
Suggested additions to this issue: (1) order the update so the frontend is only switched after the backend answers its health check, (2) `useDashboardLayout.load()` retries with backoff on network/5xx and the view offers a Retry action instead of a dead-end toast (CustomDashboard.vue ~388). AC: after an update the dashboard loads the saved layout without a manual reload.
mrveiss commentedon Nov 13, 2026
Host evidence 2026-11-13 — why the app services are not restarted
Evidence
00-SLM-Manager(its address is local to that machine). The second node in the update (b9a29e04, different address, not local) is a separate machine that only receives Play 2's shared-code and agent tasks (recap ok=113 skipped=129 in every run). Its 129 skips are therefore expected and are not this defect.backendgroup when Play 2 reaches it: the log shows[PLAY 2] Backend | Restart serviceon00-SLM-Managerin updates on 2026-11-06, -07 and -08 (last: 2026-11-08 11:45, recap ok=616 failed=0). No later update contains that task (zgrep -c= 0 in logs from 2026-11-09 on).00-SLM-Managerendedfailed=1for that host (14 failures in the retained logs). 13 died in Play 2 atInternal key | Propose re-aligning the backend's key to the SLM's (#20750)(no_log, so the cause is censored), beforeBackend | Restart service. Ansible drops a failed host from all later plays, so the backend, celery and the other services never restarted. The follow-up run then limits to the remaining node, so the SLM host is not retried.slm_manager : SLM | Deploy nginx configuration, template recursion, fixed separately in fix(updater): the SLM play no longer recurses on infrastructure host addresses (#21343) #21461), so Play 2 never started for the SLM host. The Play 1 restart that did run was onlyautobot-slm-backend(and the SLM agent).Setup AI Stack Node,Deploy AutoBot Rolex2,Setup Browser Worker Node) ran against00-SLM-Managerwith a registry-built inventory. They restarted chromadb/ai-stack (07:56) and autobot-backend/celery (07:59). At last check celery-beat, npu-worker, playwright and tts-worker were still running since 2026-11-12 11:40. The launching API route is not established (no route line in the readable logs).Root cause (established vs not)
Options
no_logon the status line only (log HTTP status, never the key) inautobot-slm-backend/ansible/_shared/tasks/realign_internal_api_key_claim.yml. Small PR, no decision needed.any_errors_fatal: falsesemantics for the SLM host). Needs an owner decision.What the next update must show
[PLAY 2] Backend | Restart serviceand the celery restart tasks executed on the SLM host, recapfailed=0for it.systemctl show -p ActiveEnterTimestampfor backend, celery, celery-beat, npu, playwright and tts later than the update start.internal_api_key_realign_reportif the key mismatch persists.fix(updater): host-address rule is loopback for the node itself, the …
fix(updater): the cycle guard declares its reach and is recorded (#21343
chore(ci): run the suite on the head synced with main (#21343)
Merge pull request #21461 from mrveiss/hotfix-21343-updater-recursion
mrveiss commentedon Nov 13, 2026
PR #21461 merged as 0f14a1b. It removes the template recursion that stopped the manager play (the
infrastructurevariable no longer reads itself; a cycle guard covers group variables, role defaults and inventories). This issue stays open: the restart half is only provable on a host. The next update through the builtin updater must show the nginx configuration task ok,Backend | Restart serviceand the Celery restart on the manager host, recapfailed=0, and service start times later than the update start. Side effect tracked separately in #21465.github-actions commentedon Nov 13, 2026
Landed in #21461, merge
0f14a1b496fix(updater): the SLM play no longer recurses on the infrastructure a…
mrveiss commentedon Nov 13, 2026
Host evidence, deployed node, update to
470d3627d8on 2026-11-13/14 (Riga time), read-only observation:470d3627d8d5, written 23:57–00:01Every service's start time falls inside the update window, after its code was written — the update restarted the main backend and the workers. This is the first update since #21461 landed; the previous attempt aborted in the SLM play before any restart.
This is one update. The acceptance criteria stay unchecked here until a second update shows the same.
mrveiss commentedon Nov 14, 2026
Second update through the built-in updater, deployed node, to
78aca82701(2026-11-14, Riga time), read-only observation:78aca8270188, written 02:23–02:25Same result as the update to
470d3627d8two hours earlier (comment above): on two consecutive updates every service started after its component's sync. Ticked on that evidence: "each service's start time is later than its component's sync time (main backend, worker, beat)".Not ticked: "The version endpoint on the local deployment shows the just-deployed commit" —
GET /api/versionon the node answers{"version":"0.0.1","build":"dev",…}with no commit, so that criterion (and the code criterion for the endpoint) is not delivered. The four code criteria were not examined in this pass.mrveiss commentedon Nov 20, 2026
Sighting (2026-11-20): after the builtin self-update to edb71ca at 10:37 Riga, the browser worker (
node /opt/autobot/autobot-browser-worker/playwright-server.js) was still the process started 2026-11-19 22:38. It was not restarted. A witness for this issue. Separately, its files were not synced either; that is tracked on its own issue.