Skip to main content
Version: 0.9.0

Refusals and the stop

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. and retention. are about what the caller named; unit. is about the unit the operation was addressed to.

The codes​

CodeRefused when
operation.malformedthe request does not decode, a required field is absent, or the operation was issued on a method that cannot carry it
operation.unknownit names an operation this Core does not implement — including a request to end somebody else's connection
compat.unsupportedthe contract version is absent, or this Core does not support it
subject.unknownnothing of that kind bears that identity. The detail names the kind and the identity
subject.wrong_kindthe operation does not take a subject of that kind — enabling a unit, restarting a plugin
capability.undeclareda grant names a capability the plugin's Manifest does not declare
stream.undeclaredthe stream is not one the unit's Plugin declared
scope.undeclareda question names a type the unit's Plugin never declared. The detail names it
scope.withheldthe stream or the question's type is declared and the plugin's grants do not cover it. The detail names it
unit.not_runningthe operation needs a running unit and this one is not
unit.no_sessionthe unit is running and holds no Session: a unit that runs to completion, a managed interface, or one not yet admitted
unit.unanswered30 s passed with no acknowledgement or answer
unit.failedthe unit answered with an error. The detail carries the unit's own code, and the message is the unit's
retention.invalida limit is not a positive integer. An override with no limits is legal and means unconstrained
instance.stoppingan orderly stop is in progress and the operation would change something
backend.unavailablethe operation needs the container engine and it is not currently observable
store.unavailablea write to the Registry or the log store did not succeed
  • backend.unavailable and store.unavailable report 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​

OperationDuring the stop
read, log.query, log.follow, subscribeanswered, from what the Core still holds
a new connection, on either projectionaccepted, until the socket is unbound
plugin.*, unit.*, unit.retention.*refused instance.stopping
unit.askrefused instance.stopping
  • instance.stopping is 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 arrivesSaysIs
a denial — any code above but instance.stopping and the two faultsyou may not do that, or there is no such thingabout the request, and lasting until something changes
instance.stoppingthis instance is going awayabout the instance, and temporary
a transport errorthe Core died, or the socket is gonethe 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.