{"record":{"id":"3b99abd7a3b0ab1f","repo":"jdx/mise","slug":"relay-log-format-must-be-text-or-jsonl","errorCode":null,"errorMessage":"relay log format must be text or jsonl","messagePattern":"relay log format must be text or jsonl","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/github_relay.rs","lineNumber":94,"sourceCode":"/// Resolve observability and limits only after explicit access authorization.\npub(crate) fn configure(\n    scope: Option<Scope>,\n    log_requests: bool,\n    no_log_requests: bool,\n    format: Option<&str>,\n    max_duration: Option<&str>,\n) -> Result<Option<Scope>> {\n    let Some(scope) = scope else {\n        if log_requests || no_log_requests || format.is_some() || max_duration.is_some() {\n            bail!(\"relay options require --github-relay-read-only\");\n        }\n        return Ok(None);\n    };\n    let settings = crate::config::Settings::get();\n    let settings = &settings.github_relay;\n    let format = format.unwrap_or(&settings.log_format);\n    if !matches!(format, \"text\" | \"jsonl\") {\n        bail!(\"relay log format must be text or jsonl\");\n    }\n    let timeout = duration::parse_duration(&settings.request_timeout)?;\n    if timeout.is_zero() {\n        bail!(\"relay request timeout must be greater than zero\");\n    }\n    if !(1..=32).contains(&settings.concurrency) {\n        bail!(\"relay concurrency must be between 1 and 32\");\n    }\n    let max_duration = duration::parse_duration(max_duration.unwrap_or(&settings.max_duration))?;\n    if std::time::Instant::now().checked_add(timeout).is_none()\n        || std::time::Instant::now()\n            .checked_add(max_duration)\n            .is_none()\n    {\n        bail!(\"relay duration is too large\");\n    }\n    #[cfg(not(unix))]\n    let _ = max_duration;","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/github_relay.rs#L76-L112","documentation":"configure validates the relay log format: it takes the --github-relay-log-format value or the [github_relay].log_format setting, and rejects anything other than the literals \"text\" or \"jsonl\". This catches typos and unsupported formats before the relay starts.","triggerScenarios":"configure is called with format set to a value not matching \"text\"|\"jsonl\" (CLI flag) or the setting github_relay.log_format in mise.toml/settings is such a value and no CLI override is given.","commonSituations":"Typo like `--github-relay-log-format json`; using \"json\"/\"pretty\" by analogy with other tools; stale config from an older mise version that allowed other formats.","solutions":["Set the format to \"text\" or \"jsonl\" exactly: --github-relay-log-format jsonl.","Fix the [github_relay] log_format value in mise.toml if it comes from config.","Omit the flag to fall back to the configured default from settings.github_relay.log_format."],"exampleFix":"// before (mise.toml)\n[github_relay]\nlog_format = \"json\"\n// after\n[github_relay]\nlog_format = \"jsonl\"","handlingStrategy":"validation","validationCode":"let f = settings.github_relay.log_format.as_str();\nassert!(matches!(f, \"text\" | \"jsonl\"), \"log_format must be text or jsonl\");","typeGuard":"fn is_valid_log_format(f: &str) -> bool {\n    matches!(f, \"text\" | \"jsonl\")\n}","tryCatchPattern":"match configure(scope, lr, nlr, format, max_duration) {\n    Err(e) if e.to_string().contains(\"text or jsonl\") => {\n        // correct the format and retry\n    }\n    r => r,\n}","preventionTips":["Use exactly \"text\" or \"jsonl\"; \"json\" alone is not accepted.","Validate mise.toml [github_relay] values after copy-pasting from other tools' configs.","Check for schema/config drift when upgrading mise versions."],"tags":["configuration","github-relay","validation","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}