Skip to content

[16.0-stable] pillar: report nested-app runtime status errors - #7118

Merged
rene merged 2 commits into
lf-edge:16.0-stablefrom
andrewd-zededa:pr6890-16.0-stable
Nov 16, 2026
Merged

rene merged 2 commits into
lf-edge:16.0-stablefrom
andrewd-zededa:pr6890-16.0-stable

Conversation

@andrewd-zededa

@andrewd-zededa andrewd-zededa commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backport of #6890

Report errors from a nested-app runtime (for example, a failure applying
cloud-init config) as app errors, next to the existing lifecycle error.

  • zedrouter polls the runtime's GET /api/v1/runtime/status alongside the
    existing nested-app metrics, and publishes the result as a new
    AppRuntimeStatus topic keyed by the app instance UUID. The topic is
    unpublished once the runtime is no longer polled (halt, re-address or
    delete). A runtime without this endpoint answers 404, which is logged at
    trace level only.
  • zedmanager copies it into a new AppInstanceStatus.RuntimeErr field, kept
    apart from the lifecycle error so neither replaces the other.
  • zedagent reports RuntimeErr as an additional AppErr entry with its own
    severity. LPS reports it when there is no lifecycle error, and diag prints
    it.

The runtime's errors are guest-controlled, and publishing an oversized pubsub
message is fatal, so the conversion keeps at most 4 entries of 160 bytes each,
highest severity first, and notes how many were omitted.

Both commits are cherry-picked with -x. One adaptation:
pkg/pillar/docs/types-architecture.md does not exist on 16.0-stable (it
came with #5897, which is not backported), so the first commit's hunk for it is
dropped. The commit message records this. Everything else applied unchanged.

PR dependencies

Both are merged into 16.0-stable:

How to test and validate this PR

Unit tests (automated):

make -C pkg/pillar TESTPKGS='./cmd/zedrouter/ ./cmd/zedmanager/ ./cmd/zedagent/ ./types/' \
  TESTRUN="'TestRuntimeStatus|TestFetchHTTPData|TestSyncRuntimeErr|TestAppErrors|TestAppInstanceStatusTruncateErrors'" \
  test

Changelog notes

Errors reported by a nested-app runtime, such as cloud-init failures, are now
shown as app errors.

PR Backports

This is the backport

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

For backport PRs (remove it if it's not a backport):

  • I've added a reference link to the original PR
  • PR's title follows the template

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

🤖 Generated with Claude Code

andrewd-zededa and others added 2 commits November 13, 2026 12:50
zedrouter now fetches the runtime's status (e.g. cloud-init failures)
from GET /api/v1/runtime/status and publishes it as a new
AppRuntimeStatus topic, keyed by app instance UUID, unpublishing it
once the runtime is no longer polled. zedmanager copies it into a new
AppInstanceStatus.RuntimeErr field, kept apart from the lifecycle
error so neither replaces the other.

zedagent reports RuntimeErr as an additional AppErr entry with its own
severity, LPS reports it when there is no lifecycle error, and diag
prints it.

The runtime's errors are guest-controlled, and publishing an oversized
pubsub message is fatal, so the conversion keeps at most 4 entries of
160 bytes each, highest severity first, and notes how many were
omitted. ErrorTime is the latest timestamp the runtime reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 15b08bb)

Backport note: pkg/pillar/docs/types-architecture.md does not exist on
16.0-stable, so its hunk is dropped.

Signed-off-by: Andrew Durbin <andrewd@zededa.com>
Cover runtimeStatusToErrorDescription's entry and length limits,
severity ordering and normalization, deterministic output, and
timestamp selection, check that a hostile runtime cannot push the
published AppRuntimeStatus near the pubsub message limit, and check
that fetchHTTPData reports a 404 as an httpStatusError.

Check that zedmanager copies AppRuntimeStatus into RuntimeErr without
touching the lifecycle error, that TruncateErrors also bounds
RuntimeErr, and that zedagent reports both errors in AppErr without
empty entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e93e312)
Signed-off-by: Andrew Durbin <andrewd@zededa.com>
@andrewd-zededa andrewd-zededa added the next-16.0.x-rc PR must be present in the next 16.0.x patch release label Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.55%. Comparing base (c5932fa) to head (3b711c3).
⚠️ Report is 3 commits behind head on 16.0-stable.

Additional details and impacted files
@@               Coverage Diff                @@
##           16.0-stable    #7118       +/-   ##
================================================
+ Coverage             0   33.55%   +33.55%     
================================================
  Files                0       15       +15     
  Lines                0     2962     +2962     
================================================
+ Hits                 0      994      +994     
- Misses               0     1968     +1968     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknordmark eriknordmark 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.

LGTM

@rene
rene merged commit 3226ac6 into lf-edge:16.0-stable Nov 16, 2026
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next-16.0.x-rc PR must be present in the next 16.0.x patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants