Refusals and the stop
When the surface says no, the refusal carries a code, and the code says what to do next. Most codes are denials about the request. Two report a fault, a store or the container engine being unavailable, and one says the instance is going away. A client that tells these apart, and tells them from a lost connection, never reports a denial during an orderly stop, nor a crash where there was a shutdown. This page lists every code, what is still answered while the instance stops, and the three kinds of news a client can receive.
A refusal carries a code, a message for a person and an optional detail. The code is authoritative; what a refusal names — a subject, a capability, a unit — is in the detail, never in the message.
- On the operator projection a refusal travels as the transport's status, carrying the structured error. On the shell projection it travels as a frame of the one call it refuses, and the connection goes on.
- The first segment of a code is its coarse class:
instance.is about the instance;subject.,capability.,stream.andretention.are about what the caller named;unit.is about the unit the operation was addressed to.
The codes
| Code | Refused when |
|---|---|
operation.malformed | the request does not decode, a required field is absent, or the operation was issued on a method that cannot carry it |
operation.unknown | it names an operation this Core does not implement — including a request to end somebody else's connection |
compat.unsupported | the contract version is absent, or this Core does not support it |
subject.unknown | nothing of that kind bears that identity. The detail names the kind and the identity |
subject.wrong_kind | the operation does not take a subject of that kind — enabling a unit, restarting a plugin |
capability.undeclared | a grant names a capability the plugin's Manifest does not declare |
stream.undeclared | the stream is not one the unit's Plugin declared |
scope.undeclared | a question names a type the unit's Plugin never declared. The detail names it |
scope.withheld | the stream or the question's type is declared and the plugin's grants do not cover it. The detail names it |
unit.not_running | the operation needs a running unit and this one is not |
unit.no_session | the unit is running and holds no Session: a unit that runs to completion, a managed interface, or one not yet admitted |
unit.unanswered | 30 s passed with no acknowledgement or answer |
unit.failed | the unit answered with an error. The detail carries the unit's own code, and the message is the unit's |
retention.invalid | a limit is not a positive integer. An override with no limits is legal and means unconstrained |
instance.stopping | an orderly stop is in progress and the operation would change something |
backend.unavailable | the operation needs the container engine and it is not currently observable |
store.unavailable | a write to the Registry or the log store did not succeed |
backend.unavailableandstore.unavailablereport a fault, not a denial. Nothing about the request was wrong, and rephrasing it will not help.- There is no code for an operation a caller was not permitted to perform. A caller that reached the surface may do all of it.
While the instance is stopping
| Operation | During the stop |
|---|---|
read, log.query, log.follow, subscribe | answered, from what the Core still holds |
| a new connection, on either projection | accepted, until the socket is unbound |
plugin.*, unit.*, unit.retention.* | refused instance.stopping |
unit.ask, unit.command | refused instance.stopping |
instance.stoppingis published as an event when the stop begins, before any change is refused, so a subscriber learns of it from the event rather than from a refused write.- Both sockets stay bound until the stop has drained the instance.
Three kinds of news
| What arrives | Says | Is |
|---|---|---|
a denial — any code above but instance.stopping and the two faults | you may not do that, or there is no such thing | about the request, and lasting until something changes |
instance.stopping | this instance is going away | about the instance, and temporary |
| a transport error | the Core died, or the socket is gone | the end of the conversation; there is no code to read |
A client that tells the first from the second does not report an authorisation problem during an orderly stop; one that tells the second from the third does not report a crash where there was a shutdown.