pub enum ServiceError {
Show 16 variants
LockHeld {
source: Box<LockError>,
},
LockUnreadable {
source: Box<LockError>,
},
RunnerRoot {
source: Box<RootAccessError>,
},
BinaryPath {
detail: String,
},
BinaryMissing {
path: PathBuf,
},
RestartDelay {
requested_secs: u64,
min_secs: u64,
max_secs: u64,
},
RestartResetWindow {
reset_secs: u64,
delay_secs: u64,
},
AlreadyInstalled {
name: String,
existing: StartMode,
requested: StartMode,
},
NotInstalled {
name: String,
operation: &'static str,
},
Record {
operation: &'static str,
path: PathBuf,
detail: String,
},
RecordUnreadable {
path: PathBuf,
detail: String,
},
RecordNotPermitted {
path: PathBuf,
detail: String,
},
Paths {
source: Box<PathsError>,
},
Control {
operation: &'static str,
name: String,
manager: &'static str,
detail: String,
},
Rollback {
operation: &'static str,
name: String,
cause: String,
rollback: String,
},
NeedsElevation {
operation: &'static str,
name: String,
detail: String,
remedy: &'static str,
},
}Expand description
Something went wrong installing, inspecting, or removing the registration.
Every variant is formatted straight into an operator-facing message, so each
one says what to do next rather than only what failed. No variant carries a
secret: this module never reads the token, only the location d2 publishes
for exactly this purpose.
Variants§
LockHeld
The single-instance lock is held, so a second agent must not be registered.
05-infrastructure.md item 1. The message is d1’s, verbatim, because
d1 already worked out what to tell an operator who lost that race.
LockUnreadable
The lock could not be inspected at all, which is not the same as it being free.
RunnerRoot
The runner root this registration would run jobs under could not be created, inspected, or given the access the registration’s account needs.
Reported before anything is registered. A registration whose workspaces
would land in a directory ordinary local users can write is a
registration that should not exist, and 04-security-recovery.md asks
for exactly that refusal rather than a warning.
Fields
source: Box<RootAccessError>What crate::runner_root_access reported, including the remedy.
BinaryPath
The path of the running binary could not be resolved.
BinaryMissing
The binary named for the registration is not there.
RestartDelay
The requested restart delay is outside the bound.
RestartResetWindow
The failure-count reset window is not longer than the restart delay.
AlreadyInstalled
A registration is already there, in the other start mode.
Only the other one. A registration in the mode being asked for is
replaced rather than refused — see [Operations::install], and the
outage that taught us why.
Fields
NotInstalled
No registration is there.
Record
The record install wrote could not be read or written.
Fields
RecordUnreadable
The record is there but is not one this version wrote.
RecordNotPermitted
The record is there and this account may not read it.
Its own variant rather than a ServiceError::Record with a
Permission denied in the detail, because it is the one record failure
that is not a fault in the record: service status reports it and
carries on, where every other read failure ends the command. See
[Operations::status].
A version before this one wrote the record at 0600 through a temporary
file, so a boot-mode sudo service install left it owned by root and
unreadable by the operator whose profile it is in. service status then
failed on their own host, with a remedy naming the command that had just
failed.
Paths
The application-data directories could not be resolved or created.
Fields
source: Box<PathsError>The underlying failure.
Control
The platform’s service manager refused, or could not be reached.
Fields
Rollback
An operation failed and its compensating action failed too.
Fields
NeedsElevation
The operation needs administrative rights it does not have.
Trait Implementations§
Source§impl Debug for ServiceError
impl Debug for ServiceError
Source§impl Display for ServiceError
impl Display for ServiceError
Source§impl Error for ServiceError
impl Error for ServiceError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()