Skip to main content

ServiceError

Enum ServiceError 

Source
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.

Fields

§source: Box<LockError>

What d1 said, including who holds it.

§

LockUnreadable

The lock could not be inspected at all, which is not the same as it being free.

Fields

§source: Box<LockError>

The underlying failure.

§

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.

Fields

§detail: String

What the platform reported.

§

BinaryMissing

The binary named for the registration is not there.

Fields

§path: PathBuf

The path that was to be registered.

§

RestartDelay

The requested restart delay is outside the bound.

Fields

§requested_secs: u64

What was asked for.

§min_secs: u64

The floor.

§max_secs: u64

The ceiling.

§

RestartResetWindow

The failure-count reset window is not longer than the restart delay.

Fields

§reset_secs: u64

What was asked for.

§delay_secs: u64

The delay it has to exceed.

§

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

§name: String

Which registration.

§existing: StartMode

The mode it currently carries.

§requested: StartMode

The mode this install asked for.

§

NotInstalled

No registration is there.

Fields

§name: String

Which registration.

§operation: &'static str

What was being attempted.

§

Record

The record install wrote could not be read or written.

Fields

§operation: &'static str

Read, write, or remove.

§path: PathBuf

The record file.

§detail: String

The underlying failure.

§

RecordUnreadable

The record is there but is not one this version wrote.

Fields

§path: PathBuf

The record file.

§detail: String

What was wrong with it.

§

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.

Fields

§path: PathBuf

The record file.

§detail: String

What the operating system said.

§

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

§operation: &'static str

What was being attempted.

§name: String

Which registration.

§manager: &'static str

Which service manager.

§detail: String

What it said.

§

Rollback

An operation failed and its compensating action failed too.

Fields

§operation: &'static str

The transaction that could not be completed.

§name: String

Which registration was involved.

§cause: String

The original failure.

§rollback: String

The failure while restoring the previous state.

§

NeedsElevation

The operation needs administrative rights it does not have.

Fields

§operation: &'static str

What was being attempted.

§name: String

Which registration.

§detail: String

What the platform said.

§remedy: &'static str

How to get them, in this platform’s own terms.

Trait Implementations§

Source§

impl Debug for ServiceError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ServiceError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ServiceError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more