Repairs and the plugin issue registry
A plugin raises an issue to tell an operator about a problem only the operator can fix — an expired token, an unreachable bridge, an outdated configuration. An issue is an alert on the shared alert store: it is listed on the Alerts tab of System status, with an optional fix hint and an optional guided repair flow, and the operator can acknowledge, snooze or silence it like any other alert.
Health checks answer "is the system up" and audit records answer "who did what". The issue registry answers "this bridge needs re-authorising".
Which alert an issue becomes
The code decides the alert kind (PluginIssueAlerts.FingerprintOf). One alert exists per fingerprint, so raising the
same code on the same instance from any replica, or twice, updates one alert.
| Code | Alert kind | Fingerprint parameters |
|---|---|---|
secret_unreadable |
plugin.secret_unreadable (Error) |
plugin instance |
workload.{id}.module_swap_incomplete |
plugin.roll_incomplete |
plugin instance, workload |
workload.{id}.stuck, .crashloop, .version_skew, .parked, .unavailable |
workload.diagnostic |
plugin instance, the full code |
workload.{id}.rollback_failed |
workload.rollback_failed |
plugin instance, the full code |
| anything else | plugin.issue |
plugin instance, code |
A kind with a fixed severity in the catalogue overrides the severity the producer passes. A code naming no workload
(workload..stuck) is a plain plugin.issue. A code is at most 128 characters and a message is cut at 2000.
workload.diagnostic has no fixed severity, so the workloads library's own applies: stuck is a Warning for a stalled
deploy and for a workload left Degraded or Unknown past Workloads:Repairs:StuckWarningAfterSeconds (900 s by
default), and an Error when such a workload is Failed. The host raises its own outage alert
workload.{id}.unavailable as an Error when a workload has been Failed for 30 seconds (its Deployment deleted out of
band, a crash or image-pull back-off, an exited container), on its 30-second cluster-workload alert pass, so within a
minute; the fix hint is to redeploy from the plugin's Deployment tab. One outage is one occurrence: the alert stays open
through Deploying, Degraded, Unknown and short Healthy spells of a crash loop, and clears only once the workload
has been Healthy (or ExternallyManaged) for 2 minutes, or at once when it is Suspended, Terminating or its row is
gone. While it is open and the workload is Failed with a reason that differs from the stored one, the host updates
the alert's message to that reason; the occurrence stays the same, so no notification is sent again. The library never
raises or clears this code.
One outage is one alert, so the library's stuck and crashloop for a workload are folded into its outage alert:
- While the workload's
unavailableis open, astuckor acrashloopraised for it is kept as an Info alert: it is listed on the Alerts tab with its detail, is not in the bell, and is never delivered (no sink threshold is below Warning) or published to alert subscribers. - When
unavailableopens, the host lowers the workload's openstuckandcrashloopto Info, and keeps doing so on each pass while it stays open. It lowers only an alert that is still open when it writes, so a detail the library has just cleared is never reopened. - The
unavailableraise continues the workload'sstuckandcrashloop: when one of them is open, still at the severity it was delivered at, and that delivery was for its current occurrence,unavailablecounts as delivered at that severity. So astuckError raised before the outage alert opened (a workloadDegraded,Unknownor flapping forStuckWarningAfterSecondsthat then staysFailed) is the outage's one Error notification, andunavailabletakes over in the bell without another. A detail already lowered to Info carries nothing, so an outage that opens again after a suspend and resume is notified. - When the outage alert clears because the workload has served for 2 minutes, a folded
crashloopthat is still open returns to its Warning: the library still sees the restart count rising (it clearscrashloopwhen the count drops or has not risen forWorkloads:Repairs:CrashLoopWindowSeconds, 900 s by default). That is a Warning, never a second Error, and it reaches only sinks whose threshold is Warning, unless its Warning was already delivered.
So a workload that is down shows one alert in the bell and sends one Error notification, however long it stays down
and across restarts of the host. A crash loop or a stall with no outage alert still raises its own alert, and so does a
stuck Error for an outage whose Failed spells each last under 30 seconds between Degraded or Unknown ones,
since no outage alert opens for it. version_skew, parked and rollback_failed are never folded.
Accepted limits:
- A stall or crash loop Warning raised before the outage alert opened has already reached the sinks whose threshold is Warning; the outage Error is then a severity escalation and is delivered as one.
- The check that folds a detail and the read of the details' delivery marks do not take the detail's lock against the
outage alert's raise. If the library's pass and the host's pass raise for the same workload within the same few
milliseconds, a
stuckError and the outage Error can both be delivered.
The crash detail stays visible: the outage alert's message carries the provider's latest failure reason
(CrashLoopBackOff: container … exited with code 1, ErrImagePull), the folded crashloop stays on the Alerts tab as
Info, and the plugin's Deployment tab, which the alert links to, shows the workload's state message, restart count,
provider events and logs. The library clears a workload instance's open stuck, crashloop, version_skew, parked
and rollback_failed alerts when it deletes the instance's row.
Severity
| Severity | Use for | Needs attention |
|---|---|---|
Info |
Non-blocking notes, e.g. a firmware update is available | No: listed, never counted |
Warning |
Degraded behaviour worth knowing about | Yes |
Error |
A specific feature is broken | Yes |
Critical |
The plugin or integration is non-functional | Yes |
Ordering is Critical > Error > Warning > Info; the alert list returns the highest first. The System status badge counts
every alert that needs attention, at Warning or above in any area, and takes its colour from the worst. An alert stops
needing attention when an operator acknowledges, snoozes or silences it; a plugin that wants no badge raises Info, which never needs attention.
Raise and clear
RaiseIssueAsync(code, severity, message, fixHint?, repairFlowId?, metadata?, ct) identifies an issue by
(plugin instance, code) and raises the alert without a subject. ClearIssueAsync(code, ct) resolves only that alert.
Clearing a code that does not exist, or one that is already resolved, is a no-op.
RaiseIssueAsync(IssueReport, ct) can add a Subject and an absolute HTTPS DocsUrl.
The report uses required Code, Severity and Message properties:
await context.HostServices.IssueRegistry.RaiseIssueAsync(new IssueReport
{
Code = "node_unavailable",
Severity = IssueSeverity.Error,
Message = "Node is unavailable.",
Subject = nodeId,
DocsUrl = "https://docs.example.test/node-unavailable",
}, cancellationToken);
await context.HostServices.IssueRegistry.ClearIssueAsync("node_unavailable", nodeId, cancellationToken);
The subject is trimmed; a blank subject means no subject. A nonblank subject is limited to 256 characters and may
not contain NUL. It participates in the fingerprint for ordinary plugin.issue codes, so the same code can have
separate alerts for separate subjects. Codes mapped to core alert kinds reject nonblank subjects because their
fingerprint identity is fixed. ClearIssueAsync(code, subject, ct) resolves only the matching subject alert. Invalid
subjects and non-HTTPS or non-absolute documentation links are rejected with
ArgumentException. A change to severity, message, fix hint or documentation link re-announces the alert.
An operator's acknowledge, snooze or silence belongs to the fingerprint, not to one occurrence. A silence outlives a clear and a re-raise. An acknowledgement covers the occurrence it was given on and lapses when the alert resolves and is raised again.
Never put secrets in metadata. It is visible to any administrator who can see the alert and to the database. Metadata is serialised as JSON and capped; an oversize payload is dropped with a warning and the issue is raised without it — the host never fails a raise because of metadata.
Repair flows
A plugin that publishes a repairFlowId on an issue must also expose that flow from its factory. Repair flows reuse
the config-flow step and result shapes, so the frontend dialog code is shared. The routes are
POST /api/alerts/{id}/repair/start, …/repair/{flowId}/submit and …/repair/{flowId}/abort, where {id} is the
alert id. A caller must see the alert (otherwise 404) and hold its kind's act permission (otherwise 403); the
alert must be open and carry a repair flow.
internal sealed class ReauthorizeRepairFlow : IRepairFlow
{
public string RepairFlowId => "reauth";
public ConfigFlowStep StartStep => ConfigFlowStep.InfoMessage(
"confirm", "Re-authorise", "Click Continue to refresh the token.");
public async Task<ConfigFlowResult> SubmitAsync(
string stepId, IReadOnlyDictionary<string, object?> answers,
RepairFlowContext context, CancellationToken ct)
{
if (stepId != "confirm") return new ConfigFlowResult.Error("Unknown step.");
// ... refresh the credential ...
await context.HostServices.IssueRegistry.ClearIssueAsync("token-expired", ct);
return new ConfigFlowResult.Finish(new Dictionary<string, object?>());
}
}
A repair flow's session lives in Redis for 15 minutes from its last step. Answers to fields declared Sensitive (or of
type Password) are stored encrypted with the same Data Protection purpose the config flows use, and are decrypted only
for the plugin's submit, where they arrive as the plain values the operator typed.
A flow returning Finish emits a completion audit event and resolves the alert it was started from, so a flow
need not clear the issue itself; a plugin that clears it earlier is harmless.
Audit events
| Event | When |
|---|---|
repairs.issue.raised |
Every raise that creates or materially changes an open alert |
repairs.issue.cleared |
The plugin clears the code, or a repair flow finishes |
repairs.flow.completed |
A repair flow returns Finish |
Plugin-raised entries also carry the subject when one was supplied. Each carries the plugin instance, code, severity
and the alert id as the entity id, and the initiator — a user id for operator actions, the system for plugin-initiated
transitions. Acknowledging, snoozing and silencing write the
alerts.* events of the alerts module.
The System status page, its sidebar badge and the bell refetch on the AlertsChanged hub push. Plugins that subscribe to ISystemAlertBus still receive
RepairsIssueRaisedEvent on every raise that creates or changes an alert.
Issues a plugin update raises
The workloads library and Reeve's plugin roll raise issues on the plugin instance being updated, through the same
registry, one per workload of the update, coded workload.{workloadId}.….
| Code | Severity | Raised | Cleared |
|---|---|---|---|
workload.{id}.module_swap_incomplete |
Warning while waiting; Error when halted |
A call of the plugin roll that has not finished the fleet, when the roll's detail, halt or named replica changed since the stage last raised it, or the stage's leadership tenure is new; metadata holds the latest update intent | When that intent is terminal, or an intent-less clear matches the instance and workload. |
workload.{id}.rollback_failed |
Error |
The instance's latest update ended RollbackFailed, a Give up included |
When a later update of the instance supersedes it |
Cluster diagnostics use current membership only when Coordination:Clustered is enabled. An unclustered
host keeps its single-host behavior without reading membership. In a cluster, the census is the cluster
library's leased members that are not fenced or draining, each named by the process id in its fresh reeve status
section. A gracefully stopped replica leaves the census immediately. After a crash, its row stays in the census for at most
the library's lease, Cluster:LeaseTtl (30 s), and the roll then waits for the fleet below FleetSize. A peer
without a reeve section at most 45 seconds old makes the census incomplete. Each stage call refreshes the census
before choosing a turn. A membership read failure or a census without this replica leaves the roll waiting.
The roll's message reads The plugin roll of '{workload}' to {version} has not finished: {detail}., and its
metadata carries pluginTypeId, targetVersion, replicaId and, for a halt, haltId. For a halt the detail is
halted: {replica} {reason}; halt {haltId}, with ; and n more faults at {version} before the halt id
when the halt lists faults its reason does not quote. The fix hint depends on the halt:
| The halt | Fix hint |
|---|---|
| A turn failed, or a fault at the new version | Fix the cause, then Retry with the halt id; or Give up and fix forward with another version |
| A turn that did not finish | Restart the named replica if it is still running, then Retry with the halt id; or Give up |
| A fault already acknowledged has repeated | Fix it and Retry, disable the failing instance and Retry, or Give up |
While the roll waits rather than halts — for a turn, the fleet, fresh reports or a host rollout — the hint says it
goes on by itself and to check the named replica's plugin host logs if it stays. After a Give up the roll's issue
is cleared and the library raises rollback_failed, whose message quotes the stage's reason after Why:: who gave up, where
the walk stood, whether the pin committed and which replicas report the new version. The rest of its text and its
fix hint are the library's, about reconciling by hand; after a Give up the way on is an update to another version. The actions are in
the operations guide.
Out of scope
Assignees and service-level tracking. Sending an alert out by email or push is the alert delivery setting, described in alerts.