BloopAI/vibe-kanban · critical

Failed to install rustls crypto provider

Error message

Failed to install rustls crypto provider

What it means

`rustls::crypto::CryptoProvider::install_default()` panics via `.expect()` when the process-wide default crypto provider cannot be installed. rustls (>=0.23) requires exactly one default provider; installation fails if a default provider was already installed earlier in the process, or if no provider feature (aws-lc-rs/ring) is enabled in the compiled rustls. In a Tauri app this runs first in main, before any TLS.

Source

Thrown at crates/tauri-app/src/main.rs:116

        // Fallback: tauri-plugin-notification (no click handling).
        if let Err(e) = self
            .app_handle
            .notification()
            .builder()
            .title(title)
            .body(message)
            .show()
        {
            tracing::warn!("Failed to send Tauri notification: {}", e);
        }
    }
}

fn main() {
    // Install rustls crypto provider before any TLS operations
    rustls::crypto::aws_lc_rs::default_provider()
        .install_default()
        .expect("Failed to install rustls crypto provider");

    let log_level = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string());
    let filter_string = format!(
        "warn,server={level},services={level},db={level},executors={level},deployment={level},local_deployment={level},utils={level},vibe_kanban_tauri={level}",
        level = log_level
    );
    let env_filter = EnvFilter::try_new(filter_string).expect("Failed to create tracing filter");

    sentry_utils::init_once(SentrySource::Desktop);

    tracing_subscriber::registry()
        .with(tracing_subscriber::fmt::layer().with_filter(env_filter))
        .with(sentry_layer())
        .init();

    // Shared token so we can tell the server to shut down when the app quits.
    let shutdown_token = Arc::new(CancellationToken::new());
    let shutdown_token_for_event = shutdown_token.clone();

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Guard installation: use `rustls::crypto::aws_lc_rs::default_provider().try_install().ok();` or check `rustls::crypto::CryptoProvider::get_default().is_none()` before installing.
  2. Ensure exactly one provider feature is enabled: use rustls with the `aws-lc-rs` feature consistently across the dependency tree (`cargo tree -i rustls`).
  3. If initialization may run twice (tests, re-entry), move install into a std::sync::Once / once_cell lazy static.
  4. Update conflicting dependencies so only one rustls version/provider is compiled in.

Example fix

// before
rustls::crypto::aws_lc_rs::default_provider()
    .install_default()
    .expect("Failed to install rustls crypto provider");
// after
if rustls::crypto::CryptoProvider::get_default().is_none() {
    let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
}
Defensive patterns

Strategy: fallback

Validate before calling

// Check before installing
if rustls::crypto::CryptoProvider::get_default().is_none() {
    rustls::crypto::aws_lc_rs::default_provider().install_default().ok();
}

Type guard

fn provider_installed() -> bool {
    rustls::crypto::CryptoProvider::get_default().is_some()
}

Try / catch

// Use the Result-returning API instead of expect:
if let Err(e) = rustls::crypto::aws_lc_rs::default_provider().install_default() {
    eprintln!("rustls provider install skipped: {e}"); // another provider already active
}

Prevention

When it happens

Trigger: Calling `main()` in a process where another dependency (or a prior call) already called install_default(); or a build where multiple/incompatible provider features or none are enabled for rustls; loading the app in test harnesses that initialize rustls twice.

Common situations: Two dependencies pulling rustls with different providers; running the tauri binary inside tests that also install a provider; feature-flag changes after a Cargo.toml dependency update causing no-provider builds.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/e377db287aec3a0e. Report an issue: GitHub.