astrid-runtime/astrid · error

kernel rejected projection-name diagnostic: {message}

Error message

kernel rejected projection-name diagnostic: {message}

What it means

Raised by the public method `projection_name_diagnostic` in `astrid-uplink/src/kernel_client.rs:342`. After sending a projection-name diagnostic request and awaiting the response, a `KernelResponse::Error(message)` variant is converted into this error carrying the kernel's message. It means the kernel understood the request but refused it, and the kernel's reason is embedded in the error text.

Source

Thrown at crates/astrid-uplink/src/kernel_client.rs:342

    ) -> Result<ProjectionNameDiagnostic> {
        let payload = serde_json::json!({
            "method": PROJECTION_NAME_DIAGNOSTIC_METHOD,
            "params": { "policy": policy },
        });
        let (message, response_topic) = build_named_request_message(
            &self.caller,
            self.device_key_id.as_deref(),
            PROJECTION_NAME_DIAGNOSTIC_TOPIC,
            payload,
        );
        match self
            .send_and_wait(message, response_topic, MAX_TOTAL)
            .await?
        {
            KernelResponse::Success(value) => {
                serde_json::from_value(value).context("decode projection-name diagnostic response")
            },
            KernelResponse::Error(message) => Err(anyhow!(
                "kernel rejected projection-name diagnostic: {message}"
            )),
            _ => Err(anyhow!(
                "kernel returned an unexpected projection-name diagnostic response"
            )),
        }
    }

    /// [`request`](Self::request) with an explicit overall ceiling.
    ///
    /// The public entrypoint passes [`MAX_TOTAL`]; a test passes a short ceiling
    /// so the "unending keepalives are bounded" path is exercisable without
    /// waiting ten minutes. Production behaviour is unchanged.
    async fn request_with_ceiling(
        &mut self,
        req: KernelRequest,
        max_total: Duration,
    ) -> std::result::Result<KernelResponse, KernelClientError> {

View on GitHub (pinned to affd8760f4)

Solutions

  1. Read `{message}` — it contains the kernel's specific rejection reason for the diagnostic.
  2. Validate the projection name against kernel naming rules before requesting the diagnostic.
  3. Confirm the kernel is fully initialized and the diagnostic feature is enabled in its config.
  4. Align client and kernel versions if the diagnostic request schema changed between releases.
  5. Only retry after changing the request; a deterministic kernel rejection will recur identically.

Example fix

// before
let diag = kernel.projection_name_diagnostic(name).await?;
// after
let diag = kernel.projection_name_diagnostic(name).await.map_err(|e| {
    if e.to_string().contains("unknown projection") {
        bail!("projection {name} does not exist on the kernel");
    }
    e
})?;
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate the projection name client-side before requesting a diagnostic
if name.is_empty() || !name.chars().all(|c| c.is_alphanumeric() || c == '-' || c == '_') {
    bail!("invalid projection name: {name:?}");
}

Type guard

fn is_kernel_error(resp: &KernelResponse) -> Option<&str> {
    match resp {
        KernelResponse::Error(m) => Some(m),
        _ => None,
    }
}

Try / catch

let diag = match kernel.projection_name_diagnostic(&name).await {
    Ok(d) => d,
    Err(e) => {
        warn!(error = %e, name, "projection-name diagnostic rejected");
        return Err(e);
    }
};

Prevention

When it happens

Trigger: Specifically: `send_and_wait(message, response_topic, MAX_TOTAL)` returns `KernelResponse::Error(message)` while awaiting a projection-name diagnostic reply. The kernel-side diagnostic handler rejected the request (invalid projection name, diagnostic subsystem unavailable, permission or state error).

Common situations: Querying a projection name that does not exist or violates kernel naming rules; the kernel's diagnostic facility is disabled in the running configuration; client/kernel version skew where the diagnostic request no longer matches what the kernel expects; sending the diagnostic before the kernel finished initializing projections.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/81d385e74a10beb9. Report an issue: GitHub.