wasmerio/wasmer · error

No value found for secret with name '{}'

Error message

No value found for secret with name '{}'

What it means

`get_secret_value` fetches an app secret's value by its ID via the Wasmer backend GraphQL API. The query can succeed but return `None` for the value; this error converts that None into a descriptive failure naming the secret. It means the backend knows the secret exists but holds (or exposes) no value for it.

Source

Thrown at lib/cli/src/commands/app/secrets/utils/mod.rs:49

    secret_name: &str,
) -> anyhow::Result<Option<BackendSecret>> {
    wasmer_backend_api::query::get_app_secret_by_name(client, app_id, secret_name).await
}
pub(crate) async fn get_secrets(
    client: &WasmerClient,
    app_id: &str,
) -> anyhow::Result<Vec<wasmer_backend_api::types::Secret>> {
    wasmer_backend_api::query::get_all_app_secrets(client, app_id).await
}

pub(crate) async fn get_secret_value(
    client: &WasmerClient,
    secret: &wasmer_backend_api::types::Secret,
) -> anyhow::Result<String> {
    wasmer_backend_api::query::get_app_secret_value_by_id(client, secret.id.clone().into_inner())
        .await?
        .ok_or_else(|| {
            anyhow::anyhow!(
                "No value found for secret with name '{}'",
                secret.name.bold()
            )
        })
}

pub(crate) async fn get_secret_value_by_name(
    client: &WasmerClient,
    app_id: &str,
    secret_name: &str,
) -> anyhow::Result<String> {
    match get_secret_by_name(client, app_id, secret_name).await? {
        Some(secret) => get_secret_value(client, &secret).await,
        None => anyhow::bail!("No secret found with name {secret_name} for app {app_id}"),
    }
}

pub(crate) async fn reveal_secrets(

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Re-create the secret with the intended value (`wasmer app secrets set <name> <value>`) and retry.
  2. Refresh the secret listing (`wasmer app secrets list`) to ensure the secret ID is current, then reveal again.
  3. Verify your account has permission to read secret values for this app.
  4. Check the Wasmer backend status if the value mysteriously disappeared.

Example fix

// before
let value = get_secret_value_by_name(&client, &app_id, "API_KEY").await?;
// after
match get_secret_value_by_name(&client, &app_id, "API_KEY").await {
    Ok(v) => v,
    Err(e) if e.to_string().contains("No value found") => {
        eprintln!("secret API_KEY has no value; setting it first...");
        set_secret(&client, &app_id, "API_KEY", "new-value").await?;
        get_secret_value_by_name(&client, &app_id, "API_KEY").await?
    }
    Err(e) => return Err(e),
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check the secret exists and is listed before reading its value
let secrets = list_app_secrets(client, &app_id).await?;
if !secrets.iter().any(|s| s.name == "API_KEY") {
    eprintln!("secret API_KEY does not exist; create it first");
}

Try / catch

match get_secret_value_by_name(&client, &app_id, name).await {
    Ok(v) => v,
    Err(e) if e.to_string().contains("No value found for secret") => {
        // secret exists but has no value — prompt to set it
        set_secret_value(client, app_id, name).await?
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: `wasmer app secrets get <name>` / `reveal` path: `get_app_secret_value_by_id(client, secret.id)` resolves to `None` for a secret that exists in the app's secret list.

Common situations: Secret was created but its value was never set; value was deleted server-side; using a stale local cache/listing where the secret was since rotated or removed; insufficient permissions to read the secret value.

Related errors


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/f08d63d29984c673. Report an issue: GitHub.