tinyhumansai/openhuman · error

Sentry is not initialized in this binary — no DSN is resolva

Error message

Sentry is not initialized in this binary — no DSN is resolvable. Set OPENHUMAN_CORE_SENTRY_DSN (or the legacy OPENHUMAN_SENTRY_DSN alias) in the environment (or rebuild with it defined at compile time) and try again.

What it means

The sentry-test command checked `sentry::Hub::current().client()` and found no DSN, meaning Sentry was never initialized in this process. The DSN is resolved from OPENHUMAN_CORE_SENTRY_DSN (or the legacy OPENHUMAN_SENTRY_DSN alias) at runtime, or baked into the binary at build time via option_env!. The probe refuses to 'succeed' without a real client because its whole purpose is to verify event delivery end-to-end.

Source

Thrown at src/core/cli.rs:280

                );
                println!("at runtime, or baked into the binary at build time via option_env!. On");
                println!("success, prints the event UUID to stdout.");
                return Ok(());
            }
            other => return Err(anyhow::anyhow!("unknown sentry-test arg: {other}")),
        }
    }

    let client = sentry::Hub::current().client();
    let dsn_host = client
        .as_deref()
        .and_then(|c| c.dsn())
        .map(|d| d.host().to_string());

    match &dsn_host {
        Some(host) => eprintln!("[sentry-test] Sentry client active (dsn host: {host})"),
        None => {
            return Err(anyhow::anyhow!(
                "Sentry is not initialized in this binary — no DSN is resolvable. \
                 Set OPENHUMAN_CORE_SENTRY_DSN (or the legacy OPENHUMAN_SENTRY_DSN alias) \
                 in the environment (or rebuild with it defined at compile time) and try again."
            ));
        }
    }

    let msg = message.unwrap_or_else(|| "openhuman sentry-test ping".to_string());

    sentry::configure_scope(|scope| {
        scope.set_tag("test", "true");
        scope.set_tag("source", "sentry-test-cli");
    });

    let event_id = sentry::capture_message(&msg, sentry::Level::Error);

    if let Some(c) = client {
        if !c.flush(Some(std::time::Duration::from_secs(5))) {

View on GitHub (pinned to a221052e0d)

Solutions

  1. Export the DSN and retry: `export OPENHUMAN_CORE_SENTRY_DSN=https://...@sentry.io/... && openhuman sentry-test --message ping`
  2. If your environment uses the legacy name, export OPENHUMAN_SENTRY_DSN instead
  3. For a permanent setup, rebuild with the DSN present at compile time so option_env! bakes it in

Example fix

# before
openhuman sentry-test --panic
# -> Sentry is not initialized in this binary
# after
export OPENHUMAN_CORE_SENTRY_DSN='https://key@o0.ingest.sentry.io/0'
openhuman sentry-test --panic
Defensive patterns

Strategy: validation

Validate before calling

# bash: fail fast when no DSN is resolvable before probing
: "${OPENHUMAN_CORE_SENTRY_DSN:${OPENHUMAN_SENTRY_DSN:?set OPENHUMAN_CORE_SENTRY_DSN (or legacy OPENHUMAN_SENTRY_DSN) before sentry-test}}"
openhuman sentry-test --message "ci probe"

Try / catch

if ! out=$(openhuman sentry-test --message ping 2>&1); then case "$out" in *'no DSN is resolvable'*) echo 'DSN missing — export OPENHUMAN_CORE_SENTRY_DSN and retry' >&2; exit 1 ;; *) printf '%s\n' "$out" >&2; exit 1 ;; esac; fi

Prevention

When it happens

Trigger: Running `openhuman sentry-test` in a shell/CI session where neither env var is exported and the binary was built without a compile-time DSN.

Common situations: Verifying crash reporting in a fresh dev shell; CI jobs that don't pass the DSN secret; builds where only the release pipeline bakes the DSN and a debug binary is being probed.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/f685ce8ebba2077c. Report an issue: GitHub.