Skip to content

fix(fleet): skip Go slot refresh when container is absent (#628) - #642

Merged
dofastted merged 5 commits into
mainfrom
cursor/missing-container-telemetry-skip-78a2
Oct 22, 2026
Merged

dofastted merged 5 commits into
mainfrom
cursor/missing-container-telemetry-skip-78a2

Conversation

@dofastted

@dofastted dofastted commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #628 (REQ-0628).

When install.sh upgrade runs scripts/fleet-services.mjs (fleet action=telemetry), VMs that remain in the registry but no longer have a local Docker container (No such container: kin-NN) caused the entire refresh to exit non-zero.

This change treats that case as a non-fatal skip:

  • Proactive docker inspect before local docker exec telemetry refresh
  • Same early check for cluster-node slots via the Engine API
  • Error-message fallback for races where the container disappears mid-flight
  • Explicit [fleet] / [fleet-services] log lines with VM id and container name
  • Report fields: skipped, skip_reason, and aggregate skipped_count
  • Real refresh failures (e.g. permission denied, egress start failure) still increment failed_count and fail the batch

Test plan

  • fleet telemetry skips db rows whose container is absent on this host
  • fleet telemetry still fails when a present container refresh errors
  • CI unit job (builds kin-egress before npm run test:unit)

CHANGELOG

Open in Web Open in Cursor 

Note

Medium Risk
Changes fleet upgrade/telemetry batch behavior for stale registry rows without local containers; real refresh failures still fail the batch, but operators must notice skipped VMs in logs/report instead of a hard stop.

Reviewed by Cursor Bugbot for commit 2a4e0c9. Configure here.

@dofastted
dofastted marked this pull request as ready for review October 22, 2026 06:34
@cursor
cursor Bot force-pushed the cursor/missing-container-telemetry-skip-78a2 branch from 2790379 to 2a4e0c9 Compare October 22, 2026 06:34

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2a4e0c9. Configure here.

if (!inspectContainer(container)) {
logTelemetryContainerSkip('fleet', vm.id, container)
return telemetryContainerSkip(container)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inspect failures skipped as missing

Medium Severity

The new pre-check treats any failed inspectContainer as a missing slot and returns a successful skip. inspectContainer returns null for daemon-down, permission, and timeout errors as well as a real absence, so those hard failures never reach the later No such container classifier. Fleet then reports ok with skipped_count, and install.sh refresh can exit 0 without restarting Go services.

Fix in Cursor Fix in Web

Triggered by learned rule: kin-egress reload waits for old process exit

Reviewed by Cursor Bugbot for commit 2a4e0c9. Configure here.

@cursor
cursor Bot force-pushed the cursor/missing-container-telemetry-skip-78a2 branch from 71fe04d to 34b35ac Compare October 22, 2026 07:00
cursoragent and others added 5 commits October 22, 2026 08:39
REQ-0628: install.sh upgrade and fleet action=telemetry no longer fail
the whole batch when a DB-registered VM has no kin-NN container on the
host. Log an explicit skip, continue other VMs, and still fail on real
refresh errors.

Co-authored-by: ted <kuhlmangarry24@gmail.com>
Co-authored-by: ted <kuhlmangarry24@gmail.com>
Co-authored-by: ted <kuhlmangarry24@gmail.com>
Co-authored-by: ted <kuhlmangarry24@gmail.com>
Distinguish docker inspect not-found from daemon/permission failures via
inspectContainerOutcome. Pre-check skips only when absent; other inspect
errors fail the slot like a real refresh failure. (#628, REQ-0628)

Co-authored-by: ted <kuhlmangarry24@gmail.com>
@cursor
cursor Bot force-pushed the cursor/missing-container-telemetry-skip-78a2 branch from 34b35ac to 871f448 Compare October 22, 2026 08:39
@dofastted
dofastted merged commit 511231e into main Oct 22, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 使用官方脚本升级vm2api报错

2 participants