{"record":{"id":"bf5d2be39fccf5f2","repo":"tinyhumansai/openhuman","slug":"missing-value-for-message","errorCode":null,"errorMessage":"missing value for --message","messagePattern":"missing value for --message","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/cli.rs","lineNumber":243,"sourceCode":"/// DSN, the command exits non-zero with a diagnostic instead of silently\n/// producing no telemetry.\n///\n/// Only compiled with the `crash-reporting` feature; the `#[cfg(not(...))]`\n/// companion below returns a disabled-build error (mirrors the `mcp` CLI\n/// precedent, where the subcommand arm + top-level help stay compiled and the\n/// handler reports the build fact rather than a bogus \"unknown command\").\n#[cfg(feature = \"crash-reporting\")]\nfn run_sentry_test_command(args: &[String]) -> Result<()> {\n    let mut message: Option<String> = None;\n    let mut do_panic = false;\n    let mut i = 0usize;\n\n    while i < args.len() {\n        match args[i].as_str() {\n            \"--message\" => {\n                message = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow::anyhow!(\"missing value for --message\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"--panic\" => {\n                do_panic = true;\n                i += 1;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\"Usage: openhuman sentry-test [--message <text>] [--panic]\");\n                println!();\n                println!(\"  --message <text>  Body of the Error-level event sent to Sentry\");\n                println!(\"                    (default: \\\"openhuman sentry-test ping\\\")\");\n                println!(\"  --panic           After capturing the event, trigger a panic so the\");\n                println!(\"                    panic integration reports it as a separate event.\");\n                println!();\n                println!(\n                    \"Requires OPENHUMAN_CORE_SENTRY_DSN (or the legacy OPENHUMAN_SENTRY_DSN alias)\"","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/cli.rs#L225-L261","documentation":"The `openhuman sentry-test` probe requires the text to follow `--message` as the next token; the flag was the last argument, so `args.get(i + 1)` returned None. This parser does not inspect the value's shape, so unlike the launch-option parser it only fires at end-of-args — a following flag would be consumed as the message text.","triggerScenarios":"`openhuman sentry-test --message` with nothing after it; a script truncating its argument list before the value.","commonSituations":"Testing the Sentry pipeline quickly and forgetting the payload; assuming a `--message=text` equals form works (it does not — that form is rejected as an unknown arg); shell arrays built with an odd length.","solutions":["Pass the text as the next token: `openhuman sentry-test --message \"my event text\"`","Omit `--message` entirely to use the built-in default \"openhuman sentry-test ping\"","Check usage with `openhuman sentry-test --help`"],"exampleFix":"# before\nopenhuman sentry-test --message\n# after\nopenhuman sentry-test --message \"deploy verification\"","handlingStrategy":"validation","validationCode":"# bash: only append --message when a payload exists\nargs=(sentry-test)\n[ -n \"${MSG:-}\" ] && args+=(--message \"$MSG\")\n[ \"${PANIC:-0}\" = 1 ] && args+=(--panic)\nopenhuman \"${args[@]}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit --message to use the default 'openhuman sentry-test ping' payload","Do not use the --message=text equals form — this parser rejects it","Keep flag/value pairs as single array elements in wrapper scripts"],"tags":["cli","sentry","argument-parsing","debugging"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}