{"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":"exception","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/533346cc374382b41ec5ff70536252b2e96e725c/src/github_relay.rs#L76-L112","documentation":"configure validates the relay log format (from --github-relay-log-format or settings.github_relay.log_format) against the two supported values, 'text' and 'jsonl', using matches!. Anything else — including an empty string or misspelling like 'json' or 'structured' — bails with this error.","triggerScenarios":"configure called with format=Some(\"json\") (or any value other than \"text\"/\"jsonl\"), or settings.github_relay.log_format in mise.toml/config set to an unsupported string.","commonSituations":"Typo in the config file (e.g. 'json' instead of 'jsonl'); guessing format names from other tools ('pretty', 'ndjson'); copy-pasting a config from a different tool.","solutions":["Set the format to exactly \"jsonl\" for newline-delimited JSON logs","Or set it to \"text\" for human-readable logs","Check the github_relay.log_format value in your settings/config file for typos"],"exampleFix":"// before (settings)\n[github_relay]\nlog_format = \"json\"\n// after\n[github_relay]\nlog_format = \"jsonl\"","handlingStrategy":"validation","validationCode":"// Pre-validate the configured format\nlet format = std::env::var(\"GITHUB_RELAY_LOG_FORMAT\").unwrap_or_default();\nassert!(format.is_empty() || matches!(format.as_str(), \"text\" | \"jsonl\"), \"log format must be text or jsonl\");","typeGuard":null,"tryCatchPattern":"match err {\n    RelayConfigError::BadLogFormat => eprintln!(\"set github_relay.log_format to 'text' or 'jsonl'\"),\n    e => return Err(e),\n}","preventionTips":["Use only documented values: 'text' and 'jsonl'","Note that ndjson == jsonl here; do not invent names","Validate config at load time with a lint/test","Grep config files for log_format when onboarding"],"tags":["github-relay","configuration","validation","logging"],"backgroundTag":"invalid-enum-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}