{"record":{"id":"f685ce8ebba2077c","repo":"tinyhumansai/openhuman","slug":"sentry-is-not-initialized-in-this-binary-no-dsn","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/cli.rs","lineNumber":280,"sourceCode":"                );\n                println!(\"at runtime, or baked into the binary at build time via option_env!. On\");\n                println!(\"success, prints the event UUID to stdout.\");\n                return Ok(());\n            }\n            other => return Err(anyhow::anyhow!(\"unknown sentry-test arg: {other}\")),\n        }\n    }\n\n    let client = sentry::Hub::current().client();\n    let dsn_host = client\n        .as_deref()\n        .and_then(|c| c.dsn())\n        .map(|d| d.host().to_string());\n\n    match &dsn_host {\n        Some(host) => eprintln!(\"[sentry-test] Sentry client active (dsn host: {host})\"),\n        None => {\n            return Err(anyhow::anyhow!(\n                \"Sentry is not initialized in this binary — no DSN is resolvable. \\\n                 Set OPENHUMAN_CORE_SENTRY_DSN (or the legacy OPENHUMAN_SENTRY_DSN alias) \\\n                 in the environment (or rebuild with it defined at compile time) and try again.\"\n            ));\n        }\n    }\n\n    let msg = message.unwrap_or_else(|| \"openhuman sentry-test ping\".to_string());\n\n    sentry::configure_scope(|scope| {\n        scope.set_tag(\"test\", \"true\");\n        scope.set_tag(\"source\", \"sentry-test-cli\");\n    });\n\n    let event_id = sentry::capture_message(&msg, sentry::Level::Error);\n\n    if let Some(c) = client {\n        if !c.flush(Some(std::time::Duration::from_secs(5))) {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/cli.rs#L262-L298","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Export the DSN and retry: `export OPENHUMAN_CORE_SENTRY_DSN=https://...@sentry.io/... && openhuman sentry-test --message ping`","If your environment uses the legacy name, export OPENHUMAN_SENTRY_DSN instead","For a permanent setup, rebuild with the DSN present at compile time so option_env! bakes it in"],"exampleFix":"# before\nopenhuman sentry-test --panic\n# -> Sentry is not initialized in this binary\n# after\nexport OPENHUMAN_CORE_SENTRY_DSN='https://key@o0.ingest.sentry.io/0'\nopenhuman sentry-test --panic","handlingStrategy":"validation","validationCode":"# bash: fail fast when no DSN is resolvable before probing\n: \"${OPENHUMAN_CORE_SENTRY_DSN:${OPENHUMAN_SENTRY_DSN:?set OPENHUMAN_CORE_SENTRY_DSN (or legacy OPENHUMAN_SENTRY_DSN) before sentry-test}}\"\nopenhuman sentry-test --message \"ci probe\"","typeGuard":null,"tryCatchPattern":"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","preventionTips":["Export the DSN in the same CI step that runs the probe (secret name: OPENHUMAN_CORE_SENTRY_DSN)","Remember the legacy alias OPENHUMAN_SENTRY_DSN also works","For permanently-instrumented builds, bake the DSN at compile time so the probe never depends on the environment"],"tags":["sentry","configuration","environment","observability"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}